浏览代码

Tweak navigation view group header style

arkon 4 年之前
父节点
当前提交
7c69b1b649

+ 1 - 4
app/src/main/res/layout/navigation_view_group.xml

@@ -3,8 +3,6 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="?attr/listPreferredItemHeightSmall"
-    android:background="?attr/colorPrimary"
-    android:elevation="2dp"
     android:gravity="center_vertical"
     android:orientation="horizontal"
     android:paddingStart="?attr/listPreferredItemPaddingStart"
@@ -17,8 +15,7 @@
         android:layout_weight="1"
         android:ellipsize="end"
         android:maxLines="1"
-        android:textAppearance="@style/TextAppearance.AppCompat.Body1"
-        android:textColor="?attr/colorOnPrimary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         tools:text="Header" />
 
     <ImageView

+ 10 - 10
app/src/main/res/layout/reader_color_filter_sheet.xml

@@ -41,7 +41,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/color_filter_r_value"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_red"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red" />
@@ -51,7 +51,7 @@
         android:layout_width="30dp"
         android:layout_height="wrap_content"
         android:layout_alignParentEnd="true"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_red"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red" />
@@ -75,7 +75,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/color_filter_g_value"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_green"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green" />
@@ -85,7 +85,7 @@
         android:layout_width="30dp"
         android:layout_height="wrap_content"
         android:layout_alignParentEnd="true"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_green"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green" />
@@ -109,7 +109,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/color_filter_b_value"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_blue"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue" />
@@ -119,7 +119,7 @@
         android:layout_width="30dp"
         android:layout_height="wrap_content"
         android:layout_alignParentEnd="true"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_blue"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue" />
@@ -143,7 +143,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/color_filter_a_value"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_alpha"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha" />
@@ -153,7 +153,7 @@
         android:layout_width="30dp"
         android:layout_height="wrap_content"
         android:layout_alignParentEnd="true"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_alpha"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha" />
@@ -208,7 +208,7 @@
         android:id="@+id/txt_brightness_seekbar_icon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         android:tint="?attr/colorOnBackground"
         app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
         app:layout_constraintStart_toStartOf="parent"
@@ -219,7 +219,7 @@
         android:id="@+id/txt_brightness_seekbar_value"
         android:layout_width="30dp"
         android:layout_height="wrap_content"
-        android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
+        android:textAppearance="@style/TextAppearance.Medium.SubHeading"
         app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@id/brightness_seekbar" />

+ 1 - 3
app/src/main/res/layout/source_main_controller_card_header.xml

@@ -6,15 +6,13 @@
 
     <TextView
         android:id="@+id/title"
-        style="@style/TextAppearance.Regular.SubHeading.Secondary"
+        style="@style/TextAppearance.Medium.SubHeading"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:fontFamily="sans-serif-medium"
         android:paddingStart="@dimen/material_component_text_fields_padding_above_and_below_label"
         android:paddingTop="8dp"
         android:paddingEnd="@dimen/material_component_text_fields_padding_above_and_below_label"
         android:paddingBottom="8dp"
-        android:textAllCaps="true"
         tools:text="Title" />
 
 </FrameLayout>

+ 6 - 4
app/src/main/res/values/styles.xml

@@ -83,10 +83,6 @@
         <item name="android:textSize">14sp</item>
     </style>
 
-    <style name="TextAppearance.Regular.SubHeading.Secondary">
-        <item name="android:textColor">?android:attr/textColorSecondary</item>
-    </style>
-
     <style name="TextAppearance.Medium">
         <item name="android:fontFamily">sans-serif-medium</item>
     </style>
@@ -103,6 +99,12 @@
         <item name="android:textColor">?android:attr/textColorHint</item>
     </style>
 
+    <style name="TextAppearance.Medium.SubHeading">
+        <item name="android:textAllCaps">true</item>
+        <item name="android:textColor">?android:attr/textColorSecondary</item>
+        <item name="android:textSize">14sp</item>
+    </style>
+
     <style name="TextAppearance.Widget.Button" parent="TextAppearance.MaterialComponents.Button">
         <item name="android:letterSpacing">0</item>
     </style>