pull/32/head
kunfei 5 years ago
parent 947367bbe2
commit 22db0c851b
  1. 12
      app/src/main/java/io/legado/app/ui/readbook/config/PaddingConfigDialog.kt
  2. 201
      app/src/main/res/layout/dialog_read_padding.xml

@ -16,7 +16,7 @@ class PaddingConfigDialog : DialogFragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
return super.onCreateView(inflater, container, savedInstanceState) return inflater.inflate(R.layout.dialog_read_padding, container)
} }
override fun onStart() { override fun onStart() {
@ -36,6 +36,16 @@ class PaddingConfigDialog : DialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
initData()
initView()
}
private fun initData() {
}
private fun initView() {
} }
} }

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_padding_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tv_text_bold">
<TextView
android:layout_width="60dp"
android:layout_height="wrap_content"
android:text="@string/padding_top" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_top_remove"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_remove"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_padding_top"
android:layout_width="0dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_weight="4"
android:max="45" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_top_add"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_add"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<TextView
android:id="@+id/tv_padding_top"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_padding_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tv_text_bold">
<TextView
android:layout_width="60dp"
android:layout_height="wrap_content"
android:text="@string/padding_bottom" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_bottom_remove"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_remove"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_padding_bottom"
android:layout_width="0dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_weight="4"
android:max="45" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_bottom_add"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_add"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<TextView
android:id="@+id/tv_padding_bottom"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_padding_left"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tv_text_bold">
<TextView
android:layout_width="60dp"
android:layout_height="wrap_content"
android:text="@string/padding_left" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_left_remove"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_remove"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_padding_left"
android:layout_width="0dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_weight="4"
android:max="45" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_left_add"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_add"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<TextView
android:id="@+id/tv_padding_left"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_padding_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tv_text_bold">
<TextView
android:layout_width="60dp"
android:layout_height="wrap_content"
android:text="@string/padding_left" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_right_remove"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_remove"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_padding_right"
android:layout_width="0dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_weight="4"
android:max="45" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_padding_right_add"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_add"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:tint="@color/tv_text_default" />
<TextView
android:id="@+id/tv_padding_right"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="right"
tools:ignore="RtlHardcoded" />
</LinearLayout>
</LinearLayout>
Loading…
Cancel
Save