优化
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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:background="@drawable/shape_card_view"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical"
|
||||||
android:gravity="center_vertical">
|
android:layout_gravity="center"
|
||||||
|
android:padding="16dp"
|
||||||
<TextView
|
tools:ignore="UselessParent">
|
||||||
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">
|
|
||||||
|
|
||||||
<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">
|
||||||
|
|
||||||
<io.legado.app.lib.theme.view.ThemeCheckBox
|
<TextView
|
||||||
android:id="@+id/cb_use_web_view"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="useWebView"
|
android:text="@string/url_option"
|
||||||
tools:ignore="HardcodedText" />
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.TextInputLayout
|
<Space
|
||||||
android:id="@+id/layout_method"
|
android:layout_width="0dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="1dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AutoCompleteTextView
|
<TextView
|
||||||
android:id="@+id/edit_method"
|
android:id="@+id/tv_ok"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="method"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
android:padding="12dp"
|
||||||
|
android:text="@string/ok" />
|
||||||
</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_height="wrap_content">
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<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.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>
|
|
||||||
|
|
||||||
<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.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>
|
|
||||||
|
|
||||||
<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.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>
|
|
||||||
|
|
||||||
<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.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>
|
|
||||||
|
|
||||||
<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.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>
|
|
||||||
|
|
||||||
<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.AutoCompleteTextView
|
|
||||||
android:id="@+id/edit_js"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:hint="js"
|
|
||||||
tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
</io.legado.app.ui.widget.text.TextInputLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
</LinearLayout>
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<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:text="useWebView"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<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.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.TextInputLayout>
|
||||||
|
|
||||||
|
<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_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>
|
||||||
|
|
||||||
|
<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.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>
|
||||||
|
|
||||||
|
<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.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>
|
||||||
|
|
||||||
|
<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.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>
|
||||||
|
|
||||||
|
<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.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>
|
||||||
|
|
||||||
|
<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.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>
|
||||||
|
|
||||||
|
<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.AutoCompleteTextView
|
||||||
|
android:id="@+id/edit_js"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="js"
|
||||||
|
tools:ignore="HardcodedText,SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
||||||
|
|
||||||
|
</io.legado.app.ui.widget.text.TextInputLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user