diff --git a/app/src/main/java/com/huanchengfly/tieba/post/fragments/SettingsFragment.kt b/app/src/main/java/com/huanchengfly/tieba/post/fragments/SettingsFragment.kt index f444f30f..165fd426 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/fragments/SettingsFragment.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/fragments/SettingsFragment.kt @@ -170,12 +170,28 @@ class SettingsFragment : PreferencesFragment() { initListPreference("dark_theme", "dark") aboutPreference!!.summary = getString(R.string.tip_about, VersionUtil.getVersionName(attachContext)) refresh() + /* + try { + val preferenceGroupClazz = PreferenceGroup::class.java + val preferencesField = preferenceGroupClazz.getDeclaredField("mPreferences") + preferencesField.isAccessible = true + val preferencesList = preferencesField.get(preferenceScreen) as List + attachContext.toastShort("${preferencesList.size}") + } catch (e: Exception) { + e.printStackTrace() + } + */ } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - setDivider(ThemeUtils.tintDrawable(ContextCompat.getDrawable(attachContext, R.drawable.drawable_divider_8dp), ThemeUtils.getColorByAttr(attachContext, R.attr.colorDivider))) - setDividerHeight(DisplayUtil.dp2px(attachContext, 8f)) + setDivider( + ThemeUtils.tintDrawable( + ContextCompat.getDrawable(attachContext, R.drawable.drawable_divider_8dp), + ThemeUtils.getColorById(attachContext, R.color.default_color_window_background) + ) + ) + setDividerHeight(0) } private fun initSwitchPreference(key: String, defValue: Boolean = false) { diff --git a/app/src/main/res/layout/layout_preference.xml b/app/src/main/res/layout/layout_preference.xml index 6be4b21f..b92120b2 100644 --- a/app/src/main/res/layout/layout_preference.xml +++ b/app/src/main/res/layout/layout_preference.xml @@ -1,20 +1,22 @@ - + android:baselineAligned="false" + app:backgroundTint="@color/default_color_card"> - + @@ -42,7 +44,7 @@ android:layout_below="@android:id/title" android:layout_alignStart="@android:id/title" android:textSize="14sp" - app:tintList="@color/text_color_secondary_selector" + app:tint="@color/text_color_secondary_selector" android:maxLines="10"/> @@ -56,4 +58,4 @@ android:orientation="vertical" tools:ignore="RtlSymmetry" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_preference_bottom.xml b/app/src/main/res/layout/layout_preference_bottom.xml index 9979204d..43b8a35b 100644 --- a/app/src/main/res/layout/layout_preference_bottom.xml +++ b/app/src/main/res/layout/layout_preference_bottom.xml @@ -1,18 +1,19 @@ - + android:baselineAligned="false" + android:background="@drawable/bg_bottom_radius_10dp" + app:backgroundTint="@color/default_color_card"> - + @@ -53,4 +54,4 @@ android:orientation="vertical" tools:ignore="RtlSymmetry" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_preference_category.xml b/app/src/main/res/layout/layout_preference_category.xml index 48f2b5e0..e701612c 100644 --- a/app/src/main/res/layout/layout_preference_category.xml +++ b/app/src/main/res/layout/layout_preference_category.xml @@ -1,14 +1,17 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/layout_preference_category_first.xml b/app/src/main/res/layout/layout_preference_category_first.xml index 538810db..79c97527 100644 --- a/app/src/main/res/layout/layout_preference_category_first.xml +++ b/app/src/main/res/layout/layout_preference_category_first.xml @@ -1,14 +1,16 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/layout_preference_dense.xml b/app/src/main/res/layout/layout_preference_dense.xml index 86d0734e..74ccca50 100644 --- a/app/src/main/res/layout/layout_preference_dense.xml +++ b/app/src/main/res/layout/layout_preference_dense.xml @@ -1,20 +1,22 @@ - + android:baselineAligned="false" + app:backgroundTint="@color/default_color_card"> - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_preference_seekbar.xml b/app/src/main/res/layout/layout_preference_seekbar.xml index a1b3b537..b8b729a7 100644 --- a/app/src/main/res/layout/layout_preference_seekbar.xml +++ b/app/src/main/res/layout/layout_preference_seekbar.xml @@ -1,5 +1,5 @@ - + android:baselineAligned="false" + app:backgroundTint="@color/default_color_card"> - + @@ -50,7 +51,7 @@ android:layout_below="@android:id/title" android:layout_alignStart="@android:id/title" android:textSize="14sp" - app:tintList="@color/text_color_secondary_selector" + app:tint="@color/text_color_secondary_selector" android:maxLines="10"/> @@ -93,11 +94,11 @@ android:textAppearance="?android:attr/textAppearanceListItem" android:ellipsize="marquee" android:fadingEdge="horizontal" - app:tintList="@color/text_color_secondary_selector" + app:tint="@color/text_color_secondary_selector" android:scrollbars="none" tools:ignore="PrivateResource" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index c8bb7f05..19bf2810 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -2,7 +2,6 @@