diff options
| author | JosJuice <josjuice@gmail.com> | 2022-09-11 17:54:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-11 17:54:02 +0200 |
| commit | 702e7bad585f7f417ab75c42385523f25bd2ce8b (patch) | |
| tree | 80d920a674e2ca8eeac30284119c3d78ee71e5aa /Source/Android | |
| parent | 713b535eb9a386422da43140da8d48d0c7c4214d (diff) | |
| parent | 9fcc3e2e92d8c5fce4fe9b8887657242723f4a09 (diff) | |
Merge pull request #11044 from t895/dialog-animations
Android: Add custom window animation to alert dialogs
Diffstat (limited to 'Source/Android')
6 files changed, 51 insertions, 5 deletions
diff --git a/Source/Android/app/src/main/res/anim/fade_in.xml b/Source/Android/app/src/main/res/anim/fade_in.xml new file mode 100644 index 0000000000..3767d530d5 --- /dev/null +++ b/Source/Android/app/src/main/res/anim/fade_in.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> +<alpha + android:duration="@android:integer/config_shortAnimTime" + android:interpolator="@android:anim/decelerate_interpolator" + android:fromAlpha="0" + android:toAlpha="1" /> + +<scale + android:duration="@android:integer/config_shortAnimTime" + android:interpolator="@android:anim/decelerate_interpolator" + android:fromXScale="0.95" + android:fromYScale="0.95" + android:pivotX="50%" + android:pivotY="50%" + android:toXScale="1.0" + android:toYScale="1.0" /> +</set>
\ No newline at end of file diff --git a/Source/Android/app/src/main/res/anim/fade_out.xml b/Source/Android/app/src/main/res/anim/fade_out.xml new file mode 100644 index 0000000000..fab1686871 --- /dev/null +++ b/Source/Android/app/src/main/res/anim/fade_out.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> +<alpha + android:duration="@android:integer/config_shortAnimTime" + android:interpolator="@android:anim/decelerate_interpolator" + android:fromAlpha="1" + android:toAlpha="0" /> + +<scale + android:duration="@android:integer/config_shortAnimTime" + android:interpolator="@android:anim/decelerate_interpolator" + android:fromXScale="1.0" + android:fromYScale="1.0" + android:pivotX="50%" + android:pivotY="50%" + android:toXScale="0.95" + android:toYScale="0.95" /> +</set>
\ No newline at end of file diff --git a/Source/Android/app/src/main/res/values-night-v31/themes.xml b/Source/Android/app/src/main/res/values-night-v31/themes.xml index fac737af73..c54c191654 100644 --- a/Source/Android/app/src/main/res/values-night-v31/themes.xml +++ b/Source/Android/app/src/main/res/values-night-v31/themes.xml @@ -27,7 +27,7 @@ <item name="android:colorControlHighlight">@color/m3_sys_color_dynamic_dark_on_surface_variant</item> <item name="android:colorEdgeEffect">@color/m3_sys_color_dynamic_dark_secondary</item> - <item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item> + <item name="materialAlertDialogTheme">@style/MaterialDialog</item> <item name="popupTheme">@style/ThemeOverlay.Material3</item> </style> </resources> diff --git a/Source/Android/app/src/main/res/values-v31/themes.xml b/Source/Android/app/src/main/res/values-v31/themes.xml index 0b7905858d..2e75d2d205 100644 --- a/Source/Android/app/src/main/res/values-v31/themes.xml +++ b/Source/Android/app/src/main/res/values-v31/themes.xml @@ -27,7 +27,7 @@ <item name="android:colorControlHighlight">@color/m3_sys_color_dynamic_light_on_surface_variant</item> <item name="android:colorEdgeEffect">@color/m3_sys_color_dynamic_light_secondary</item> - <item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item> + <item name="materialAlertDialogTheme">@style/MaterialDialog</item> <item name="popupTheme">@style/ThemeOverlay.Material3</item> </style> </resources> diff --git a/Source/Android/app/src/main/res/values/styles.xml b/Source/Android/app/src/main/res/values/styles.xml index 0537dca945..553a60456b 100644 --- a/Source/Android/app/src/main/res/values/styles.xml +++ b/Source/Android/app/src/main/res/values/styles.xml @@ -33,6 +33,16 @@ <item name="buttonBarPositiveButtonStyle">@style/DolphinButton</item> <item name="buttonBarNegativeButtonStyle">@style/DolphinButton</item> <item name="buttonBarNeutralButtonStyle">@style/DolphinButton</item> + <item name="android:windowAnimationStyle">@style/DialogAnimation</item> + </style> + + <style name="MaterialDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> + <item name="android:windowAnimationStyle">@style/DialogAnimation</item> + </style> + + <style name="DialogAnimation"> + <item name="android:windowEnterAnimation">@anim/fade_in</item> + <item name="android:windowExitAnimation">@anim/fade_out</item> </style> <style name="DolphinTVDialog" parent="Theme.Material3.DayNight.Dialog.Alert"> diff --git a/Source/Android/app/src/main/res/values/themes.xml b/Source/Android/app/src/main/res/values/themes.xml index 5e691b5062..5b56bf5dbb 100644 --- a/Source/Android/app/src/main/res/values/themes.xml +++ b/Source/Android/app/src/main/res/values/themes.xml @@ -60,7 +60,7 @@ <item name="colorPrimaryContainer">@color/dolphin_primaryContainer</item> <item name="colorOnPrimaryContainer">@color/dolphin_onPrimaryContainer</item> - <item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item> + <item name="materialAlertDialogTheme">@style/MaterialDialog</item> <item name="popupTheme">@style/ThemeOverlay.Material3</item> </style> @@ -94,7 +94,7 @@ <item name="android:colorControlHighlight">@color/green_onSurfaceVariant</item> <item name="android:colorEdgeEffect">@color/green_secondary</item> - <item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item> + <item name="materialAlertDialogTheme">@style/MaterialDialog</item> <item name="popupTheme">@style/ThemeOverlay.Material3</item> </style> @@ -128,7 +128,7 @@ <item name="android:colorControlHighlight">@color/pink_onSurfaceVariant</item> <item name="android:colorEdgeEffect">@color/pink_secondary</item> - <item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item> + <item name="materialAlertDialogTheme">@style/MaterialDialog</item> <item name="popupTheme">@style/ThemeOverlay.Material3</item> </style> |
