From 2fa7b5e17c4555a8083bba2af71022ee7a77bc53 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 15 Sep 2022 08:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/widget/dialog/UrlOptionDialog.kt | 5 + .../res/layout/dialog_url_option_edit.xml | 251 +++++++++--------- app/src/main/res/values/styles.xml | 4 +- 3 files changed, 138 insertions(+), 122 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/UrlOptionDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/UrlOptionDialog.kt index f15eef222..2b3b84146 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/UrlOptionDialog.kt +++ b/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.os.Bundle import android.view.ViewGroup +import io.legado.app.R import io.legado.app.constant.AppConst import io.legado.app.databinding.DialogUrlOptionEditBinding import io.legado.app.model.analyzeRule.AnalyzeUrl @@ -17,11 +18,15 @@ class UrlOptionDialog(context: Context, private val success: (String) -> Unit) : override fun onStart() { super.onStart() setLayout(1f, ViewGroup.LayoutParams.MATCH_PARENT) + window?.setBackgroundDrawableResource(R.color.transparent) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(binding.root) + binding.root.setOnClickListener { + dismiss() + } binding.editMethod.setFilterValues("POST", "GET") binding.editCharset.setFilterValues(AppConst.charsets) binding.tvOk.setOnClickListener { diff --git a/app/src/main/res/layout/dialog_url_option_edit.xml b/app/src/main/res/layout/dialog_url_option_edit.xml index b22a21449..e9299458d 100644 --- a/app/src/main/res/layout/dialog_url_option_edit.xml +++ b/app/src/main/res/layout/dialog_url_option_edit.xml @@ -1,172 +1,183 @@ - - - - - - - - - - - + android:background="@drawable/shape_card_view" + android:orientation="vertical" + android:layout_gravity="center" + android:padding="16dp" + tools:ignore="UselessParent"> + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingBottom="10dp"> + + + + - + android:background="?android:attr/selectableItemBackgroundBorderless" + android:padding="12dp" + android:text="@string/ok" /> + + + + - + android:layout_height="wrap_content" + android:orientation="vertical"> - + android:text="useWebView" + tools:ignore="HardcodedText" /> - + - + - + + + android:layout_height="wrap_content"> - + - + - + android:layout_height="wrap_content"> - + - + - + android:layout_height="wrap_content"> - + - + - + android:layout_height="wrap_content"> - + - + - + android:layout_height="wrap_content"> - + - + - + android:layout_height="wrap_content"> - + - + - + android:layout_height="wrap_content"> - + - + - + + + + + + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 35d5664d2..4bc8faa05 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,4 +1,4 @@ - + //**************************************************************Theme******************************************************************************// @@ -74,7 +74,7 @@ @android:color/transparent true true - true + true @null