浏览代码

Use Material dialogs for preferences

Partially addresses #2907
arkon 4 年之前
父节点
当前提交
112e233498
共有 3 个文件被更改,包括 16 次插入3 次删除
  1. 1 1
      app/build.gradle.kts
  2. 13 0
      app/src/main/res/values/styles.xml
  3. 2 2
      app/src/main/res/values/themes.xml

+ 1 - 1
app/build.gradle.kts

@@ -233,7 +233,7 @@ dependencies {
     implementation("com.bluelinelabs:conductor-support:2.1.5") {
         exclude(group = "com.android.support")
     }
-    implementation("com.github.tachiyomiorg:conductor-support-preference:1.1.1")
+    implementation("com.github.tachiyomiorg:conductor-support-preference:2.0.0")
 
     // FlowBinding
     val flowbindingVersion = "0.12.0"

+ 13 - 0
app/src/main/res/values/styles.xml

@@ -31,6 +31,9 @@
         <item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
 
         <item name="android:background">?attr/colorSurface</item>
+        <item name="shapeAppearanceOverlay">@style/Theme.MaterialAlertDialog.Style.ShapeAppearance</item>
+
+        <item name="materialAlertDialogTitleTextStyle">@style/Theme.MaterialAlertDialog.Style.Title</item>
         <item name="android:textColorPrimary">?attr/colorOnSurface</item>
         <item name="android:textColor">?attr/colorOnSurface</item>
 
@@ -39,6 +42,16 @@
         <item name="buttonBarNeutralButtonStyle">@style/Theme.Widget.Button</item>
     </style>
 
+    <style name="Theme.MaterialAlertDialog.Style.ShapeAppearance" parent="">
+        <item name="cornerSize">@dimen/dialog_radius</item>
+    </style>
+
+    <style name="Theme.MaterialAlertDialog.Style.Title" parent="@style/MaterialAlertDialog.MaterialComponents.Title.Text">
+        <item name="android:textColor">?android:textColorPrimary</item>
+        <item name="android:textSize">@dimen/md_title_textsize</item>
+        <item name="android:fontFamily">sans-serif-medium</item>
+    </style>
+
     <style name="Theme.AlertDialog.Light" parent="Theme.AlertDialog">
         <item name="colorAccent">@color/colorAccentLight</item>
     </style>

+ 2 - 2
app/src/main/res/values/themes.xml

@@ -56,7 +56,7 @@
         <item name="toolbarNavigationButtonStyle">@style/Theme.Toolbar.Navigation</item>
         <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
         <item name="dialogTheme">@style/Theme.AlertDialog.Light</item>
-        <item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
+        <item name="materialAlertDialogTheme">@style/Theme.AlertDialog.Light</item>
         <item name="bottomSheetDialogTheme">@style/Theme.BottomSheet</item>
         <item name="chipStyle">@style/Theme.Widget.Chip</item>
         <item name="buttonStyle">@style/Theme.Widget.Button</item>
@@ -150,7 +150,7 @@
         <item name="toolbarNavigationButtonStyle">@style/Theme.Toolbar.Navigation</item>
         <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
         <item name="dialogTheme">@style/Theme.AlertDialog.Dark</item>
-        <item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
+        <item name="materialAlertDialogTheme">@style/Theme.AlertDialog.Dark</item>
         <item name="bottomSheetDialogTheme">@style/Theme.BottomSheet</item>
         <item name="chipStyle">@style/Theme.Widget.Chip</item>
         <item name="buttonStyle">@style/Theme.Widget.Button</item>