重新设计界面设置布局
This commit is contained in:
@@ -507,7 +507,7 @@ object ReadBookConfig {
|
||||
private var pageAnim: Int = 0,//翻页动画
|
||||
private var pageAnimEInk: Int = 4,
|
||||
var textFont: String = "",//字体
|
||||
var textBold: Int = 0,//是否粗体字 0:正常, 1:粗体, 2:细体
|
||||
var textBold: Int = 500,//是否粗体字 0:正常, 1:粗体, 2:细体
|
||||
var textSize: Int = 20,//文字大小
|
||||
var letterSpacing: Float = 0.1f,//字间距
|
||||
var lineSpacingExtra: Int = 12,//行间距
|
||||
|
||||
@@ -34,7 +34,6 @@ import io.legato.kazusa.ui.book.read.config.BgTextConfigDialog
|
||||
import io.legato.kazusa.ui.book.read.config.ClickActionConfigDialog
|
||||
import io.legato.kazusa.ui.book.read.config.PaddingConfigDialog
|
||||
import io.legato.kazusa.ui.book.read.config.PageKeyDialog
|
||||
import io.legato.kazusa.ui.book.read.config.ReadSpacingDialog
|
||||
import io.legato.kazusa.ui.file.HandleFileContract
|
||||
import io.legato.kazusa.utils.ColorUtils
|
||||
import io.legato.kazusa.utils.FileDoc
|
||||
@@ -125,10 +124,6 @@ abstract class BaseReadBookActivity :
|
||||
|
||||
}
|
||||
|
||||
fun showSpacingDialog() {
|
||||
showDialogFragment<ReadSpacingDialog>()
|
||||
}
|
||||
|
||||
fun showPaddingConfig() {
|
||||
showDialogFragment<PaddingConfigDialog>()
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package io.legato.kazusa.ui.book.read.config
|
||||
|
||||
import android.content.Context
|
||||
import android.text.SpannableString
|
||||
import android.util.AttributeSet
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.help.config.AppConfig
|
||||
import io.legato.kazusa.lib.dialogs.alert
|
||||
//import io.legado.app.lib.theme.accentColor
|
||||
import io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
|
||||
|
||||
class ChineseConverter(context: Context, attrs: AttributeSet?) : MaterialButton(context, attrs) {
|
||||
|
||||
private val spannableString = SpannableString("简/繁")
|
||||
private var onChanged: (() -> Unit)? = null
|
||||
|
||||
init {
|
||||
text = spannableString
|
||||
if (!isInEditMode) {
|
||||
upUi(AppConfig.chineseConverterType)
|
||||
}
|
||||
setOnClickListener {
|
||||
selectType()
|
||||
}
|
||||
}
|
||||
|
||||
private fun upUi(type: Int) {
|
||||
val showOptions = context.resources.getStringArray(R.array.chinese_mode)
|
||||
text = showOptions.getOrNull(type) ?: ""
|
||||
}
|
||||
|
||||
private fun selectType() {
|
||||
context.alert(titleResource = R.string.chinese_converter) {
|
||||
items(context.resources.getStringArray(R.array.chinese_mode).toList()) { _, i ->
|
||||
AppConfig.chineseConverterType = i
|
||||
upUi(i)
|
||||
onChanged?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onChanged(unit: () -> Unit) {
|
||||
onChanged = unit
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package io.legato.kazusa.ui.book.read.config
|
||||
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.constant.EventBus
|
||||
import io.legato.kazusa.databinding.DialogReadBookSpacingBinding
|
||||
import io.legato.kazusa.help.config.ReadBookConfig
|
||||
import io.legato.kazusa.ui.book.read.ReadBookActivity
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
|
||||
class ReadSpacingDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_spacing) {
|
||||
|
||||
private val binding by viewBinding(DialogReadBookSpacingBinding::bind)
|
||||
private val callBack get() = activity as? ReadBookActivity
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
(activity as ReadBookActivity).bottomDialog++
|
||||
initView()
|
||||
upView()
|
||||
initViewEvent()
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
ReadBookConfig.save()
|
||||
(activity as ReadBookActivity).bottomDialog--
|
||||
}
|
||||
|
||||
private fun initView() = binding.run {
|
||||
dsbTextLetterSpacing.valueFormat = {
|
||||
((it - 50) / 100f).toString()
|
||||
}
|
||||
dsbLineSize.valueFormat = { ((it - 10) / 10f).toString() }
|
||||
dsbParagraphSpacing.valueFormat = { (it / 10f).toString() }
|
||||
}
|
||||
|
||||
private fun initViewEvent() = binding.run {
|
||||
dsbTextLetterSpacing.onChanged = {
|
||||
ReadBookConfig.letterSpacing = (it - 50) / 100f
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||
}
|
||||
dsbLineSize.onChanged = {
|
||||
ReadBookConfig.lineSpacingExtra = it
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||
}
|
||||
dsbParagraphSpacing.onChanged = {
|
||||
ReadBookConfig.paragraphSpacing = it
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||
}
|
||||
}
|
||||
|
||||
private fun upView() = binding.run {
|
||||
ReadBookConfig.let {
|
||||
dsbTextLetterSpacing.progress = (it.letterSpacing * 100).toInt() + 50
|
||||
dsbLineSize.progress = it.lineSpacingExtra
|
||||
dsbParagraphSpacing.progress = it.paragraphSpacing
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,8 @@ import io.legato.kazusa.help.config.AppConfig
|
||||
import io.legato.kazusa.help.config.ReadBookConfig
|
||||
import io.legato.kazusa.help.config.ThemeConfig
|
||||
import io.legato.kazusa.lib.dialogs.alert
|
||||
import io.legato.kazusa.lib.dialogs.selector
|
||||
import io.legato.kazusa.model.ReadBook
|
||||
import io.legato.kazusa.ui.book.read.ReadBookActivity
|
||||
import io.legato.kazusa.ui.font.FontSelectDialog
|
||||
import io.legato.kazusa.utils.ChineseUtils
|
||||
import io.legato.kazusa.utils.dpToPx
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
@@ -96,21 +94,9 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
}
|
||||
}
|
||||
|
||||
textFontWeightConverter.onChanged {
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 9, 6))
|
||||
}
|
||||
tvTextFont.setOnClickListener {
|
||||
showDialogFragment<FontSelectDialog>()
|
||||
}
|
||||
tvTextIndent.setOnClickListener {
|
||||
context?.selector(
|
||||
title = getString(R.string.text_indent),
|
||||
items = resources.getStringArray(R.array.indent).toList()
|
||||
) { _, index ->
|
||||
ReadBookConfig.paragraphIndent = " ".repeat(index)
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||
}
|
||||
}
|
||||
tvPadding.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
callBack?.showPaddingConfig()
|
||||
@@ -156,10 +142,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
ReadBookConfig.textSize = it + 5
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||
}
|
||||
|
||||
btnSpacing.setOnClickListener {
|
||||
callBack?.showSpacingDialog()
|
||||
}
|
||||
}
|
||||
|
||||
private fun changeBgTextConfig(index: Int) {
|
||||
@@ -184,7 +166,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
}
|
||||
|
||||
private fun upView() = binding.run {
|
||||
textFontWeightConverter.upUi(ReadBookConfig.textBold)
|
||||
ReadBook.pageAnim().let {
|
||||
if (it >= 0 && it < rgPageAnim.childCount) {
|
||||
rgPageAnim.check(rgPageAnim[it].id)
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package io.legato.kazusa.ui.book.read.config
|
||||
|
||||
import android.content.Context
|
||||
import android.text.SpannableString
|
||||
import android.util.AttributeSet
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.help.config.ReadBookConfig
|
||||
import io.legato.kazusa.lib.dialogs.alert
|
||||
//import io.legado.app.lib.theme.accentColor
|
||||
import io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
|
||||
|
||||
class TextFontWeightConverter(context: Context, attrs: AttributeSet?) :
|
||||
MaterialButton(context, attrs) {
|
||||
|
||||
private val spannableString = SpannableString(context.getString(R.string.font_weight_text))
|
||||
private var onChanged: (() -> Unit)? = null
|
||||
|
||||
init {
|
||||
text = spannableString
|
||||
if (!isInEditMode) {
|
||||
upUi(ReadBookConfig.textBold)
|
||||
}
|
||||
setOnClickListener {
|
||||
selectType()
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
fun upUi(type: Int) {
|
||||
val weightOptions = context.resources.getStringArray(R.array.text_font_weight)
|
||||
text = weightOptions.getOrNull(type) ?: ""
|
||||
}
|
||||
|
||||
private fun selectType() {
|
||||
context.alert(titleResource = R.string.text_font_weight_converter) {
|
||||
items(context.resources.getStringArray(R.array.text_font_weight).toList()) { _, i ->
|
||||
ReadBookConfig.textBold = i
|
||||
upUi(i)
|
||||
onChanged?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onChanged(unit: () -> Unit) {
|
||||
onChanged = unit
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package io.legato.kazusa.ui.font
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Typeface
|
||||
import android.os.Build
|
||||
import android.view.ViewGroup
|
||||
import io.legato.kazusa.base.adapter.ItemViewHolder
|
||||
import io.legato.kazusa.base.adapter.RecyclerAdapter
|
||||
import io.legato.kazusa.constant.AppLog
|
||||
import io.legato.kazusa.databinding.ItemFontBinding
|
||||
import io.legato.kazusa.utils.*
|
||||
import java.io.File
|
||||
import java.net.URLDecoder
|
||||
|
||||
class FontAdapter(context: Context, curFilePath: String, val callBack: CallBack) :
|
||||
RecyclerAdapter<FileDoc, ItemFontBinding>(context) {
|
||||
|
||||
private val curName = kotlin.runCatching {
|
||||
URLDecoder.decode(curFilePath, "utf-8")
|
||||
}.getOrNull()?.substringAfterLast(File.separator)
|
||||
|
||||
override fun getViewBinding(parent: ViewGroup): ItemFontBinding {
|
||||
return ItemFontBinding.inflate(inflater, parent, false)
|
||||
}
|
||||
|
||||
override fun convert(
|
||||
holder: ItemViewHolder,
|
||||
binding: ItemFontBinding,
|
||||
item: FileDoc,
|
||||
payloads: MutableList<Any>
|
||||
) {
|
||||
binding.run {
|
||||
kotlin.runCatching {
|
||||
val typeface: Typeface? = if (item.isContentScheme) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
context.contentResolver
|
||||
.openFileDescriptor(item.uri, "r")?.use {
|
||||
Typeface.Builder(it.fileDescriptor).build()
|
||||
}
|
||||
} else {
|
||||
Typeface.createFromFile(RealPathUtil.getPath(context, item.uri))
|
||||
}
|
||||
} else {
|
||||
Typeface.createFromFile(item.uri.path!!)
|
||||
}
|
||||
tvFont.typeface = typeface
|
||||
}.onFailure {
|
||||
it.printOnDebug()
|
||||
AppLog.put("读取字体 ${item.name} 出错\n${it.localizedMessage}", it, true)
|
||||
}
|
||||
tvFont.text = item.name
|
||||
root.setOnClickListener { callBack.onFontSelect(item) }
|
||||
if (item.name == curName) {
|
||||
ivChecked.visible()
|
||||
} else {
|
||||
ivChecked.invisible()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerListener(holder: ItemViewHolder, binding: ItemFontBinding) {
|
||||
holder.itemView.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.onFontSelect(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface CallBack {
|
||||
fun onFontSelect(docItem: FileDoc)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M120,200L120,120L840,120L840,200L120,200ZM760,280Q793,280 816.5,303.5Q840,327 840,360L840,760Q840,793 816.5,816.5Q793,840 760,840L200,840Q167,840 143.5,816.5Q120,793 120,760L120,360Q120,327 143.5,303.5Q167,280 200,280L760,280ZM760,360L200,360Q200,360 200,360Q200,360 200,360L200,760Q200,760 200,760Q200,760 200,760L760,760Q760,760 760,760Q760,760 760,760L760,360Q760,360 760,360Q760,360 760,360ZM200,360Q200,360 200,360Q200,360 200,360L200,760Q200,760 200,760Q200,760 200,760L200,760Q200,760 200,760Q200,760 200,760L200,360Q200,360 200,360Q200,360 200,360Z" />
|
||||
</vector>
|
||||
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/root_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="界面设置"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_text_letter_spacing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:isBottomBackground="true"
|
||||
app:max="100"
|
||||
app:title="@string/text_letter_spacing" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_line_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:isBottomBackground="true"
|
||||
app:max="20"
|
||||
app:title="@string/line_size" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_paragraph_spacing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:isBottomBackground="true"
|
||||
app:max="20"
|
||||
app:title="@string/paragraph_size" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
@@ -48,8 +48,10 @@
|
||||
android:layout_height="36dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textColor="?attr/colorTertiary"
|
||||
app:iconSize="16dp"
|
||||
app:icon="@drawable/ic_brightness"
|
||||
app:backgroundTint="?attr/colorTertiaryContainer"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_sheet_title"
|
||||
@@ -71,151 +73,86 @@
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="12dp" >
|
||||
|
||||
<io.legato.kazusa.ui.book.read.config.TextFontWeightConverter
|
||||
android:id="@+id/text_font_weight_converter"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:text="@string/font_weight_text"
|
||||
android:layout_weight="2"
|
||||
app:icon="@drawable/font_bold"
|
||||
app:iconGravity="textTop"
|
||||
android:textSize="10sp"
|
||||
tool:ignore="SmallSp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_text_font"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_weight="2"
|
||||
android:text="@string/text_font"
|
||||
app:icon="@drawable/font_style"
|
||||
app:iconGravity="textTop"
|
||||
android:textSize="10sp"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:text="字体与间距"
|
||||
app:icon="@drawable/ic_cfg_txt"
|
||||
tool:ignore="SmallSp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_text_indent"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_weight="2"
|
||||
android:text="@string/text_indent"
|
||||
app:icon="@drawable/ic_segment"
|
||||
app:iconGravity="textTop"
|
||||
android:textSize="10sp"
|
||||
tool:ignore="SmallSp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_padding"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/padding"
|
||||
app:icon="@drawable/ic_padding"
|
||||
app:iconGravity="textTop"
|
||||
android:textSize="10sp"
|
||||
tool:ignore="SmallSp" />
|
||||
|
||||
</com.google.android.material.button.MaterialButtonGroup>
|
||||
|
||||
<com.google.android.material.button.MaterialButtonGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="16dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="2"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:text="@string/information" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:text="@string/more_setting" />
|
||||
android:text="@string/information"
|
||||
app:icon="@drawable/ic_header"
|
||||
tool:ignore="SmallSp" />
|
||||
|
||||
</com.google.android.material.button.MaterialButtonGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="4dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginHorizontal="16dp">
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_text_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="2dp"
|
||||
app:orientation="horizontal"
|
||||
app:isBottomBackground="true"
|
||||
android:layout_marginBottom="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:max="45"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:orientation="vertical"
|
||||
app:title="@string/text_size" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnChineseConverter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp"
|
||||
app:iconPadding="0dp"
|
||||
app:icon="@drawable/ic_cn_convert"
|
||||
app:iconGravity="textStart"
|
||||
app:iconSize="16dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
app:iconSize="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_more"
|
||||
app:layout_constraintStart_toEndOf="@id/dsb_text_size" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_spacing"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
android:id="@+id/tv_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="间距设置"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
app:icon="@drawable/ic_arrow_right"
|
||||
app:iconGravity="textEnd" />
|
||||
android:text="@string/more_setting"
|
||||
app:iconGravity="end"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
@@ -230,7 +167,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/page_anim"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp" />
|
||||
@@ -318,7 +254,7 @@
|
||||
android:id="@+id/rv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@@ -59,20 +59,20 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_header_padding_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_top" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_header_padding_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
|
||||
@@ -85,20 +85,20 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_header_padding_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
app:max="100"
|
||||
android:layout_weight="1"
|
||||
app:title="@string/padding_left" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_header_padding_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
|
||||
@@ -122,20 +122,19 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_padding_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_weight="1"
|
||||
app:max="200"
|
||||
app:title="@string/padding_top" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_padding_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
|
||||
@@ -148,20 +147,19 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_padding_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_left" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_padding_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
|
||||
@@ -202,20 +200,19 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_top" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
|
||||
@@ -228,20 +225,18 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_left" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_title_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/title_margin_top" />
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_title_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/title_margin_bottom" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="2dp"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceVariant"
|
||||
@@ -50,7 +50,7 @@
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="112dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
@@ -58,8 +58,10 @@
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_seek_reduce"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="40dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="3"
|
||||
android:minWidth="64dp"
|
||||
android:contentDescription="@string/reduce"
|
||||
android:elevation="4dp"
|
||||
app:backgroundTint="?attr/colorSurfaceContainer"
|
||||
@@ -71,7 +73,7 @@
|
||||
android:id="@+id/tvSeekValue"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"
|
||||
android:text="@string/text"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
@@ -81,8 +83,10 @@
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_seek_plus"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="40dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="3"
|
||||
android:minWidth="64dp"
|
||||
android:contentDescription="@string/plus"
|
||||
android:elevation="4dp"
|
||||
app:backgroundTint="?attr/colorSurfaceContainer"
|
||||
|
||||
@@ -524,10 +524,10 @@
|
||||
<string name="use_regex">使用正则表达式</string>
|
||||
<string name="text_indent">缩进</string>
|
||||
<string name="indent_0">无缩进</string>
|
||||
<string name="indent_1">一字符缩进</string>
|
||||
<string name="indent_2">二字符缩进</string>
|
||||
<string name="indent_3">三字符缩进</string>
|
||||
<string name="indent_4">四字符缩进</string>
|
||||
<string name="indent_1">一字符</string>
|
||||
<string name="indent_2">二字符</string>
|
||||
<string name="indent_3">三字符</string>
|
||||
<string name="indent_4">四字符</string>
|
||||
<string name="select_folder">选择文件夹</string>
|
||||
<string name="select_file">选择文件</string>
|
||||
<string name="no_find">没有发现,可以在书源里添加。</string>
|
||||
@@ -710,7 +710,7 @@
|
||||
<string name="middle">中</string>
|
||||
<string name="information">信息</string>
|
||||
<string name="switchLayout">切换布局</string>
|
||||
<string name="text_font_weight_converter">文章字重切换</string>
|
||||
<string name="text_font_weight_converter">字重</string>
|
||||
<string name="full_screen_gestures_support">全面屏手势优化</string>
|
||||
<string name="disable_return_key">禁用返回键</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user