优化
This commit is contained in:
@@ -29,10 +29,13 @@ class BookmarkDialog() : BaseDialogFragment(R.layout.dialog_bookmark) {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.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?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
view.setBackgroundResource(R.color.transparent)
|
||||||
|
view.setOnClickListener { dismiss() }
|
||||||
binding.toolBar.setBackgroundColor(primaryColor)
|
binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
val arguments = arguments ?: let {
|
val arguments = arguments ?: let {
|
||||||
dismiss()
|
dismiss()
|
||||||
|
|||||||
@@ -1,110 +1,120 @@
|
|||||||
<?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:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
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="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:padding="16dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<LinearLayout
|
||||||
android:id="@+id/tool_bar"
|
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:theme="?attr/actionBarStyle"
|
android:layout_gravity="center"
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
android:background="@drawable/shape_card_view"
|
||||||
app:title="@string/bookmark"
|
android:orientation="vertical"
|
||||||
app:titleTextAppearance="@style/ToolbarTitle" />
|
tools:ignore="UselessParent">
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/tv_chapter_name"
|
android:id="@+id/tool_bar"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:textColor="@color/primaryText" />
|
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<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:theme="?attr/actionBarStyle"
|
||||||
android:padding="16dp">
|
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
app:title="@string/bookmark"
|
||||||
|
app:titleTextAppearance="@style/ToolbarTitle" />
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.TextInputLayout
|
<TextView
|
||||||
|
android:id="@+id/tv_chapter_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:textColor="@color/primaryText" />
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="3dp">
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<io.legado.app.lib.theme.view.ThemeEditText
|
<io.legado.app.ui.widget.text.TextInputLayout
|
||||||
android:id="@+id/edit_book_text"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/content"
|
android:paddingTop="3dp">
|
||||||
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
</io.legado.app.ui.widget.text.TextInputLayout>
|
<io.legado.app.lib.theme.view.ThemeEditText
|
||||||
|
android:id="@+id/edit_book_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/content"
|
||||||
|
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
||||||
|
|
||||||
<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.lib.theme.view.ThemeEditText
|
<io.legado.app.ui.widget.text.TextInputLayout
|
||||||
android:id="@+id/edit_content"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/note_content"
|
android:paddingTop="3dp">
|
||||||
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
</io.legado.app.ui.widget.text.TextInputLayout>
|
<io.legado.app.lib.theme.view.ThemeEditText
|
||||||
|
android:id="@+id/edit_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/note_content"
|
||||||
|
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
||||||
|
|
||||||
</LinearLayout>
|
</io.legado.app.ui.widget.text.TextInputLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.flexbox.FlexboxLayout
|
</androidx.core.widget.NestedScrollView>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingLeft="12dp"
|
|
||||||
android:paddingRight="12dp"
|
|
||||||
app:flexWrap="wrap"
|
|
||||||
app:justifyContent="space_between">
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentTextView
|
<com.google.android.flexbox.FlexboxLayout
|
||||||
android:id="@+id/tv_footer_left"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="12dp"
|
android:paddingLeft="12dp"
|
||||||
android:text="@string/delete"
|
android:paddingRight="12dp"
|
||||||
android:visibility="invisible"
|
app:flexWrap="wrap"
|
||||||
tools:ignore="RtlHardcoded" />
|
app:justifyContent="space_between">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentTextView
|
<io.legado.app.ui.widget.text.AccentTextView
|
||||||
android:id="@+id/tv_cancel"
|
android:id="@+id/tv_footer_left"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:text="@string/cancel"
|
android:text="@string/delete"
|
||||||
|
android:visibility="invisible"
|
||||||
tools:ignore="RtlHardcoded" />
|
tools:ignore="RtlHardcoded" />
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentTextView
|
<LinearLayout
|
||||||
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:padding="12dp"
|
android:orientation="horizontal">
|
||||||
android:text="@string/ok"
|
|
||||||
tools:ignore="RtlHardcoded" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<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" />
|
||||||
|
|
||||||
</com.google.android.flexbox.FlexboxLayout>
|
<io.legado.app.ui.widget.text.AccentTextView
|
||||||
</LinearLayout>
|
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" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.google.android.flexbox.FlexboxLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</FrameLayout>
|
||||||
Reference in New Issue
Block a user