kunfei 4 yıl önce
ebeveyn
işleme
64c0c7f46b

+ 5 - 0
app/src/main/java/io/legado/app/ui/widget/dialog/UrlOptionDialog.kt

@@ -4,6 +4,7 @@ import android.app.Dialog
 import android.content.Context
 import android.content.Context
 import android.os.Bundle
 import android.os.Bundle
 import android.view.ViewGroup
 import android.view.ViewGroup
+import io.legado.app.R
 import io.legado.app.constant.AppConst
 import io.legado.app.constant.AppConst
 import io.legado.app.databinding.DialogUrlOptionEditBinding
 import io.legado.app.databinding.DialogUrlOptionEditBinding
 import io.legado.app.model.analyzeRule.AnalyzeUrl
 import io.legado.app.model.analyzeRule.AnalyzeUrl
@@ -17,11 +18,15 @@ class UrlOptionDialog(context: Context, private val success: (String) -> Unit) :
     override fun onStart() {
     override fun onStart() {
         super.onStart()
         super.onStart()
         setLayout(1f, ViewGroup.LayoutParams.MATCH_PARENT)
         setLayout(1f, ViewGroup.LayoutParams.MATCH_PARENT)
+        window?.setBackgroundDrawableResource(R.color.transparent)
     }
     }
 
 
     override fun onCreate(savedInstanceState: Bundle?) {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         super.onCreate(savedInstanceState)
         setContentView(binding.root)
         setContentView(binding.root)
+        binding.root.setOnClickListener {
+            dismiss()
+        }
         binding.editMethod.setFilterValues("POST", "GET")
         binding.editMethod.setFilterValues("POST", "GET")
         binding.editCharset.setFilterValues(AppConst.charsets)
         binding.editCharset.setFilterValues(AppConst.charsets)
         binding.tvOk.setOnClickListener {
         binding.tvOk.setOnClickListener {

+ 131 - 120
app/src/main/res/layout/dialog_url_option_edit.xml

@@ -1,172 +1,183 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical"
     android:padding="16dp">
     android:padding="16dp">
 
 
     <LinearLayout
     <LinearLayout
+        android:id="@+id/vw_bg"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:paddingBottom="10dp"
-        android:orientation="horizontal"
-        android:gravity="center_vertical">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/url_option"
-            android:textSize="18sp"
-            android:textStyle="bold" />
-
-        <Space
-            android:layout_width="0dp"
-            android:layout_height="1dp"
-            android:layout_weight="1" />
-
-        <TextView
-            android:id="@+id/tv_ok"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:padding="12dp"
-            android:text="@string/ok"
-            android:background="?android:attr/selectableItemBackgroundBorderless" />
-
-    </LinearLayout>
-
-    <androidx.core.widget.NestedScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:overScrollMode="ifContentScrolls">
+        android:background="@drawable/shape_card_view"
+        android:orientation="vertical"
+        android:layout_gravity="center"
+        android:padding="16dp"
+        tools:ignore="UselessParent">
 
 
         <LinearLayout
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
-            android:orientation="vertical">
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingBottom="10dp">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/url_option"
+                android:textSize="18sp"
+                android:textStyle="bold" />
+
+            <Space
+                android:layout_width="0dp"
+                android:layout_height="1dp"
+                android:layout_weight="1" />
 
 
-            <io.legado.app.lib.theme.view.ThemeCheckBox
-                android:id="@+id/cb_use_web_view"
+            <TextView
+                android:id="@+id/tv_ok"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="useWebView"
-                tools:ignore="HardcodedText" />
+                android:background="?android:attr/selectableItemBackgroundBorderless"
+                android:padding="12dp"
+                android:text="@string/ok" />
+
+        </LinearLayout>
+
+        <androidx.core.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_method"
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_method"
-                    android:layout_width="match_parent"
+                <io.legado.app.lib.theme.view.ThemeCheckBox
+                    android:id="@+id/cb_use_web_view"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
-                    android:hint="method"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:text="useWebView"
+                    tools:ignore="HardcodedText" />
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_method"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_charset"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_method"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="method"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_charset"
+                </io.legado.app.ui.widget.text.TextInputLayout>
+
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_charset"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="charset"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_charset"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="charset"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_headers"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_headers"
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_headers"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="headers"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_headers"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="headers"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_body"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_body"
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_body"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="body"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_body"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="body"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_type"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_type"
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_type"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="type"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_type"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="type"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_retry"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_retry"
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_retry"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="retry"
-                    android:inputType="number"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_retry"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="retry"
+                        android:inputType="number"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_web_js"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_web_js"
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_web_js"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="webJs"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_web_js"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="webJs"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:id="@+id/layout_js"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-                <io.legado.app.ui.widget.text.AutoCompleteTextView
-                    android:id="@+id/edit_js"
+                <io.legado.app.ui.widget.text.TextInputLayout
+                    android:id="@+id/layout_js"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:hint="js"
-                    tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:layout_height="wrap_content">
 
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.text.AutoCompleteTextView
+                        android:id="@+id/edit_js"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:hint="js"
+                        tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
 
-        </LinearLayout>
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
 
-    </androidx.core.widget.NestedScrollView>
+            </LinearLayout>
+
+        </androidx.core.widget.NestedScrollView>
+
+
+    </LinearLayout>
 
 
-</LinearLayout>
+</FrameLayout>

+ 2 - 2
app/src/main/res/values/styles.xml

@@ -1,4 +1,4 @@
-<resources xmlns:tools="http://schemas.android.com/tools">
+<resources>
 
 
     //**************************************************************Theme******************************************************************************//
     //**************************************************************Theme******************************************************************************//
 
 
@@ -74,7 +74,7 @@
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowDisablePreview">true</item>
         <item name="android:windowDisablePreview">true</item>
         <item name="android:windowIsTranslucent">true</item>
         <item name="android:windowIsTranslucent">true</item>
-        <item name="android:windowTranslucentStatus" tools:targetApi="kitkat">true</item>
+        <item name="android:windowTranslucentStatus">true</item>
         <item name="android:windowAnimationStyle">@null</item>
         <item name="android:windowAnimationStyle">@null</item>
     </style>
     </style>