pull/357/head
gedoor 4 years ago
parent f5e7f079bc
commit 2c56a43332
  1. 8
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  2. 43
      app/src/main/res/layout/dialog_read_bg_text.xml
  3. 2
      app/src/main/res/layout/item_bg_image.xml

@ -105,7 +105,7 @@ class BgTextConfigDialog : BaseDialogFragment() {
headerView.tv_name.setTextColor(secondaryTextColor) headerView.tv_name.setTextColor(secondaryTextColor)
headerView.tv_name.text = getString(R.string.select_image) headerView.tv_name.text = getString(R.string.select_image)
headerView.iv_bg.setImageResource(R.drawable.ic_image) headerView.iv_bg.setImageResource(R.drawable.ic_image)
headerView.iv_bg.setColorFilter(getCompatColor(R.color.primaryText)) headerView.iv_bg.setColorFilter(primaryTextColor)
headerView.onClick { selectImage() } headerView.onClick { selectImage() }
requireContext().assets.list("bg/")?.let { requireContext().assets.list("bg/")?.let {
adapter.setItems(it.toList()) adapter.setItems(it.toList())
@ -144,6 +144,12 @@ class BgTextConfigDialog : BaseDialogFragment() {
ReadBookConfig.resetDur() ReadBookConfig.resetDur()
postEvent(EventBus.UP_CONFIG, false) postEvent(EventBus.UP_CONFIG, false)
} }
tv_import.onClick {
}
tv_export.onClick {
}
} }
private fun selectImage() { private fun selectImage() {

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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"
android:id="@+id/root_view" android:id="@+id/root_view"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background" android:background="@color/background"
android:orientation="vertical"
android:padding="10dp"> android:padding="10dp">
<io.legado.app.lib.theme.view.ATESwitch <io.legado.app.lib.theme.view.ATESwitch
@ -20,20 +20,21 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"
android:padding="6dp"> android:padding="6dp">
<io.legado.app.ui.widget.text.StrokeTextView <io.legado.app.ui.widget.text.StrokeTextView
android:id="@+id/tv_text_color" android:id="@+id/tv_text_color"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="2"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:singleLine="true"
android:gravity="center" android:gravity="center"
android:padding="6dp" android:padding="6dp"
android:singleLine="true"
android:text="@string/text_color" android:text="@string/text_color"
android:textSize="14sp" android:textSize="14sp"
app:isBottomBackground="true" app:isBottomBackground="true"
@ -43,14 +44,14 @@
android:id="@+id/tv_bg_color" android:id="@+id/tv_bg_color"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="2"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:singleLine="true"
android:gravity="center" android:gravity="center"
android:padding="6dp" android:padding="6dp"
android:singleLine="true"
android:text="@string/bg_color" android:text="@string/bg_color"
android:textSize="14sp" android:textSize="14sp"
app:isBottomBackground="true" app:isBottomBackground="true"
@ -60,36 +61,52 @@
android:id="@+id/tv_default" android:id="@+id/tv_default"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:singleLine="true"
android:gravity="center" android:gravity="center"
android:padding="6dp" android:padding="6dp"
android:text="恢复默认" android:singleLine="true"
android:text="@string/btn_default_s"
android:textSize="14sp" android:textSize="14sp"
app:isBottomBackground="true" app:isBottomBackground="true"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<io.legado.app.ui.widget.text.StrokeTextView <io.legado.app.ui.widget.text.StrokeTextView
android:id="@+id/tv_import_export" android:id="@+id/tv_import"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" android:layout_marginRight="6dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:singleLine="true"
android:gravity="center" android:gravity="center"
android:padding="6dp" android:padding="6dp"
android:text="导入导出" android:singleLine="true"
android:text="导入"
android:textSize="14sp" android:textSize="14sp"
app:isBottomBackground="true" app:isBottomBackground="true"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<io.legado.app.ui.widget.text.StrokeTextView
android:id="@+id/tv_export"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="6dp"
android:singleLine="true"
android:text="导出"
android:textSize="14sp"
app:isBottomBackground="true"
tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
<TextView <TextView

@ -10,7 +10,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:scaleType="centerCrop" android:scaleType="fitCenter"
android:contentDescription="@string/bg_image" /> android:contentDescription="@string/bg_image" />
<TextView <TextView

Loading…
Cancel
Save