kunfei 4 лет назад
Родитель
Сommit
db3677b1ac

+ 4 - 1
app/src/main/java/io/legado/app/ui/book/read/config/HttpTtsEditDialog.kt

@@ -35,10 +35,13 @@ class HttpTtsEditDialog() : BaseDialogFragment(R.layout.dialog_http_tts_edit),
 
     override fun onStart() {
         super.onStart()
-        setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
+        setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
+        dialog?.window?.setBackgroundDrawableResource(R.color.transparent)
     }
 
     override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
+        view.setBackgroundResource(R.color.transparent)
+        view.setOnClickListener { dismiss() }
         binding.toolBar.setBackgroundColor(primaryColor)
         binding.tvUrl.run {
             addLegadoPattern()

+ 89 - 79
app/src/main/res/layout/dialog_http_tts_edit.xml

@@ -1,128 +1,138 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:orientation="vertical"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:padding="16dp">
 
-    <androidx.appcompat.widget.Toolbar
-        android:id="@+id/tool_bar"
+    <LinearLayout
+        android:id="@+id/vw_bg"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:theme="?attr/actionBarStyle"
-        app:title="@string/speak_engine"
-        app:popupTheme="@style/AppTheme.PopupOverlay"
-        app:titleTextAppearance="@style/ToolbarTitle" />
+        android:layout_gravity="center"
+        android:background="@drawable/shape_card_view"
+        android:orientation="vertical"
+        tools:ignore="UselessParent">
 
-    <androidx.core.widget.NestedScrollView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <LinearLayout
+        <androidx.appcompat.widget.Toolbar
+            android:id="@+id/tool_bar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical">
+            android:theme="?attr/actionBarStyle"
+            app:title="@string/speak_engine"
+            app:popupTheme="@style/AppTheme.PopupOverlay"
+            app:titleTextAppearance="@style/ToolbarTitle" />
+
+        <androidx.core.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
 
-            <io.legado.app.ui.widget.text.TextInputLayout
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:hint="@string/name">
+                android:orientation="vertical">
 
-                <io.legado.app.lib.theme.view.ThemeEditText
-                    android:id="@+id/tv_name"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:hint="@string/name">
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.lib.theme.view.ThemeEditText
+                        android:id="@+id/tv_name"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="url"
-                tools:ignore="HardcodedText">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-                <io.legado.app.ui.widget.code.CodeView
-                    android:id="@+id/tv_url"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
+                    android:hint="url"
+                    tools:ignore="HardcodedText">
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.code.CodeView
+                        android:id="@+id/tv_url"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="Content-Type"
-                tools:ignore="HardcodedText">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-                <io.legado.app.ui.widget.code.CodeView
-                    android:id="@+id/tv_content_type"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
+                    android:hint="Content-Type"
+                    tools:ignore="HardcodedText">
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.code.CodeView
+                        android:id="@+id/tv_content_type"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="@string/login_url"
-                tools:ignore="HardcodedText">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-                <io.legado.app.ui.widget.code.CodeView
-                    android:id="@+id/tv_login_url"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:hint="@string/login_url"
+                    tools:ignore="HardcodedText">
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.code.CodeView
+                        android:id="@+id/tv_login_url"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="@string/login_ui"
-                tools:ignore="HardcodedText">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-                <io.legado.app.ui.widget.code.CodeView
-                    android:id="@+id/tv_login_ui"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
+                    android:hint="@string/login_ui"
+                    tools:ignore="HardcodedText">
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.code.CodeView
+                        android:id="@+id/tv_login_ui"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="@string/login_check_js"
-                tools:ignore="HardcodedText">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-                <io.legado.app.ui.widget.code.CodeView
-                    android:id="@+id/tv_login_check_js"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
+                    android:hint="@string/login_check_js"
+                    tools:ignore="HardcodedText">
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                    <io.legado.app.ui.widget.code.CodeView
+                        android:id="@+id/tv_login_check_js"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
 
-            <io.legado.app.ui.widget.text.TextInputLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="@string/source_http_header"
-                tools:ignore="HardcodedText">
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-                <io.legado.app.ui.widget.code.CodeView
-                    android:id="@+id/tv_headers"
+                <io.legado.app.ui.widget.text.TextInputLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
+                    android:hint="@string/source_http_header"
+                    tools:ignore="HardcodedText">
+
+                    <io.legado.app.ui.widget.code.CodeView
+                        android:id="@+id/tv_headers"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
 
-            </io.legado.app.ui.widget.text.TextInputLayout>
+                </io.legado.app.ui.widget.text.TextInputLayout>
 
-        </LinearLayout>
+            </LinearLayout>
 
-    </androidx.core.widget.NestedScrollView>
+        </androidx.core.widget.NestedScrollView>
 
-</LinearLayout>
+    </LinearLayout>
+</FrameLayout>