Android GetEmailDialog
is an easy IntroScene UI implement library for Android
.
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this to your module's build.gradle
file (make sure the version matches the JitPack badge above):
dependencies {
implementation 'com.github.dangnhat99:Android-GetEmailDialog:1.3'
}
In activity
//show GetEmail Dialog
GetEmailDialog emailDialog = new GetEmailDialog(new GetEmailDialog.GetEmailCallback() {
@Override
public void onYesButtonClick(String email) {
Toast.makeText(MainActivity.this, email, Toast.LENGTH_SHORT).show();
}
@Override
public void onNoButtonClick() {
Toast.makeText(MainActivity.this, "cancel", Toast.LENGTH_SHORT).show();
}
});
emailDialog.show(getSupportFragmentManager(), "YOUR_TAG");
In fragment
// from View
//show intro scene
GetEmailDialog emailDialog = new GetEmailDialog(new GetEmailDialog.GetEmailCallback() {
@Override
public void onYesButtonClick(String email) {
Toast.makeText(MainActivity.this, email, Toast.LENGTH_SHORT).show();
}
@Override
public void onNoButtonClick() {
Toast.makeText(MainActivity.this, "cancel", Toast.LENGTH_SHORT).show();
}
});
emailDialog.show(getChildFragmentManager(), "YOUR_TAG");
GetEmailDialog Options
- emailDialog.setTitle(String title)
- emailDialog.setSubTitle(String subTitle)
- emailDialog.setYesTitle(String yesTitle)
- emailDialog.setNoTitle(String noTitle) -emailDialog.setHint(String hint) //hint for editText
Dmnhat