parent
c1318a66d7
commit
e2463037a4
@ -0,0 +1,44 @@ |
||||
package io.legado.app.ui.book.read.config |
||||
|
||||
import android.os.Bundle |
||||
import android.util.DisplayMetrics |
||||
import android.view.LayoutInflater |
||||
import android.view.View |
||||
import android.view.ViewGroup |
||||
import androidx.fragment.app.FragmentManager |
||||
import io.legado.app.R |
||||
import io.legado.app.base.BaseDialogFragment |
||||
|
||||
|
||||
class TocRegexDialog : BaseDialogFragment() { |
||||
|
||||
companion object { |
||||
fun show(fragmentManager: FragmentManager, tocRegex: String? = null) { |
||||
val dialog = TocRegexDialog() |
||||
val bundle = Bundle() |
||||
bundle.putString("tocRegex", tocRegex) |
||||
dialog.arguments = bundle |
||||
dialog.show(fragmentManager, "tocRegexDialog") |
||||
} |
||||
} |
||||
|
||||
override fun onStart() { |
||||
super.onStart() |
||||
val dm = DisplayMetrics() |
||||
activity?.windowManager?.defaultDisplay?.getMetrics(dm) |
||||
dialog?.window?.setLayout((dm.widthPixels * 0.9).toInt(), (dm.heightPixels * 0.8).toInt()) |
||||
} |
||||
|
||||
override fun onCreateView( |
||||
inflater: LayoutInflater, |
||||
container: ViewGroup?, |
||||
savedInstanceState: Bundle? |
||||
): View? { |
||||
return inflater.inflate(R.layout.dialog_toc_regex, container) |
||||
} |
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||
super.onViewCreated(view, savedInstanceState) |
||||
|
||||
} |
||||
} |
@ -0,0 +1,49 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:orientation="vertical" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
|
||||
<androidx.appcompat.widget.Toolbar |
||||
android:id="@+id/tool_bar" |
||||
android:background="@color/background_menu" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" /> |
||||
|
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/recycler_view" |
||||
android:background="@color/background_card" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="0dp" |
||||
android:layout_weight="1" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<Space |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_cancel" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="16dp" |
||||
android:padding="12dp" |
||||
android:text="@string/cancel" |
||||
tools:ignore="RtlHardcoded" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_ok" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="16dp" |
||||
android:padding="12dp" |
||||
android:text="@string/ok" |
||||
tools:ignore="RtlHardcoded" /> |
||||
|
||||
</LinearLayout> |
||||
</LinearLayout> |
Loading…
Reference in new issue