Last active
December 6, 2019 08:52
-
-
Save nknr/391b993041d3a902b27040276c01ca00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void showDialog(){ | |
AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(this); | |
builder.setTitle(R.string.exit); | |
builder.setMessage(R.string.exit_text); | |
builder.setPositiveButton(getResources().getString(R.string.yes), (dialog, arg1) -> finishAffinity()); | |
builder .setNegativeButton(getResources().getString(R.string.no), (dialog, arg1) -> dialog.dismiss()); | |
androidx.appcompat.app.AlertDialog dialog = builder.create(); | |
dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation_2; | |
dialog.show(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:fromYDelta="0%p" | |
android:interpolator="@android:anim/accelerate_interpolator" | |
android:toXDelta="100%p"/> | |
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:fromYDelta="100%" | |
android:interpolator="@android:anim/accelerate_interpolator" | |
android:toXDelta="0"/> | |
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="DialogAnimation_2"> | |
<item name="android:windowEnterAnimation">@anim/slide_up</item> | |
<item name="android:windowExitAnimation">@anim/slide_bottom</item> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment