Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mejdi14/flat-dialog-android
đŸ“±Android Library to implement beautiful dialogs in android apps easily
https://github.com/mejdi14/flat-dialog-android
android android-library android-ui design dialog hacktoberfest
Last synced: 8 days ago
JSON representation
đŸ“±Android Library to implement beautiful dialogs in android apps easily
- Host: GitHub
- URL: https://github.com/mejdi14/flat-dialog-android
- Owner: mejdi14
- License: mit
- Created: 2019-10-13T10:52:45.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-27T22:37:39.000Z (about 2 years ago)
- Last Synced: 2024-10-31T16:47:12.638Z (20 days ago)
- Topics: android, android-library, android-ui, design, dialog, hacktoberfest
- Language: Java
- Homepage:
- Size: 2.14 MB
- Stars: 161
- Watchers: 5
- Forks: 24
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flat-Dialog
[![platform](https://img.shields.io/badge/platform-Android-yellow.svg)](https://www.android.com)
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![](https://jitpack.io/v/mejdi14/Flat-Dialog-Android.svg)](https://jitpack.io/#mejdi14/Flat-Dialog-Android)
## Installation
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):```gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
## DependencyAdd this to your module's `build.gradle` file (make sure the version matches the JitPack badge above):
```gradle
dependencies {
...
implementation 'com.github.mejdi14:Flat-Dialog-Android:1.0.5'
}
```## Screenshots
## How to use with java
``` java
final FlatDialog flatDialog = new FlatDialog(ExempleActivity.this);
flatDialog.setTitle("Login")
.setSubtitle("write your profile info here")
.setFirstTextFieldHint("email")
.setSecondTextFieldHint("password")
.setFirstButtonText("CONNECT")
.setSecondButtonText("CANCEL")
.withFirstButtonListner(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(ExempleActivity.this, flatDialog.getFirstTextField(), Toast.LENGTH_SHORT).show();
}
})
.withSecondButtonListner(new View.OnClickListener() {
@Override
public void onClick(View view) {
flatDialog.dismiss();
}
})
.show();
```## How to use with kotlin
``` java
val flatDialog = FlatDialog(this@MainActivity)
flatDialog.setTitle("Login")
.setSubtitle("write your profile info here")
.setFirstTextFieldHint("email")
.setSecondTextFieldHint("password")
.setFirstButtonText("CONNECT")
.setSecondButtonText("CANCEL")
.withFirstButtonListner {
// do something ...
}
.withSecondButtonListner {
flatDialog.dismiss()
}
.show()
```## More useful methods
Method
Description
isCancelable(boolean)
Define if you want to close dialog when you click outside
setIcon(image)
Add an image at the top of the dialog
setBackgroundColor(color)
Change the dialog background color
setFirstTextFieldHint(String)
Set a hint for the edittext
setFirstTextFieldTextColor(color)
Set the edittext text color
setFirstTextFieldBorderColor(color)
Set the border color for the edittext
setFirstTextFieldInputType(type)
Set the input type for the edittext
setFirstButtonColor(color)
Set the button background color
## Contributing
Any contributions, large or small, major features, bug fixes, are welcomed and appreciated