Migrate to MaterialComponents themes

This commit is contained in:
arkon
2020-03-11 19:08:57 -04:00
parent 2615b067e2
commit 7d0ea614da
42 changed files with 174 additions and 240 deletions

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:orientation="vertical"
android:paddingStart="4dp"
android:paddingTop="8dp"

View File

@@ -16,8 +16,8 @@
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/colorBackground"
tools:background="?android:attr/colorBackground"
android:background="?attr/colorSurface"
tools:background="?attr/colorSurface"
tools:ignore="ContentDescription"
tools:src="@mipmap/ic_launcher" />

View File

@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_single_line_with_avatar_height"
android:layout_gravity="center_vertical"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="25dp">

View File

@@ -9,7 +9,7 @@
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_two_line_height"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/image"

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_single_line_with_avatar_height"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/image"

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:paddingEnd="16dp"
android:paddingStart="16dp">

View File

@@ -10,7 +10,7 @@
android:id="@+id/btn_decrease_10"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:padding="8dp"
android:tint="?colorAccent"
app:srcCompat="@drawable/ic_chevron_left_double_black_24dp" />
@@ -19,7 +19,7 @@
android:id="@+id/btn_decrease"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:padding="8dp"
android:tint="?colorAccent"
app:srcCompat="@drawable/ic_chevron_left_black_24dp" />
@@ -37,7 +37,7 @@
android:id="@+id/btn_increase"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:padding="8dp"
android:tint="?colorAccent"
app:srcCompat="@drawable/ic_chevron_right_black_24dp" />
@@ -46,7 +46,7 @@
android:id="@+id/btn_increase_10"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:padding="8dp"
android:tint="?colorAccent"
app:srcCompat="@drawable/ic_chevron_right_double_black_24dp" />

View File

@@ -9,7 +9,7 @@
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/image"

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cv_manga"
style="@style/Theme.Widget.CardView.Item"
android:padding="0dp">

View File

@@ -25,11 +25,10 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
style="@style/Widget.MaterialComponents.TabLayout.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.ActionBar.Tab"
app:tabGravity="center"
app:tabIndicatorColor="@android:color/white"
app:tabInlineLabel="true"
app:tabMinWidth="75dp"
app:tabMode="scrollable" />
@@ -44,12 +43,11 @@
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav"
style="@style/Widget.MaterialComponents.BottomNavigationView.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/colorPrimary"
app:itemIconTint="@drawable/bottom_nav_item_selector"
app:itemTextColor="@drawable/bottom_nav_item_selector"
app:itemBackground="?attr/colorPrimary"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_nav" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:focusable="true"
android:paddingStart="?attr/listPreferredItemPaddingStart"
@@ -9,15 +9,16 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nav_view_item_wrapper"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical|start">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/nav_view_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"

View File

@@ -20,31 +20,36 @@
android:layout_height="1dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="24dp"
android:background="@color/dividerLight" />
android:background="?android:attr/divider" />
<TextView
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/username_label"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/username" />
android:hint="@string/username">
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/password" />
android:hint="@string/password">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:id="@+id/show_password"

View File

@@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:padding="16dp">
<androidx.legacy.widget.Space
<android.widget.Space
android:id="@+id/spinner_end"
android:layout_width="16dp"
android:layout_height="0dp"
@@ -13,7 +13,7 @@
<!-- Color filter -->
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_color_filter"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -181,7 +181,7 @@
<!-- Brightness -->
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/custom_brightness"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground"
android:background="?attr/colorSurface"
android:orientation="vertical">
<FrameLayout

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:colorBackground"
android:background="?attr/colorSurface"
android:orientation="vertical">
<LinearLayout

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground"
android:background="?attr/colorSurface"
android:clipToPadding="false"
android:orientation="vertical"
android:padding="@dimen/material_component_dialogs_padding_around_content_area">
@@ -31,7 +31,7 @@
app:layout_constraintStart_toEndOf="@id/general_prefs"
app:layout_constraintTop_toTopOf="@id/general_prefs" />
<androidx.legacy.widget.Space
<android.widget.Space
android:id="@+id/spinner_end"
android:layout_width="16dp"
android:layout_height="0dp"
@@ -50,7 +50,7 @@
android:id="@+id/viewer"
android:layout_width="0dp"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:entries="@array/viewers_selector"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/verticalcenter"
@@ -60,7 +60,7 @@
android:id="@+id/rotation_mode_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:text="@string/pref_rotation_type"
app:layout_constraintBaseline_toBaselineOf="@id/rotation_mode"
app:layout_constraintEnd_toStartOf="@id/verticalcenter"
@@ -70,7 +70,7 @@
android:id="@+id/rotation_mode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:entries="@array/rotation_type"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/verticalcenter"
@@ -89,79 +89,73 @@
android:id="@+id/background_color"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:entries="@array/reader_themes"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/verticalcenter"
app:layout_constraintTop_toBottomOf="@id/rotation_mode" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/show_page_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="10dp"
android:text="@string/pref_show_page_number"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/background_color" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/true_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_true_color"
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/show_page_number"
tools:visibility="visible" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/fullscreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_fullscreen"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/true_color" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/cutout_short"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_cutout_short"
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/fullscreen" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/keepscreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_keep_screen_on"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/cutout_short" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/long_tap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_read_with_long_tap"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/keepscreen" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/always_show_chapter_transition"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_always_show_chapter_transition"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/long_tap" />
<androidx.legacy.widget.Space
<android.widget.Space
android:id="@+id/end_general_preferences"
android:layout_width="0dp"
android:layout_height="0dp"
@@ -193,7 +187,7 @@
android:id="@+id/scale_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:entries="@array/image_scale_type"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/verticalcenter"
@@ -212,26 +206,25 @@
android:id="@+id/zoom_start"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:entries="@array/zoom_start"
app:layout_constraintEnd_toEndOf="@id/spinner_end"
app:layout_constraintStart_toEndOf="@id/verticalcenter"
app:layout_constraintTop_toBottomOf="@id/scale_type" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/crop_borders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="10dp"
android:text="@string/pref_crop_borders"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/zoom_start" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/page_transitions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_page_transitions"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/crop_borders" />
@@ -249,20 +242,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/end_general_preferences" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/crop_borders_webtoon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="8dp"
android:text="@string/pref_crop_borders"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/webtoon_prefs" />
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/pad_pages_vert_webtoon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/pref_webtoon_padding_vert"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/crop_borders_webtoon" />

View File

@@ -51,7 +51,7 @@
android:id="@+id/status_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
@@ -104,7 +104,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
@@ -132,7 +132,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"

View File

@@ -42,7 +42,7 @@
android:dividerHeight="10dp"
android:footerDividersEnabled="true"
android:headerDividersEnabled="true"
android:listSelector="?attr/selectable_list_drawable"
android:listSelector="@drawable/list_item_selector"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:scrollbars="none"

View File

@@ -2,7 +2,6 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cv_manga"
style="@style/Theme.Widget.CardView.Item"
android:padding="0dp">
@@ -10,7 +9,7 @@
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="216dp"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:orientation="horizontal">
<ImageView

View File

@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_two_line_height"
android:paddingEnd="16dp"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/manga_cover"