浏览代码

Tweak theme preference item UI

arkon 3 年之前
父节点
当前提交
77c0a93ac6

+ 0 - 3
app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreferenceAdapter.kt

@@ -54,9 +54,6 @@ class ThemesPreferenceAdapter(private val clickListener: OnItemClickListener) :
         fun bind(appTheme: PreferenceValues.AppTheme) {
         fun bind(appTheme: PreferenceValues.AppTheme) {
             binding.name.text = view.context.getString(appTheme.titleResId!!)
             binding.name.text = view.context.getString(appTheme.titleResId!!)
 
 
-            // Rounded corners
-            binding.coverContainer.clipToOutline = true
-
             val isSelected = preferences.appTheme().get() == appTheme
             val isSelected = preferences.appTheme().get() == appTheme
             binding.themeCard.isChecked = isSelected
             binding.themeCard.isChecked = isSelected
             binding.themeCard.strokeColor = if (isSelected) selectedColor else unselectedColor
             binding.themeCard.strokeColor = if (isSelected) selectedColor else unselectedColor

+ 8 - 14
app/src/main/res/layout/pref_theme_item.xml

@@ -37,7 +37,7 @@
 
 
             <ImageView
             <ImageView
                 android:id="@+id/top_nav_text"
                 android:id="@+id/top_nav_text"
-                android:layout_width="65dp"
+                android:layout_width="64dp"
                 android:layout_height="16dp"
                 android:layout_height="16dp"
                 android:layout_marginStart="6dp"
                 android:layout_marginStart="6dp"
                 android:src="@drawable/oval"
                 android:src="@drawable/oval"
@@ -46,33 +46,27 @@
                 app:layout_constraintTop_toTopOf="@+id/top_nav"
                 app:layout_constraintTop_toTopOf="@+id/top_nav"
                 app:tint="?attr/colorOnToolbar" />
                 app:tint="?attr/colorOnToolbar" />
 
 
-            <FrameLayout
+            <ImageView
                 android:id="@+id/cover_container"
                 android:id="@+id/cover_container"
                 android:layout_width="0dp"
                 android:layout_width="0dp"
                 android:layout_height="0dp"
                 android:layout_height="0dp"
                 android:layout_marginStart="6dp"
                 android:layout_marginStart="6dp"
                 android:layout_marginTop="6dp"
                 android:layout_marginTop="6dp"
-                android:background="@drawable/rounded_rectangle"
+                android:src="@drawable/rounded_rectangle"
+                app:layout_constraintTop_toBottomOf="@+id/top_nav"
                 app:layout_constraintDimensionRatio="2:3"
                 app:layout_constraintDimensionRatio="2:3"
                 app:layout_constraintEnd_toEndOf="@+id/center_guideline"
                 app:layout_constraintEnd_toEndOf="@+id/center_guideline"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/top_nav">
-
-                <View
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:alpha="0.5"
-                    android:background="?attr/colorOnSurface" />
-
-            </FrameLayout>
+                app:tint="?android:attr/divider" />
 
 
-            <View
+            <ImageView
                 android:id="@+id/cover_badge"
                 android:id="@+id/cover_badge"
                 android:layout_width="12dp"
                 android:layout_width="12dp"
                 android:layout_height="16dp"
                 android:layout_height="16dp"
                 android:layout_marginStart="4dp"
                 android:layout_marginStart="4dp"
                 android:layout_marginTop="4dp"
                 android:layout_marginTop="4dp"
-                android:background="?attr/colorAccent"
+                android:src="@drawable/rounded_rectangle"
+                app:tint="?attr/colorAccent"
                 app:layout_constraintStart_toStartOf="@+id/cover_container"
                 app:layout_constraintStart_toStartOf="@+id/cover_container"
                 app:layout_constraintTop_toTopOf="@+id/cover_container" />
                 app:layout_constraintTop_toTopOf="@+id/cover_container" />