fix dialog background colors (#4864)

In https://github.com/tuskyapp/Tusky/pull/4851 I changed the theme of
`AccountsInListFragment`, which accidentally turned its background white
for the dark theme.

Additionally this fixes the color for the preference dialogs, which I
think have been incorrect since the Material3 redesign.

I also wondered if we should make dialogs darker for the black theme,
but looks like there is not much interest in that
https://chaos.social/deck/@ConnyDuck/113802937491059461
(Currently they are just the same as the dark theme)
This commit is contained in:
Konrad Pozniak 2025-01-14 19:29:27 +01:00 committed by Conny Duck
commit a24c4718af
No known key found for this signature in database
3 changed files with 27 additions and 6 deletions

View file

@ -75,7 +75,7 @@ class AccountsInListFragment : DialogFragment() {
viewModel.load(listId)
}
override fun getTheme() = R.style.TuskyDialogOverlay
override fun getTheme() = R.style.TuskyDialogFragment
override fun onStart() {
super.onStart()

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="16dp"
android:insetTop="16dp"
android:insetRight="16dp"
android:insetBottom="16dp">
<shape android:shape="rectangle">
<corners android:radius="?attr/dialogCornerRadius" />
<solid android:color="@color/colorBackground" />
</shape>
</inset>

View file

@ -94,9 +94,9 @@
<item name="snackbarButtonStyle">@style/TuskyButton.TextButton</item>
<!-- for dialogs created with MaterialALertDialogBuilder -->
<item name="materialAlertDialogTheme">@style/TuskyDialogOverlay</item>
<item name="materialAlertDialogTheme">@style/TuskyMaterialDialogOverlay</item>
<!-- for dialogs opened from preferences -->
<item name="alertDialogTheme">@style/TuskyDialogOverlay</item>
<item name="alertDialogTheme">@style/TuskyAlertDialog</item>
<item name="dialogCornerRadius">16dp</item>
<item name="materialTimePickerTheme">@style/TuskyTimePickerOverlay</item>
@ -146,12 +146,22 @@
<item name="android:colorControlNormal">@color/white</item>
</style>
<style name="TuskyDialogOverlay" parent="@style/ThemeOverlay.Material3.MaterialAlertDialog">
<item name="alertDialogStyle">@style/TuskyDialog</item>
<style name="TuskyDialogFragment" parent="@style/ThemeOverlay.Material3.Dialog">
<item name="android:windowBackground">@drawable/dialog_background</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>
<style name="TuskyDialog" parent="@style/MaterialAlertDialog.Material3">
<style name="TuskyAlertDialog" parent="@style/ThemeOverlay.Material3.Dialog.Alert">
<item name="android:windowBackground">@drawable/dialog_background</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>
<style name="TuskyMaterialDialogOverlay" parent="@style/ThemeOverlay.Material3.MaterialAlertDialog">
<item name="alertDialogStyle">@style/TuskyMaterialDialog</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>
<style name="TuskyMaterialDialog" parent="@style/MaterialAlertDialog.Material3">
<item name="shapeAppearance">@style/ShapeAppearance.Material3.Corner.Large</item>
<item name="backgroundTint">@color/colorBackground</item>
</style>