排版导入导出改成图标,解决字体太大显示不了的bug

pull/374/head
gedoor 4 years ago
parent d6387ca46d
commit f707df1f61
  1. 13
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  2. 14
      app/src/main/res/drawable/ic_export.xml
  3. 41
      app/src/main/res/drawable/ic_import.xml
  4. 8
      app/src/main/res/drawable/ic_share.xml
  5. 51
      app/src/main/res/layout/dialog_read_bg_text.xml

@ -102,6 +102,8 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
secondaryTextColor = requireContext().getSecondaryTextColor(isLight)
root_view.setBackgroundColor(bg)
sw_dark_status_icon.setTextColor(primaryTextColor)
iv_import.setColorFilter(primaryTextColor)
iv_export.setColorFilter(primaryTextColor)
tv_bg_image.setTextColor(primaryTextColor)
}
@ -155,12 +157,13 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
ReadBookConfig.resetDur()
postEvent(EventBus.UP_CONFIG, false)
}
tv_import.onClick {
iv_import.onClick {
val importFormNet = "网络导入"
val otherActions = arrayListOf(importFormNet)
FilePicker.selectFile(
this@BgTextConfigDialog,
requestCodeImport,
title = getString(R.string.import_str),
allowExtensions = arrayOf("zip"),
otherActions = otherActions
) { action ->
@ -169,8 +172,12 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
}
}
}
tv_export.onClick {
FilePicker.selectFolder(this@BgTextConfigDialog, requestCodeExport)
iv_export.onClick {
FilePicker.selectFolder(
this@BgTextConfigDialog,
requestCodeExport,
title = getString(R.string.export_str)
)
}
}

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="28dp"
android:height="24dp"
android:viewportWidth="1280"
android:viewportHeight="1024">
<path
android:fillColor="#050505"
android:pathData="M526 780H380.8c-19.2 0-34.8-15.6-34.8-34.8V267.8c0-19.2 15.6-34.8 34.8-34.8h477.4c19.2 0 34.8 15.6 34.8 34.8V413c0 18.8 15.2 34 34 34s34-15.2 34-34V234.1c0-38.2-31-69.1-69.1-69.1H347.1c-38.2 0-69.1 31-69.1 69.1v544.7c0 38.2 31 69.1 69.1 69.1H526c18.8 0 34-15.2 34-34 0-18.7-15.2-33.9-34-33.9z" />
<path
android:fillColor="#000000"
android:pathData="M950.9 654.8l-0.1-0.1L817.1 521c-13.3-13.3-34.8-13.3-48.1 0-13.3 13.3-13.3 34.8 0 48.1l75.9 75.9H632c-18.8 0-34 15.2-34 34s15.2 34 34 34h212.7L769 788.7c-13.3 13.3-13.3 34.8 0 48.1 13.3 13.3 34.8 13.3 48.1 0l131.6-131.6c7.5-6.2 12.3-15.6 12.3-26.1 0-9.6-3.9-18.1-10.1-24.3z" />
</vector>

