Replace material-dialogs usage with Material Components' (#5423)

* Use Material Components' dialogs

For all dialogs that has direct replacement.

* Convert text input dialogs

* Convert quad-state multi choices dialogs

* Convert date picker dialogs

This also changes the flow to remove selected start/finish tracking date and
the track item itself

* Remove material-dialogs dependencies
This commit is contained in:
Ivan Iskandar
2021-07-15 05:04:03 +07:00
committed by GitHub
parent 117fd4bd0f
commit ae97bb0445
56 changed files with 701 additions and 696 deletions

View File

@@ -2,7 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:paddingHorizontal="24dp"
android:paddingTop="16dp">
<TextView
android:id="@+id/description"
@@ -15,7 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="-5dp"
android:layout_marginTop="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="0dp" />
</LinearLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.widget.materialdialogs.QuadStateTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="?attr/materialAlertDialogBodyTextStyle"
android:id="@+id/quad_state_control"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:minHeight="?attr/listPreferredItemHeightSmall"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
android:paddingStart="@dimen/abc_select_dialog_padding_start_material"
android:paddingEnd="?attr/dialogPreferredPadding"
android:drawablePadding="20dp"
android:ellipsize="marquee"
app:drawableStartCompat="@drawable/ic_check_box_outline_blank_24dp"
tools:text="Quad-state item" />

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:scrollIndicators="none"
tools:listitem="@layout/dialog_quadstatemultichoice_item" />

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="24dp"
android:paddingVertical="16dp">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:id="@+id/text_field"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
</FrameLayout>

View File

@@ -4,7 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingVertical="8dp">
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/btn_decrease_10"

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/MD_ListItem.Choice">
<eu.kanade.tachiyomi.widget.materialdialogs.QuadStateCheckBox
android:id="@+id/md_quad_state_control"
style="@style/MD_ListItem_Control" />
<com.afollestad.materialdialogs.internal.rtl.RtlTextView
android:id="@+id/md_quad_state_title"
style="@style/MD_ListItemText.Choice"
tools:text="Item" />
</LinearLayout>

View File

@@ -20,9 +20,6 @@
android:id="@+id/logo_container"
android:layout_width="48dp"
android:layout_height="48dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:cardBackgroundColor="#2E51A2"
app:cardElevation="0dp"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.MaterialCardView.Tracker">
@@ -54,8 +51,9 @@
<TextView
android:id="@+id/track_title"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:ellipsize="end"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:gravity="center_vertical"
@@ -64,6 +62,16 @@
android:textAppearance="?attr/textAppearanceSubtitle1"
tools:text="Title" />
<ImageButton
android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/label_more"
android:padding="8dp"
android:src="@drawable/ic_more_vert_24" />
</LinearLayout>
</LinearLayout>
@@ -100,11 +108,11 @@
android:textAppearance="?attr/textAppearanceBody2"
tools:text="Reading" />
<View
android:id="@+id/vert_divider_1"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?android:divider" />
<View
android:id="@+id/vert_divider_1"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?android:divider" />
<TextView
android:id="@+id/track_chapters"
@@ -119,11 +127,11 @@
android:textAppearance="?attr/textAppearanceBody2"
tools:text="12/24" />
<View
android:id="@+id/vert_divider_2"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?android:divider"/>
<View
android:id="@+id/vert_divider_2"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?android:divider" />
<TextView
android:id="@+id/track_score"
@@ -165,11 +173,11 @@
android:textAppearance="?attr/textAppearanceBody2"
tools:text="4/16/2020" />
<View
android:id="@+id/vert_divider_3"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?android:divider" />
<View
android:id="@+id/vert_divider_3"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?android:divider" />
<TextView
android:id="@+id/track_finish_date"