HapeLee 9 месяцев назад
Родитель
Сommit
6275488e00

+ 3 - 10
app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesDialog.kt

@@ -1,17 +1,15 @@
 package io.legado.app.ui.rss.favorites
 
+//import io.legado.app.lib.theme.primaryColor
 import android.os.Bundle
 import android.view.View
-import android.view.ViewGroup
 import io.legado.app.R
-import io.legado.app.base.BaseDialogFragment
+import io.legado.app.base.BaseBottomSheetDialogFragment
 import io.legado.app.data.entities.RssArticle
 import io.legado.app.databinding.DialogRssFavoriteConfigBinding
-//import io.legado.app.lib.theme.primaryColor
-import io.legado.app.utils.setLayout
 import io.legado.app.utils.viewbindingdelegate.viewBinding
 
-class RssFavoritesDialog() : BaseDialogFragment(R.layout.dialog_rss_favorite_config, true) {
+class RssFavoritesDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_rss_favorite_config) {
 
     constructor(rssArticle: RssArticle) : this() {
         arguments = Bundle().apply {
@@ -22,11 +20,6 @@ class RssFavoritesDialog() : BaseDialogFragment(R.layout.dialog_rss_favorite_con
 
     private val binding by viewBinding(DialogRssFavoriteConfigBinding::bind)
 
-    override fun onStart() {
-        super.onStart()
-        setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
-    }
-
     override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
         //binding.toolBar.setBackgroundColor(primaryColor)
         val arguments = arguments ?: let {

+ 69 - 75
app/src/main/res/layout/dialog_rss_favorite_config.xml

@@ -1,110 +1,104 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+<LinearLayout 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"
+    android:id="@+id/vw_bg"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:padding="16dp">
+    android:layout_height="wrap_content"
+    android:layout_gravity="center"
+    android:orientation="vertical"
+    tools:ignore="UselessParent">
 
-    <LinearLayout
-        android:id="@+id/vw_bg"
+    <androidx.appcompat.widget.Toolbar
+        android:id="@+id/tool_bar"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:background="@drawable/shape_card_view"
-        android:orientation="vertical"
-        tools:ignore="UselessParent">
+        android:theme="?attr/actionBarStyle"
+        app:title="@string/favorite" />
 
-        <androidx.appcompat.widget.Toolbar
-            android:id="@+id/tool_bar"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:theme="?attr/actionBarStyle"
-            app:title="@string/favorite" />
+    <androidx.core.widget.NestedScrollView
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:overScrollMode="ifContentScrolls">
 
-        <androidx.core.widget.NestedScrollView
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="1"
-            android:overScrollMode="ifContentScrolls">
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:padding="16dp">
 
-            <LinearLayout
+            <io.legado.app.ui.widget.text.TextInputLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:padding="16dp">
+                android:paddingTop="3dp">
 
-                <io.legado.app.ui.widget.text.TextInputLayout
+                <io.legado.app.lib.theme.view.ThemeEditText
+                    android:id="@+id/edit_title"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:paddingTop="3dp">
+                    android:hint="@string/title"
+                    tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
-                    <io.legado.app.lib.theme.view.ThemeEditText
-                        android:id="@+id/edit_title"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:hint="@string/title"
-                        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+            </io.legado.app.ui.widget.text.TextInputLayout>
 
-                </io.legado.app.ui.widget.text.TextInputLayout>
+            <io.legado.app.ui.widget.text.TextInputLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingTop="3dp">
 
-                <io.legado.app.ui.widget.text.TextInputLayout
+                <io.legado.app.lib.theme.view.ThemeEditText
+                    android:id="@+id/edit_group"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:paddingTop="3dp">
+                    android:hint="@string/group_name"
+                    tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
-                    <io.legado.app.lib.theme.view.ThemeEditText
-                        android:id="@+id/edit_group"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:hint="@string/group_name"
-                        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+            </io.legado.app.ui.widget.text.TextInputLayout>
 
-                </io.legado.app.ui.widget.text.TextInputLayout>
+        </LinearLayout>
 
-            </LinearLayout>
+    </androidx.core.widget.NestedScrollView>
 
-        </androidx.core.widget.NestedScrollView>
+    <com.google.android.flexbox.FlexboxLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="12dp"
+        android:paddingRight="12dp"
+        app:flexWrap="wrap"
+        app:justifyContent="space_between">
+
+        <com.google.android.material.button.MaterialButton
+            android:id="@+id/tv_footer_left"
+            style="@style/Widget.Material3.Button.OutlinedButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/delete"
+            tools:ignore="RtlHardcoded" />
 
-        <com.google.android.flexbox.FlexboxLayout
-            android:layout_width="match_parent"
+        <LinearLayout
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:paddingLeft="12dp"
-            android:paddingRight="12dp"
-            app:flexWrap="wrap"
-            app:justifyContent="space_between">
+            android:orientation="horizontal">
 
-            <io.legado.app.ui.widget.text.AccentTextView
-                android:id="@+id/tv_footer_left"
+            <com.google.android.material.button.MaterialButton
+                android:id="@+id/tv_cancel"
+                style="@style/Widget.Material3.Button.TonalButton"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:padding="12dp"
-                android:text="@string/delete"
+                android:layout_marginEnd="8dp"
+                android:text="@string/cancel"
                 tools:ignore="RtlHardcoded" />
 
-            <LinearLayout
+            <com.google.android.material.button.MaterialButton
+                android:id="@+id/tv_ok"
+                style="@style/Widget.Material3.Button"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <io.legado.app.ui.widget.text.AccentTextView
-                    android:id="@+id/tv_cancel"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:padding="12dp"
-                    android:text="@string/cancel"
-                    tools:ignore="RtlHardcoded" />
-
-                <io.legado.app.ui.widget.text.AccentTextView
-                    android:id="@+id/tv_ok"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:padding="12dp"
-                    android:text="@string/ok"
-                    tools:ignore="RtlHardcoded" />
+                android:text="@string/ok"
+                tools:ignore="RtlHardcoded" />
 
-            </LinearLayout>
+        </LinearLayout>
 
-        </com.google.android.flexbox.FlexboxLayout>
-    </LinearLayout>
-</FrameLayout>
+    </com.google.android.flexbox.FlexboxLayout>
+</LinearLayout>