@ -1,32 +1,15 @@
<vector android:autoMirrored="true"
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="28dp"
android:height="24dp"
android:viewportHeight="48"
android:viewportWidth="48"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
android:viewportWidth="1280"
android:viewportHeight="1024">
<path
android:fillColor="#373838"
android:pathData="M20.4,12.2c0,-0.3 -0.1,-0.5 -0.3,-0.7c-0.4,-0.4 -1.1,-0.4 -1.5,0L6.9,23.3c-0.2,0.2 -0.3,0.5 -0.3,0.7c0,0.1 0,0.3 0.1,0.4c0,0.1 0.1,0.2 0.2,0.3c0,0 0,0 0,0.1l0,0c0,0 0,0 0,0c0,0 0,0 0,0l11.8,11.8c0.2,0.2 0.5,0.3 0.7,0.3c0.3,0 0.5,-0.1 0.7,-0.3c0.2,-0.2 0.3,-0.5 0.3,-0.7s-0.1,-0.5 -0.3,-0.7l-11,-11l11,-11C20.3,12.8 20.4,12.5 20.4,12.2z"
android:strokeColor="#39393A"
android:strokeWidth="1" />
android:fillColor="#000000"
android:pathData="M394 376V230.8c0-19.2 15.6-34.8 34.8-34.8h477.4c19.2 0 34.8 15.6 34.8 34.8v477.4c0 19.2-15.6 34.8-34.8 34.8H761c-18.8 0-34 15.2-34 34s15.2 34 34 34h178.9c38.2 0 69.1-31 69.1-69.1V197.1c0-38.2-31-69.1-69.1-69.1H395.1c-38.2 0-69.1 31-69.1 69.1V376c0 18.8 15.2 34 34 34s34-15.2 34-34z" />
<path
android:fillColor="#373838"
android:pathData="M41.1,23.3L41.1,23.3L41.1,23.3L41.1,23.3L29.3,11.5c-0.2,-0.2 -0.5,-0.3 -0.7,-0.3c-0.3,0 -0.5,0.1 -0.7,0.3c-0.2,0.2 -0.3,0.5 -0.3,0.7c0,0.3 0.1,0.5 0.3,0.7l11,11l-11,11c-0.2,0.2 -0.3,0.5 -0.3,0.7c0,0.3 0.1,0.5 0.3,0.7c0.4,0.4 1.1,0.4 1.5,0l11.8,-11.8c0.2,-0.2 0.3,-0.5 0.3,-0.7C41.4,23.7 41.3,23.5 41.1,23.3z"
android:strokeColor="#39393A"
android:strokeWidth="1" />
<path
android:fillColor="#373838"
android:pathData="M16.2,24c0,0.7 0.6,1.3 1.3,1.3c0.7,0 1.3,-0.6 1.3,-1.3c0,-0.7 -0.6,-1.3 -1.3,-1.3C16.7,22.7 16.2,23.3 16.2,24z"
android:strokeColor="#39393A"
android:strokeWidth="1" />
<path
android:fillColor="#373838"
android:pathData="M24,22.7c-0.7,0 -1.3,0.6 -1.3,1.3c0,0.7 0.6,1.3 1.3,1.3c0.7,0 1.3,-0.6 1.3,-1.3C25.3,23.3 24.7,22.7 24,22.7z"
android:strokeColor="#39393A"
android:strokeWidth="1" />
<path
android:fillColor="#373838"
android:pathData="M32.3,24c0,-0.7 -0.6,-1.3 -1.3,-1.3c-0.7,0 -1.3,0.6 -1.3,1.3c0,0.7 0.6,1.3 1.3,1.3C31.7,25.3 32.3,24.7 32.3,24z"
android:strokeColor="#39393A"
android:strokeWidth="1" />
</vector>
android:fillColor="#000000"
android:pathData="M678.9 618.8l-0.1-0.1L545.1 485c-13.3-13.3-34.8-13.3-48.1 0-13.3 13.3-13.3 34.8 0 48.1l75.9 75.9H360c-18.8 0-34 15.2-34 34s15.2 34 34 34h212.7L497 752.7c-13.3 13.3-13.3 34.8 0 48.1 13.3 13.3 34.8 13.3 48.1 0l131.6-131.6c7.5-6.2 12.3-15.6 12.3-26.1 0-9.6-3.9-18.1-10.1-24.3z" />
</vector>

@ -1,9 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="20dp"
android:height="20dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"
android:fillColor="#000000"/>
android:fillColor="#000000" />
</vector>

@ -19,18 +19,18 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<io.legado.app.ui.widget.text.StrokeTextView
android:id="@+id/tv_text_color"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:layout_gravity="center"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_weight="5"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="6dp"
@ -44,10 +44,10 @@
android:id="@+id/tv_bg_color"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:layout_gravity="center"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_weight="5"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="6dp"
@ -61,10 +61,10 @@
android:id="@+id/tv_default"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_gravity="center"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_weight="3"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="6dp"
@ -74,39 +74,30 @@
app:isBottomBackground="true"
tools:ignore="HardcodedText" />
<io.legado.app.ui.widget.text.StrokeTextView
android:id="@+id/tv_import"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_gravity="center"
<ImageView
android:id="@+id/iv_import"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="6dp"
android:singleLine="true"
android:text="@string/import_str"
android:textSize="14sp"
app:isBottomBackground="true"
tools:ignore="HardcodedText" />
android:contentDescription="@string/import_str"
android:src="@drawable/ic_import"
android:tooltipText="@string/import_str"
tools:ignore="UnusedAttribute" />
<io.legado.app.ui.widget.text.StrokeTextView
android:id="@+id/tv_export"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_gravity="center"
<ImageView
android:id="@+id/iv_export"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:padding="6dp"
android:singleLine="true"
android:text="@string/export_str"
android:textSize="14sp"
app:isBottomBackground="true"
tools:ignore="HardcodedText" />
android:contentDescription="@string/import_str"
android:src="@drawable/ic_export"
android:tooltipText="@string/export_str"
tools:ignore="UnusedAttribute" />
</LinearLayout>
<TextView

Loading…
Cancel
Save