更新
This commit is contained in:
@@ -50,11 +50,6 @@ object AppConst {
|
||||
"androidx.appcompat.view.menu.ListMenuItemView"
|
||||
)
|
||||
|
||||
@SuppressLint("PrivateResource")
|
||||
val sysElevation = appCtx.resources
|
||||
.getDimension(com.google.android.material.R.dimen.design_appbar_elevation)
|
||||
.toInt()
|
||||
|
||||
val androidId: String by lazy {
|
||||
Settings.System.getString(appCtx.contentResolver, Settings.Secure.ANDROID_ID) ?: "null"
|
||||
}
|
||||
|
||||
@@ -179,5 +179,4 @@ object PreferKey {
|
||||
const val showReadTitleAddition = "showReadTitleAddition"
|
||||
const val readBarStyleFollowPage = "readBarStyleFollowPage"
|
||||
const val contentSelectSpeakMod = "contentReadAloudMod"
|
||||
|
||||
}
|
||||
|
||||
@@ -34,11 +34,13 @@ 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.file.HandleFileContract
|
||||
import io.legato.kazusa.utils.ColorUtils
|
||||
import io.legato.kazusa.utils.FileDoc
|
||||
import io.legato.kazusa.utils.find
|
||||
import io.legato.kazusa.utils.getPrefString
|
||||
import io.legato.kazusa.utils.gone
|
||||
import io.legato.kazusa.utils.isTv
|
||||
import io.legato.kazusa.utils.setLightStatusBar
|
||||
import io.legato.kazusa.utils.setNavigationBarColorAuto
|
||||
import io.legato.kazusa.utils.setOnApplyWindowInsetsListenerCompat
|
||||
import io.legato.kazusa.utils.showDialogFragment
|
||||
@@ -158,7 +160,6 @@ abstract class BaseReadBookActivity :
|
||||
fun upSystemUiVisibility(
|
||||
isInMultiWindow: Boolean,
|
||||
toolBarHide: Boolean = true,
|
||||
useBgMeanColor: Boolean = false
|
||||
) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.insetsController?.run {
|
||||
@@ -175,20 +176,19 @@ abstract class BaseReadBookActivity :
|
||||
}
|
||||
}
|
||||
upSystemUiVisibilityO(isInMultiWindow, toolBarHide)
|
||||
// if (toolBarHide) {
|
||||
// setLightStatusBar(ReadBookConfig.durConfig.curStatusIconDark())
|
||||
// } else {
|
||||
// val statusBarColor =
|
||||
// if (AppConfig.readBarStyleFollowPage
|
||||
// && ReadBookConfig.durConfig.curBgType() == 0
|
||||
// || useBgMeanColor
|
||||
// ) {
|
||||
// ReadBookConfig.bgMeanColor
|
||||
// } else {
|
||||
// ThemeStore.statusBarColor(this, AppConfig.isTransparentStatusBar)
|
||||
// }
|
||||
// setLightStatusBar(ColorUtils.isColorLight(statusBarColor))
|
||||
// }
|
||||
if (toolBarHide) {
|
||||
setLightStatusBar(ReadBookConfig.durConfig.curStatusIconDark())
|
||||
} else {
|
||||
val statusBarColor =
|
||||
if (AppConfig.readBarStyleFollowPage
|
||||
&& ReadBookConfig.durConfig.curBgType() == 0
|
||||
) {
|
||||
ReadBookConfig.bgMeanColor
|
||||
} else {
|
||||
ReadBookConfig.bgMeanColor
|
||||
}
|
||||
setLightStatusBar(ColorUtils.isColorLight(statusBarColor))
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
|
||||
@@ -262,7 +262,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
//binding.cursorRight.setColorFilter(accentColor)
|
||||
binding.cursorLeft.setOnTouchListener(this)
|
||||
binding.cursorRight.setOnTouchListener(this)
|
||||
window.setBackgroundDrawable(null)
|
||||
//window.setBackgroundDrawable(null)
|
||||
upScreenTimeOut()
|
||||
ReadBook.register(this)
|
||||
onBackPressedDispatcher.addCallback(this) {
|
||||
@@ -1222,7 +1222,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
* 更新状态栏,导航栏
|
||||
*/
|
||||
override fun upSystemUiVisibility() {
|
||||
upSystemUiVisibility(isInMultiWindow, !menuLayoutIsVisible, bottomDialog > 0)
|
||||
upSystemUiVisibility(isInMultiWindow, !menuLayoutIsVisible)
|
||||
upNavigationBarColor()
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import io.legato.kazusa.utils.sendToClip
|
||||
import io.legato.kazusa.utils.share
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import io.legato.kazusa.utils.visible
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
class TextActionMenu(private val context: Context, private val callBack: CallBack) :
|
||||
@@ -217,7 +218,7 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac
|
||||
kotlin.runCatching {
|
||||
val intent = if (callBack.selectedText.isAbsUrl()) {
|
||||
Intent(Intent.ACTION_VIEW).apply {
|
||||
data = Uri.parse(callBack.selectedText)
|
||||
data = callBack.selectedText.toUri()
|
||||
}
|
||||
} else {
|
||||
Intent(Intent.ACTION_WEB_SEARCH).apply {
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.documentfile.provider.DocumentFile
|
||||
import com.google.android.material.slider.Slider
|
||||
import com.jaredrummler.android.colorpicker.ColorPickerDialog
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.constant.AppLog
|
||||
import io.legato.kazusa.constant.EventBus
|
||||
@@ -61,7 +62,7 @@ import splitties.init.appCtx
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
|
||||
class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) {
|
||||
class BgTextConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_bg_text) {
|
||||
|
||||
companion object {
|
||||
const val TEXT_COLOR = 121
|
||||
@@ -97,14 +98,7 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) {
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.run {
|
||||
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
|
||||
//setBackgroundDrawableResource(R.color.background)
|
||||
decorView.setPadding(0, 0, 0, 0)
|
||||
val attr = attributes
|
||||
attr.dimAmount = 0.0f
|
||||
attr.gravity = Gravity.BOTTOM
|
||||
attributes = attr
|
||||
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ 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
|
||||
@@ -10,10 +11,9 @@ import io.legato.kazusa.lib.dialogs.alert
|
||||
import io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
|
||||
|
||||
class ChineseConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(context, attrs) {
|
||||
class ChineseConverter(context: Context, attrs: AttributeSet?) : MaterialButton(context, attrs) {
|
||||
|
||||
private val spannableString = SpannableString("简/繁")
|
||||
// private var enabledSpan: ForegroundColorSpan = ForegroundColorSpan(context.accentColor)
|
||||
private var onChanged: (() -> Unit)? = null
|
||||
|
||||
init {
|
||||
@@ -27,12 +27,8 @@ class ChineseConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(
|
||||
}
|
||||
|
||||
private fun upUi(type: Int) {
|
||||
//spannableString.removeSpan(enabledSpan)
|
||||
// when (type) {
|
||||
// 1 -> spannableString.setSpan(enabledSpan, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
// 2 -> spannableString.setSpan(enabledSpan, 2, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
// }
|
||||
text = spannableString
|
||||
val showOptions = context.resources.getStringArray(R.array.chinese_mode)
|
||||
text = showOptions.getOrNull(type) ?: ""
|
||||
}
|
||||
|
||||
private fun selectType() {
|
||||
|
||||
@@ -234,7 +234,7 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
binding.apply {
|
||||
ivStyle.setText(item.name.ifBlank { "文字" })
|
||||
ivStyle.setTextColor(item.curTextColor())
|
||||
//ivStyle.setImageDrawable(item.curBgDrawable(100, 150))
|
||||
ivStyle.setImageDrawable(item.curBgDrawable(100, 150))
|
||||
if (ReadBookConfig.styleSelect == holder.layoutPosition) {
|
||||
//ivStyle.borderColor = accentColor
|
||||
ivStyle.setTextBold(true)
|
||||
|
||||
@@ -3,6 +3,7 @@ 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
|
||||
@@ -11,10 +12,9 @@ import io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
|
||||
|
||||
class TextFontWeightConverter(context: Context, attrs: AttributeSet?) :
|
||||
StrokeTextView(context, attrs) {
|
||||
MaterialButton(context, attrs) {
|
||||
|
||||
private val spannableString = SpannableString(context.getString(R.string.font_weight_text))
|
||||
//private var enabledSpan: ForegroundColorSpan = ForegroundColorSpan(context.accentColor)
|
||||
private var onChanged: (() -> Unit)? = null
|
||||
|
||||
init {
|
||||
@@ -29,13 +29,8 @@ class TextFontWeightConverter(context: Context, attrs: AttributeSet?) :
|
||||
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
fun upUi(type: Int) {
|
||||
// spannableString.removeSpan(enabledSpan)
|
||||
// when (type) {
|
||||
// 0 -> spannableString.setSpan(enabledSpan, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
// 1 -> spannableString.setSpan(enabledSpan, 2, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
// 2 -> spannableString.setSpan(enabledSpan, 4, 5, Spannable.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
// }
|
||||
text = spannableString
|
||||
val weightOptions = context.resources.getStringArray(R.array.text_font_weight)
|
||||
text = weightOptions.getOrNull(type) ?: ""
|
||||
}
|
||||
|
||||
private fun selectType() {
|
||||
|
||||
@@ -22,6 +22,7 @@ import io.legato.kazusa.utils.printOnDebug
|
||||
import io.legato.kazusa.utils.spToPx
|
||||
import kotlin.math.min
|
||||
import kotlin.math.pow
|
||||
import androidx.core.graphics.createBitmap
|
||||
|
||||
@Suppress("unused", "MemberVisibilityCanBePrivate")
|
||||
class CircleImageView @JvmOverloads constructor(
|
||||
@@ -293,17 +294,9 @@ class CircleImageView @JvmOverloads constructor(
|
||||
|
||||
return try {
|
||||
val bitmap: Bitmap = if (drawable is ColorDrawable) {
|
||||
Bitmap.createBitmap(
|
||||
COLOR_DRAWABLE_DIMENSION,
|
||||
COLOR_DRAWABLE_DIMENSION,
|
||||
BITMAP_CONFIG
|
||||
)
|
||||
createBitmap(COLOR_DRAWABLE_DIMENSION, COLOR_DRAWABLE_DIMENSION, BITMAP_CONFIG)
|
||||
} else {
|
||||
Bitmap.createBitmap(
|
||||
drawable.intrinsicWidth,
|
||||
drawable.intrinsicHeight,
|
||||
BITMAP_CONFIG
|
||||
)
|
||||
createBitmap(drawable.intrinsicWidth, drawable.intrinsicHeight, BITMAP_CONFIG)
|
||||
}
|
||||
|
||||
val canvas = Canvas(bitmap)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/btn_bg_press" />
|
||||
<solid
|
||||
android:color="?attr/colorSurface" />
|
||||
</shape>
|
||||
@@ -365,8 +365,8 @@
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:minHeight="48dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingBottom="80dp"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:text="@string/book_intro"
|
||||
android:textIsSelectable="true"
|
||||
|
||||
@@ -1,83 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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"
|
||||
android:id="@+id/ll_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/chapter"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:boxBackgroundMode="outline">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/bg_edit"
|
||||
android:hint="@string/start"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="number"
|
||||
android:lines="1"
|
||||
android:maxLength="5"
|
||||
android:minWidth="60dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textCursorDrawable="@drawable/shape_text_cursor"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="TouchTargetSizeCheck,TextContrastCheck" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/to"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/bg_edit"
|
||||
android:hint="@string/end"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="number"
|
||||
android:lines="1"
|
||||
android:maxLength="5"
|
||||
android:minWidth="60dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textCursorDrawable="@drawable/shape_text_cursor"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck,TextContrastCheck" />
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edit_start"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="起始章"
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:boxBackgroundMode="outline">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edit_end"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="结束章"
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:padding="6dp">
|
||||
|
||||
<TextView
|
||||
@@ -19,41 +20,38 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/style_name"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:textColor="@color/secondaryText"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:textSize="16sp"
|
||||
tools:text="文字" />
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_edit"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:contentDescription="@string/edit"
|
||||
android:src="@drawable/ic_edit"
|
||||
app:tint="@color/secondaryText" />
|
||||
app:iconGravity="textStart"
|
||||
app:icon="@drawable/ic_edit" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_restore"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/restore"
|
||||
android:textColor="@color/primaryText" />
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_height="40dp"
|
||||
android:text="@string/restore" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/sw_dark_status_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -61,7 +59,7 @@
|
||||
android:text="@string/dark_status_icon"
|
||||
tools:ignore="TouchTargetSizeCheck" />
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/sw_underline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -73,94 +71,97 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="6dp">
|
||||
android:padding="3dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_text_color"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
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"
|
||||
android:singleLine="true"
|
||||
app:icon="@drawable/ic_palette"
|
||||
android:text="@string/text_color"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_bg_color"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_weight="5"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:padding="6dp"
|
||||
android:singleLine="true"
|
||||
app:icon="@drawable/ic_fill_colors"
|
||||
android:text="@string/bg_color"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<ImageView
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
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:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/import_str"
|
||||
android:src="@drawable/ic_import"
|
||||
android:tooltipText="@string/import_str"
|
||||
app:icon="@drawable/ic_import"
|
||||
android:text="@string/import_str"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
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:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:contentDescription="@string/import_str"
|
||||
android:src="@drawable/ic_export"
|
||||
android:tooltipText="@string/export_str"
|
||||
app:icon="@drawable/ic_export"
|
||||
android:text="@string/export_str"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_delete"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/delete"
|
||||
android:src="@drawable/ic_clear_all"
|
||||
android:tooltipText="@string/delete"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
android:text="@string/delete"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bg_alpha"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingTop="16dp"
|
||||
android:text="@string/bg_alpha" />
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeSlider
|
||||
<com.google.android.material.slider.Slider
|
||||
android:id="@+id/sb_bg_alpha"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:valueFrom="0.0"
|
||||
android:valueTo="100.0"
|
||||
android:stepSize="1"
|
||||
android:padding="6dp"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
@@ -168,8 +169,7 @@
|
||||
android:id="@+id/tv_bg_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingTop="16dp"
|
||||
android:text="@string/bg_image" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -177,7 +177,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="6dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_bg_image" />
|
||||
|
||||
|
||||
@@ -7,120 +7,80 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="界面设置"
|
||||
style="@style/TextAppearance.Material3.TitleLarge">
|
||||
|
||||
</TextView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="16dp">
|
||||
android:layout_marginHorizontal="16dp" >
|
||||
|
||||
<io.legato.kazusa.ui.book.read.config.TextFontWeightConverter
|
||||
android:id="@+id/text_font_weight_converter"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
app:radius="3dp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
android:text="@string/font_weight_text" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_text_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="@string/text_font"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
app:radius="3dp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:text="@string/text_font" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_text_indent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="@string/text_indent"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
app:radius="3dp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:text="@string/text_indent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="16dp" >
|
||||
|
||||
<io.legato.kazusa.ui.book.read.config.ChineseConverter
|
||||
android:id="@+id/chinese_converter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
app:radius="3dp" />
|
||||
android:layout_weight="1"
|
||||
style="@style/Widget.Material3.Button.TonalButton" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_padding"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="@string/padding"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
app:radius="3dp" />
|
||||
android:layout_weight="1"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:text="@string/padding" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.StrokeTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="@string/information"
|
||||
android:textSize="14sp"
|
||||
app:isBottomBackground="true"
|
||||
app:radius="3dp" />
|
||||
android:layout_weight="1"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:text="@string/information" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -182,13 +142,14 @@
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="11dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:scrollbars="none">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/rg_page_anim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="11dp"
|
||||
app:singleLine="true"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
@@ -200,8 +161,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_cover"
|
||||
app:chipStrokeColor="@color/primaryText"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
/>
|
||||
|
||||
<!-- 滑动动画 Chip -->
|
||||
<com.google.android.material.chip.Chip
|
||||
@@ -211,7 +171,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_slide"
|
||||
app:chipStrokeColor="@color/primaryText"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
|
||||
<!-- 仿真翻页 Chip -->
|
||||
@@ -222,7 +181,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_simulation"
|
||||
app:chipStrokeColor="@color/primaryText"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
|
||||
<!-- 滚动动画 Chip -->
|
||||
@@ -233,7 +191,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_scroll"
|
||||
app:chipStrokeColor="@color/primaryText"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
|
||||
<!-- 无动画 Chip -->
|
||||
@@ -244,7 +201,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_none"
|
||||
app:chipStrokeColor="@color/primaryText"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:icon="@drawable/ic_arrow_drop_up"
|
||||
app:icon="@drawable/ic_arrow_drop_up"
|
||||
android:contentDescription="@string/go_to_top"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp" />
|
||||
@@ -49,7 +49,7 @@
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:icon="@drawable/ic_arrow_drop_down"
|
||||
app:icon="@drawable/ic_arrow_drop_down"
|
||||
android:contentDescription="@string/go_to_bottom"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp" />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp">
|
||||
android:paddingVertical="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_locked"
|
||||
@@ -26,9 +26,9 @@
|
||||
android:id="@+id/tv_chapter_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="13sp"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:maxLines="2"
|
||||
app:layout_constraintBottom_toTopOf="@id/barrier"
|
||||
app:layout_constraintLeft_toRightOf="@+id/iv_locked"
|
||||
app:layout_constraintRight_toLeftOf="@+id/iv_checked"
|
||||
|
||||
@@ -7,6 +7,5 @@
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
app:civ_border_width="1dp"
|
||||
app:text="@string/text" />
|
||||
@@ -10,6 +10,5 @@
|
||||
android:padding="5dp"
|
||||
android:maxLines="1"
|
||||
android:scrollbars="none"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textSize="14sp"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/colorSurfaceContainer"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="chinese_mode">
|
||||
<item>关闭</item>
|
||||
<item>关闭简繁转换</item>
|
||||
<item>繁体转简体</item>
|
||||
<item>简体转繁体</item>
|
||||
</string-array>
|
||||
|
||||
Reference in New Issue
Block a user