更新界面
This commit is contained in:
@@ -88,6 +88,7 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'cronet-proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
applicationIdSuffix ".debug"
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.myConfig
|
||||
}
|
||||
|
||||
@@ -25,5 +25,33 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1",
|
||||
|
||||
"project_info": {
|
||||
"project_number": "735500663982",
|
||||
"project_id": "kazesa-debug",
|
||||
"storage_bucket": "kazesa-debug.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:735500663982:android:68276b2e9a0c230069013f",
|
||||
"android_client_info": {
|
||||
"package_name": "io.legato.kazusa.debug"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDt65UOURbutB8DnTOEGuDf6Vhw56T9nq4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -28,6 +28,7 @@
|
||||
android:label="${app_name}"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Base.AppTheme"
|
||||
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute">
|
||||
@@ -125,6 +126,7 @@
|
||||
<activity
|
||||
android:name=".ui.book.read.ReadBookActivity"
|
||||
android:configChanges="locale|keyboardHidden|smallestScreenSize|screenLayout"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
@@ -140,6 +142,7 @@
|
||||
<activity
|
||||
android:name=".ui.book.manga.ReadMangaActivity"
|
||||
android:exported="false"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
|
||||
@@ -214,56 +217,47 @@
|
||||
<activity
|
||||
android:name=".ui.about.AboutActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTask" />
|
||||
<!-- 书源管理 -->
|
||||
<activity
|
||||
android:name=".ui.book.source.manage.BookSourceActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- 订阅源管理 -->
|
||||
<activity
|
||||
android:name=".ui.rss.source.manage.RssSourceActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- txt目录规则管理 -->
|
||||
<activity
|
||||
android:name=".ui.book.toc.rule.TxtTocRuleActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- 替换规则界面 -->
|
||||
<activity
|
||||
android:name=".ui.replace.ReplaceRuleActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- 书籍管理 -->
|
||||
<activity
|
||||
android:name=".ui.book.manage.BookshelfManageActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- 书源调试 -->
|
||||
<activity
|
||||
android:name=".ui.book.source.debug.BookSourceDebugActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- 目录 -->
|
||||
<activity
|
||||
android:name=".ui.book.toc.TocActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- 正文搜索 -->
|
||||
<activity
|
||||
android:name=".ui.book.searchContent.SearchContentActivity"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" />
|
||||
android:launchMode="singleTop" />
|
||||
<!-- RSS条目 -->
|
||||
<activity
|
||||
android:name=".ui.rss.article.RssSortActivity"
|
||||
|
||||
@@ -25,7 +25,6 @@ import io.legato.kazusa.utils.compress.ZipUtils
|
||||
import io.legato.kazusa.utils.fromJsonObject
|
||||
import io.legato.kazusa.utils.getPrefString
|
||||
import io.legato.kazusa.utils.isJson
|
||||
import io.legato.kazusa.utils.removePref
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import kotlinx.coroutines.ensureActive
|
||||
import kotlinx.coroutines.runBlocking
|
||||
@@ -166,7 +165,7 @@ object AppWebDav {
|
||||
val auth = Authorization(account, password)
|
||||
checkAuthorization(auth)
|
||||
|
||||
appCtx.toastOnUi("WebDAV 服务正常")
|
||||
appCtx.toastOnUi("WebDAV 服务可用")
|
||||
true
|
||||
}.getOrElse {
|
||||
it.printStackTrace()
|
||||
|
||||
@@ -13,7 +13,10 @@ data class AppReleaseInfo(
|
||||
val downloadUrl: String,
|
||||
val assetUrl: String
|
||||
) {
|
||||
val versionName: String = name.split("_").getOrNull(2)?.dropLast(2) ?: ""
|
||||
val versionName: String = Regex("""legado_app_([\d.]+)""")
|
||||
.find(name)
|
||||
?.groupValues?.get(1)
|
||||
?: ""
|
||||
}
|
||||
|
||||
enum class AppVariant {
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package io.legato.kazusa.ui.about
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.databinding.DialogUpdateBinding
|
||||
import io.legato.kazusa.help.update.AppUpdate
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import io.legato.kazusa.model.Download
|
||||
import io.legato.kazusa.utils.setLayout
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
import io.noties.markwon.Markwon
|
||||
@@ -17,7 +15,7 @@ import io.noties.markwon.ext.tables.TablePlugin
|
||||
import io.noties.markwon.html.HtmlPlugin
|
||||
import io.noties.markwon.image.glide.GlideImagesPlugin
|
||||
|
||||
class UpdateDialog() : BaseDialogFragment(R.layout.dialog_update) {
|
||||
class UpdateDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_update) {
|
||||
|
||||
constructor(updateInfo: AppUpdate.UpdateInfo) : this() {
|
||||
arguments = Bundle().apply {
|
||||
@@ -32,7 +30,6 @@ class UpdateDialog() : BaseDialogFragment(R.layout.dialog_update) {
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
@@ -57,8 +54,19 @@ class UpdateDialog() : BaseDialogFragment(R.layout.dialog_update) {
|
||||
when (it.itemId) {
|
||||
R.id.menu_download -> {
|
||||
val url = arguments?.getString("url")
|
||||
val name = arguments?.getString("name")
|
||||
if (url != null && name != null) {
|
||||
val baseName = arguments?.getString("name")
|
||||
?.removeSuffix(".apk")
|
||||
|
||||
val abi = Build.SUPPORTED_ABIS.firstOrNull() ?: "universal"
|
||||
val abiSuffix = when {
|
||||
abi.contains("arm64") -> "arm64-v8a"
|
||||
abi.contains("armeabi") -> "armeabi-v7a"
|
||||
else -> "universal"
|
||||
}
|
||||
|
||||
val name = "${baseName}_$abiSuffix.apk"
|
||||
|
||||
if (url != null && baseName != null) {
|
||||
Download.start(requireContext(), url, name)
|
||||
toastOnUi(R.string.download_start)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.appcompat.widget.Toolbar
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.base.adapter.ItemViewHolder
|
||||
import io.legato.kazusa.base.adapter.RecyclerAdapter
|
||||
import io.legato.kazusa.constant.PreferKey
|
||||
@@ -33,7 +33,7 @@ import splitties.views.onClick
|
||||
/**
|
||||
* 导入书源弹出窗口
|
||||
*/
|
||||
class ImportBookSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_view),
|
||||
class ImportBookSourceDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_recycler_view),
|
||||
Toolbar.OnMenuItemClickListener,
|
||||
CodeDialog.Callback {
|
||||
|
||||
@@ -50,7 +50,6 @@ class ImportBookSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_vie
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.graphics.drawable.GradientDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE
|
||||
import android.view.animation.AlphaAnimation
|
||||
import android.view.animation.Animation
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.SeekBar
|
||||
@@ -36,6 +37,7 @@ import io.legato.kazusa.utils.modifyBegin
|
||||
import io.legato.kazusa.utils.openUrl
|
||||
import io.legato.kazusa.utils.putPrefBoolean
|
||||
import io.legato.kazusa.utils.startActivity
|
||||
import io.legato.kazusa.utils.themeColor
|
||||
import io.legato.kazusa.utils.visible
|
||||
import splitties.views.onClick
|
||||
import splitties.views.onLongClick
|
||||
@@ -52,6 +54,7 @@ class ReadMenu @JvmOverloads constructor(
|
||||
private val binding = ViewReadMenuBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
private var confirmSkipToChapter: Boolean = false
|
||||
private var isMenuOutAnimating = false
|
||||
|
||||
private val menuTopIn: Animation by lazy {
|
||||
loadAnimation(context, R.anim.anim_readbook_top_in)
|
||||
}
|
||||
@@ -64,6 +67,17 @@ class ReadMenu @JvmOverloads constructor(
|
||||
private val menuBottomOut: Animation by lazy {
|
||||
loadAnimation(context, R.anim.anim_readbook_bottom_out)
|
||||
}
|
||||
|
||||
private val fadeIn = AlphaAnimation(0f, 1f).apply {
|
||||
duration = 280
|
||||
fillAfter = true
|
||||
}
|
||||
|
||||
private val fadeOut = AlphaAnimation(1f, 0f).apply {
|
||||
duration = 280
|
||||
fillAfter = true
|
||||
}
|
||||
|
||||
// private val immersiveMenu: Boolean
|
||||
// get() = AppConfig.readBarStyleFollowPage && ReadBookConfig.durConfig.curBgType() == 0
|
||||
// private var bgColor: Int = if (immersiveMenu) {
|
||||
@@ -84,11 +98,13 @@ class ReadMenu @JvmOverloads constructor(
|
||||
// .setPressedColor(ColorUtils.darkenColor(bgColor))
|
||||
// .create()
|
||||
private var onMenuOutEnd: (() -> Unit)? = null
|
||||
|
||||
private val showBrightnessView
|
||||
get() = context.getPrefBoolean(
|
||||
PreferKey.showBrightnessView,
|
||||
true
|
||||
)
|
||||
|
||||
private val sourceMenu by lazy {
|
||||
PopupMenu(context, binding.tvSourceAction).apply {
|
||||
inflate(R.menu.book_read_source)
|
||||
@@ -249,10 +265,10 @@ class ReadMenu @JvmOverloads constructor(
|
||||
|
||||
fun upBrightnessState() {
|
||||
if (brightnessAuto()) {
|
||||
//binding.ivBrightnessAuto.setColorFilter(context.accentColor)
|
||||
binding.ivBrightnessAuto.setColorFilter(context.themeColor(com.google.android.material.R.attr.colorPrimary))
|
||||
binding.seekBrightness.isEnabled = false
|
||||
} else {
|
||||
//binding.ivBrightnessAuto.setColorFilter(context.buttonDisabledColor)
|
||||
binding.ivBrightnessAuto.setColorFilter(context.themeColor(com.google.android.material.R.attr.colorOnSurface))
|
||||
binding.seekBrightness.isEnabled = true
|
||||
}
|
||||
setScreenBrightness(AppConfig.readBrightness.toFloat())
|
||||
@@ -283,6 +299,7 @@ class ReadMenu @JvmOverloads constructor(
|
||||
if (anim) {
|
||||
binding.titleBar.startAnimation(menuTopIn)
|
||||
binding.bottomMenu.startAnimation(menuBottomIn)
|
||||
updateBrightnessVisibility(true)
|
||||
} else {
|
||||
menuInListener.onAnimationStart(menuBottomIn)
|
||||
menuInListener.onAnimationEnd(menuBottomIn)
|
||||
@@ -299,6 +316,8 @@ class ReadMenu @JvmOverloads constructor(
|
||||
if (anim) {
|
||||
binding.titleBar.startAnimation(menuTopOut)
|
||||
binding.bottomMenu.startAnimation(menuBottomOut)
|
||||
updateBrightnessVisibility(false)
|
||||
|
||||
} else {
|
||||
menuOutListener.onAnimationStart(menuBottomOut)
|
||||
menuOutListener.onAnimationEnd(menuBottomOut)
|
||||
@@ -306,6 +325,16 @@ class ReadMenu @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateBrightnessVisibility(boolean: Boolean) {
|
||||
if (showBrightnessView) {
|
||||
if(boolean){
|
||||
binding.llBrightness.startAnimation(fadeIn)
|
||||
}else{
|
||||
binding.llBrightness.startAnimation(fadeOut)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun brightnessAuto(): Boolean {
|
||||
return context.getPrefBoolean("brightnessAuto", true) || !showBrightnessView
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@ import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.constant.EventBus
|
||||
import io.legato.kazusa.databinding.DialogReadPaddingBinding
|
||||
import io.legato.kazusa.help.config.ReadBookConfig
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
|
||||
class PaddingConfigDialog : BaseDialogFragment(R.layout.dialog_read_padding) {
|
||||
class PaddingConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_padding) {
|
||||
|
||||
private val binding by viewBinding(DialogReadPaddingBinding::bind)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.legato.kazusa.ui.book.read.config
|
||||
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -20,15 +19,11 @@ 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.ui.widget.DetailSeekBar
|
||||
import io.legato.kazusa.utils.ChineseUtils
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
import io.legato.kazusa.utils.showDialogFragment
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
import splitties.views.onLongClick
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.transition.TransitionManager
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import io.legato.kazusa.help.config.ThemeConfig
|
||||
|
||||
class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_style),
|
||||
@@ -38,8 +33,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
private val callBack get() = activity as? ReadBookActivity
|
||||
private lateinit var styleAdapter: StyleAdapter
|
||||
|
||||
private lateinit var allSliders: List<DetailSeekBar>
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
(activity as ReadBookActivity).bottomDialog++
|
||||
initView()
|
||||
@@ -158,22 +151,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(1, 2, 5))
|
||||
}
|
||||
|
||||
allSliders = listOf(
|
||||
dsbTextSize,
|
||||
dsbTextLetterSpacing,
|
||||
dsbLineSize,
|
||||
dsbParagraphSpacing
|
||||
)
|
||||
|
||||
allSliders.forEach { seekBar ->
|
||||
seekBar.onStartTracking = {
|
||||
setOnlyActiveSeekBarVisible(seekBar, true)
|
||||
}
|
||||
seekBar.onStopTracking = {
|
||||
setOnlyActiveSeekBarVisible(seekBar, false)
|
||||
}
|
||||
}
|
||||
|
||||
dsbTextSize.onChanged = {
|
||||
ReadBookConfig.textSize = it + 5
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||
@@ -192,24 +169,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
}
|
||||
}
|
||||
|
||||
private fun setOnlyActiveSeekBarVisible(activeSeekBar: DetailSeekBar, visible: Boolean) {
|
||||
TransitionManager.beginDelayedTransition(binding.rootView)
|
||||
if (visible) {
|
||||
binding.setBar.visibility = View.GONE
|
||||
binding.setBottomBar.visibility = View.GONE
|
||||
} else {
|
||||
binding.setBar.visibility = View.VISIBLE
|
||||
binding.setBottomBar.visibility = View.VISIBLE
|
||||
}
|
||||
allSliders.forEach { seekBar ->
|
||||
if (seekBar != activeSeekBar) {
|
||||
seekBar.visibility = if (visible) View.GONE else View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun changeBgTextConfig(index: Int) {
|
||||
val oldIndex = ReadBookConfig.styleSelect
|
||||
if (index != oldIndex) {
|
||||
|
||||
@@ -2,10 +2,9 @@ package io.legato.kazusa.ui.book.read.config
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.jaredrummler.android.colorpicker.ColorPickerDialog
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.constant.EventBus
|
||||
import io.legato.kazusa.databinding.DialogTipConfigBinding
|
||||
import io.legato.kazusa.help.config.ReadBookConfig
|
||||
@@ -16,11 +15,10 @@ import io.legato.kazusa.utils.getIndexById
|
||||
import io.legato.kazusa.utils.hexString
|
||||
import io.legato.kazusa.utils.observeEvent
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
import io.legato.kazusa.utils.setLayout
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
|
||||
|
||||
class TipConfigDialog : BaseDialogFragment(R.layout.dialog_tip_config) {
|
||||
class TipConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_tip_config) {
|
||||
|
||||
companion object {
|
||||
const val TIP_COLOR = 7897
|
||||
@@ -31,7 +29,6 @@ class TipConfigDialog : BaseDialogFragment(R.layout.dialog_tip_config) {
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package io.legato.kazusa.ui.config
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.text.InputType
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import androidx.core.view.MenuProvider
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
@@ -18,8 +15,6 @@ import androidx.preference.EditTextPreference
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.dialog.MaterialDialogs
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.constant.AppLog
|
||||
import io.legato.kazusa.constant.PreferKey
|
||||
@@ -39,12 +34,10 @@ import io.legato.kazusa.lib.dialogs.selector
|
||||
import io.legato.kazusa.lib.permission.Permissions
|
||||
import io.legato.kazusa.lib.permission.PermissionsCompat
|
||||
import io.legato.kazusa.lib.prefs.fragment.PreferenceFragment
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import io.legato.kazusa.ui.about.AppLogDialog
|
||||
import io.legato.kazusa.ui.file.HandleFileContract
|
||||
import io.legato.kazusa.ui.widget.dialog.WaitDialog
|
||||
import io.legato.kazusa.utils.FileDoc
|
||||
import io.legato.kazusa.utils.applyTint
|
||||
import io.legato.kazusa.utils.checkWrite
|
||||
import io.legato.kazusa.utils.getPrefString
|
||||
import io.legato.kazusa.utils.isContentScheme
|
||||
@@ -222,9 +215,6 @@ class BackupConfigFragment : PreferenceFragment(),
|
||||
}
|
||||
"web_dav_auth" -> {
|
||||
showWebDavAuthDialog()
|
||||
lifecycleScope.launch {
|
||||
testWebDav()
|
||||
}
|
||||
}
|
||||
"web_dav_backup" -> backup()
|
||||
"web_dav_restore" -> restore()
|
||||
@@ -254,6 +244,9 @@ class BackupConfigFragment : PreferenceFragment(),
|
||||
|
||||
upPreferenceSummary(PreferKey.webDavAccount, account)
|
||||
upPreferenceSummary(PreferKey.webDavPassword, password)
|
||||
lifecycleScope.launch {
|
||||
testWebDav()
|
||||
}
|
||||
}
|
||||
|
||||
cancelButton()
|
||||
|
||||
@@ -2,24 +2,16 @@ package io.legato.kazusa.ui.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.SeekBar
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.appcompat.widget.TooltipCompat
|
||||
import com.google.android.material.slider.Slider
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.databinding.ViewDetailSeekBarBinding
|
||||
//import io.legado.app.lib.theme.bottomBackground
|
||||
//import io.legado.app.lib.theme.getPrimaryTextColor
|
||||
import io.legato.kazusa.ui.widget.seekbar.SeekBarChangeListener
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
class DetailSeekBar @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -31,6 +23,11 @@ class DetailSeekBar @JvmOverloads constructor(
|
||||
private val isBottomBackground: Boolean
|
||||
|
||||
var valueFormat: ((progress: Int) -> String)? = null
|
||||
set(value) {
|
||||
field = value
|
||||
upValue()
|
||||
}
|
||||
|
||||
var onStartTracking: (() -> Unit)? = null
|
||||
var onChanged: ((progress: Int) -> Unit)? = null
|
||||
var onStopTracking: (() -> Unit)? = null
|
||||
@@ -39,7 +36,6 @@ class DetailSeekBar @JvmOverloads constructor(
|
||||
get() = binding.slider.value.toInt()
|
||||
set(value) {
|
||||
binding.slider.value = value.toFloat()
|
||||
upValue()
|
||||
}
|
||||
|
||||
var max: Int
|
||||
@@ -54,7 +50,6 @@ class DetailSeekBar @JvmOverloads constructor(
|
||||
typedArray.getBoolean(R.styleable.DetailSeekBar_isBottomBackground, false)
|
||||
val title = typedArray.getText(R.styleable.DetailSeekBar_title)
|
||||
|
||||
|
||||
binding.tvSeekTitle.apply {
|
||||
text = title
|
||||
TooltipCompat.setTooltipText(this, title)
|
||||
@@ -93,23 +88,6 @@ class DetailSeekBar @JvmOverloads constructor(
|
||||
}
|
||||
})
|
||||
|
||||
binding.slider.setOnTouchListener { _, event ->
|
||||
if (event.action == MotionEvent.ACTION_DOWN) {
|
||||
val slider = binding.slider
|
||||
val sliderWidth = slider.width - slider.paddingStart - slider.paddingEnd
|
||||
val touchX = event.x - slider.paddingStart
|
||||
|
||||
val proportion = (slider.value - slider.valueFrom) / (slider.valueTo - slider.valueFrom)
|
||||
val thumbCenterX = proportion * sliderWidth
|
||||
|
||||
val thumbRadiusPx = slider.thumbRadius * 2f // 可适当扩大滑块判断区域
|
||||
|
||||
val isTouchNearThumb = kotlin.math.abs(touchX - thumbCenterX) <= thumbRadiusPx
|
||||
return@setOnTouchListener !isTouchNearThumb // 拦截不是点在滑块上的点击
|
||||
}
|
||||
return@setOnTouchListener false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun upValue(progress: Int = binding.slider.value.toInt()) {
|
||||
@@ -124,4 +102,8 @@ class DetailSeekBar @JvmOverloads constructor(
|
||||
upValue(progress)
|
||||
}
|
||||
|
||||
fun setTitle(title: CharSequence?) {
|
||||
binding.tvSeekTitle.text = title
|
||||
TooltipCompat.setTooltipText(binding.tvSeekTitle, title)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package io.legato.kazusa.ui.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.widget.FrameLayout
|
||||
import androidx.appcompat.widget.TooltipCompat
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.databinding.ViewSimpleCounterBinding
|
||||
import io.legato.kazusa.lib.dialogs.alert
|
||||
|
||||
@SuppressLint("ViewConstructor", "ClickableViewAccessibility")
|
||||
class SimpleCounterView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
) : FrameLayout(context, attrs) {
|
||||
|
||||
private val binding = ViewSimpleCounterBinding.inflate(LayoutInflater.from(context), this)
|
||||
|
||||
private var _progress = 0
|
||||
private var _max = 100
|
||||
private val isBottomBackground: Boolean
|
||||
|
||||
var valueFormat: ((Int) -> String)? = null
|
||||
var onChanged: ((Int) -> Unit)? = null
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
private var isIncrementing = false
|
||||
private var isDecrementing = false
|
||||
|
||||
private val longPressDelay = 400L
|
||||
private val repeatInterval = 320L
|
||||
|
||||
|
||||
var progress: Int
|
||||
get() = _progress
|
||||
set(value) {
|
||||
_progress = value.coerceIn(0, _max)
|
||||
updateValue()
|
||||
}
|
||||
|
||||
var max: Int
|
||||
get() = _max
|
||||
set(value) {
|
||||
_max = value
|
||||
_progress = _progress.coerceAtMost(_max)
|
||||
updateValue()
|
||||
}
|
||||
|
||||
init {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.DetailSeekBar)
|
||||
isBottomBackground = typedArray.getBoolean(R.styleable.DetailSeekBar_isBottomBackground, false)
|
||||
val title = typedArray.getText(R.styleable.DetailSeekBar_title)
|
||||
_max = typedArray.getInt(R.styleable.DetailSeekBar_max, 100)
|
||||
typedArray.recycle()
|
||||
|
||||
binding.tvSeekTitle.text = title
|
||||
TooltipCompat.setTooltipText(binding.tvSeekTitle, title)
|
||||
|
||||
binding.ivSeekPlus.setOnClickListener {
|
||||
if (_progress < _max) {
|
||||
_progress++
|
||||
updateValue()
|
||||
onChanged?.invoke(_progress)
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivSeekReduce.setOnClickListener {
|
||||
if (_progress > 0) {
|
||||
_progress--
|
||||
updateValue()
|
||||
onChanged?.invoke(_progress)
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivSeekPlus.setOnTouchListener { _, event ->
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
isIncrementing = true
|
||||
handler.postDelayed(startIncrementRunnable, longPressDelay)
|
||||
}
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
|
||||
isIncrementing = false
|
||||
handler.removeCallbacks(startIncrementRunnable)
|
||||
handler.removeCallbacks(incrementRunnable)
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
binding.ivSeekReduce.setOnTouchListener { _, event ->
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
isDecrementing = true
|
||||
handler.postDelayed(startDecrementRunnable, longPressDelay)
|
||||
}
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
|
||||
isDecrementing = false
|
||||
handler.removeCallbacks(startDecrementRunnable)
|
||||
handler.removeCallbacks(decrementRunnable)
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
binding.tvSeekValue.setOnClickListener {
|
||||
showSeekBarDialog()
|
||||
}
|
||||
|
||||
updateValue()
|
||||
}
|
||||
|
||||
private fun showSeekBarDialog() {
|
||||
context.alert(title = null, message = null) {
|
||||
customView {
|
||||
val detailSeekBar = DetailSeekBar(ctx).apply {
|
||||
max = _max
|
||||
progress = _progress
|
||||
valueFormat = this@SimpleCounterView.valueFormat
|
||||
setTitle(binding.tvSeekTitle.text)
|
||||
onChanged = {
|
||||
_progress = it
|
||||
updateValue()
|
||||
this@SimpleCounterView.onChanged?.invoke(it)
|
||||
}
|
||||
}
|
||||
|
||||
FrameLayout(ctx).apply {
|
||||
setPadding(64, 0, 64, 0)
|
||||
addView(detailSeekBar, LayoutParams(
|
||||
LayoutParams.MATCH_PARENT,
|
||||
LayoutParams.WRAP_CONTENT
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
okButton()
|
||||
cancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun updateValue() {
|
||||
binding.tvSeekValue.text = valueFormat?.invoke(_progress) ?: _progress.toString()
|
||||
}
|
||||
|
||||
private val startIncrementRunnable = Runnable {
|
||||
handler.post(incrementRunnable)
|
||||
}
|
||||
|
||||
private val startDecrementRunnable = Runnable {
|
||||
handler.post(decrementRunnable)
|
||||
}
|
||||
|
||||
private val incrementRunnable = object : Runnable {
|
||||
override fun run() {
|
||||
if (_progress < _max) {
|
||||
_progress++
|
||||
updateValue()
|
||||
onChanged?.invoke(_progress)
|
||||
handler.postDelayed(this, repeatInterval)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val decrementRunnable = object : Runnable {
|
||||
override fun run() {
|
||||
if (_progress > 0) {
|
||||
_progress--
|
||||
updateValue()
|
||||
onChanged?.invoke(_progress)
|
||||
handler.postDelayed(this, repeatInterval)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
handler.removeCallbacks(incrementRunnable)
|
||||
handler.removeCallbacks(decrementRunnable)
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,15 +3,7 @@ package io.legato.kazusa.ui.widget.text
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import io.legato.kazusa.lib.theme.Selector
|
||||
import io.legato.kazusa.lib.theme.ThemeStore
|
||||
|
||||
class TextInputLayout(context: Context, attrs: AttributeSet?) : TextInputLayout(context, attrs) {
|
||||
|
||||
init {
|
||||
if (!isInEditMode) {
|
||||
defaultHintTextColor =
|
||||
Selector.colorBuild().setDefaultColor(ThemeStore.accentColor(context)).create()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:overScrollMode="ifContentScrolls">
|
||||
|
||||
<LinearLayout
|
||||
@@ -17,8 +16,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp">
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_add_group_title"
|
||||
@@ -38,7 +37,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/sw_add_group" />
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/sw_add_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -51,19 +50,20 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/text_input_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dp">
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.AutoCompleteTextView
|
||||
android:id="@+id/edit_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
||||
|
||||
</io.legato.kazusa.ui.widget.text.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="ifContentScrolls"
|
||||
@@ -10,13 +9,13 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.AutoCompleteTextView
|
||||
android:id="@+id/edit_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="16dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -41,8 +41,8 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_day_night"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_marginStart="8dp"
|
||||
app:icon="@drawable/ic_brightness"
|
||||
@@ -68,6 +68,7 @@
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="2"
|
||||
app:icon="@drawable/font_bold"
|
||||
app:iconGravity="textTop"
|
||||
android:text="@string/font_weight_text" />
|
||||
@@ -81,6 +82,7 @@
|
||||
android:id="@+id/tv_text_font"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="2"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
app:icon="@drawable/font_style"
|
||||
app:iconGravity="textTop"
|
||||
@@ -95,6 +97,7 @@
|
||||
android:id="@+id/tv_text_indent"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="2"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
app:icon="@drawable/ic_segment"
|
||||
app:iconGravity="textTop"
|
||||
@@ -109,6 +112,7 @@
|
||||
android:id="@+id/tv_padding"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="2"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
app:icon="@drawable/ic_padding"
|
||||
app:iconGravity="textTop"
|
||||
@@ -151,42 +155,64 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_text_size"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
app:isBottomBackground="true"
|
||||
app:max="45"
|
||||
app:title="@string/text_size" />
|
||||
android:layout_marginHorizontal="16dp">
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_text_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:isBottomBackground="true"
|
||||
app:max="45"
|
||||
app:title="@string/text_size" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_text_letter_spacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
app:isBottomBackground="true"
|
||||
app:max="100"
|
||||
app:title="@string/text_letter_spacing" />
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
<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:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginHorizontal="16dp">
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_line_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
app:isBottomBackground="true"
|
||||
app:max="20"
|
||||
app:title="@string/line_size" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
<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="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
app:isBottomBackground="true"
|
||||
app:max="20"
|
||||
app:title="@string/paragraph_size" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/set_bottom_bar"
|
||||
@@ -201,6 +227,7 @@
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/page_anim"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<HorizontalScrollView
|
||||
@@ -222,8 +249,7 @@
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/page_anim_cover"
|
||||
/>
|
||||
android:text="@string/page_anim_cover" />
|
||||
|
||||
<!-- 滑动动画 Chip -->
|
||||
<com.google.android.material.chip.Chip
|
||||
@@ -232,8 +258,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_slide"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
android:text="@string/page_anim_slide" />
|
||||
|
||||
<!-- 仿真翻页 Chip -->
|
||||
<com.google.android.material.chip.Chip
|
||||
@@ -242,8 +267,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_simulation"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
android:text="@string/page_anim_simulation" />
|
||||
|
||||
<!-- 滚动动画 Chip -->
|
||||
<com.google.android.material.chip.Chip
|
||||
@@ -252,8 +276,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_scroll"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
android:text="@string/page_anim_scroll" />
|
||||
|
||||
<!-- 无动画 Chip -->
|
||||
<com.google.android.material.chip.Chip
|
||||
@@ -262,8 +285,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:text="@string/page_anim_none"
|
||||
app:chipStrokeWidth="1dp" />
|
||||
android:text="@string/page_anim_none" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
</HorizontalScrollView>
|
||||
@@ -280,7 +302,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:alpha="0.75"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:text="@string/text_bg_style"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
@@ -8,7 +8,32 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="16dp"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<View
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/bg_bottom_sheet_handle"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="界面设置"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_header_padding"
|
||||
@@ -20,16 +45,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="10dp">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.AccentTextView
|
||||
android:id="@+id/tv_header_padding"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/header"
|
||||
android:textSize="18sp" />
|
||||
style="@style/ChapterNameText" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -39,38 +64,61 @@
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/cb_show_top_line"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="6dp" />
|
||||
android:layout_height="20dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_header_padding_top"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_top" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_header_padding_bottom"
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_header_padding_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_header_padding_left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_left" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_header_padding_right"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
<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_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -78,38 +126,62 @@
|
||||
android:id="@+id/tv_body_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/main_body"
|
||||
android:textSize="18sp" />
|
||||
style="@style/ChapterNameText" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_padding_top"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="200"
|
||||
app:title="@string/padding_top" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_padding_bottom"
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_padding_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_padding_left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_left" />
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_padding_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_left" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_padding_right"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
<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_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -121,10 +193,10 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/footer"
|
||||
android:textSize="18sp" />
|
||||
style="@style/ChapterNameText" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -139,33 +211,57 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_footer_padding_top"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_top" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_footer_padding_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_top" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||
android:id="@+id/dsb_footer_padding_left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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.DetailSeekBar
|
||||
android:id="@+id/dsb_footer_padding_right"
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_bottom" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<io.legato.kazusa.ui.widget.SimpleCounterView
|
||||
android:id="@+id/dsb_footer_padding_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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_height="wrap_content"
|
||||
app:max="100"
|
||||
app:title="@string/padding_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -9,13 +9,39 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="16dp"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<View
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/bg_bottom_sheet_handle"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="界面设置"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/body_title"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_title_mode"
|
||||
@@ -49,7 +75,6 @@
|
||||
android:id="@+id/dsb_title_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="3dp"
|
||||
app:max="10"
|
||||
app:title="@string/title_font_size" />
|
||||
|
||||
@@ -57,7 +82,6 @@
|
||||
android:id="@+id/dsb_title_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="3dp"
|
||||
app:max="100"
|
||||
app:title="@string/title_margin_top" />
|
||||
|
||||
@@ -65,7 +89,6 @@
|
||||
android:id="@+id/dsb_title_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="3dp"
|
||||
app:max="100"
|
||||
app:title="@string/title_margin_bottom" />
|
||||
|
||||
@@ -73,13 +96,16 @@
|
||||
android:id="@+id/tv_header_padding"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:text="@string/header"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_header_show"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -88,14 +114,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/show_hide" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_header_show"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/show_hide" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -104,6 +128,7 @@
|
||||
android:id="@+id/ll_header_left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -112,14 +137,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/left" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_header_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/title" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -128,6 +151,7 @@
|
||||
android:id="@+id/ll_header_middle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -136,14 +160,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/middle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_header_middle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/title" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -152,6 +174,7 @@
|
||||
android:id="@+id/ll_header_right"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -160,14 +183,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/right" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_header_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/title" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -175,13 +196,16 @@
|
||||
<io.legato.kazusa.ui.widget.text.AccentTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:text="@string/footer"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_footer_show"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -190,14 +214,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/show_hide" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_footer_show"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/show_hide" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -206,6 +228,7 @@
|
||||
android:id="@+id/ll_footer_left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -214,14 +237,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/left" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_footer_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/title" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -230,6 +251,7 @@
|
||||
android:id="@+id/ll_footer_middle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -238,14 +260,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/middle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_footer_middle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/title" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -254,6 +274,7 @@
|
||||
android:id="@+id/ll_footer_right"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -262,28 +283,29 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/right" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_footer_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/title" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.AccentTextView
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:text="@string/header_footer"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_tip_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -292,14 +314,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/text_color" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tip_color"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/text_color" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -308,6 +328,7 @@
|
||||
android:id="@+id/ll_tip_divider_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
@@ -316,14 +337,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="6dp"
|
||||
android:text="@string/tip_divider_color" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tip_divider_color"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
tools:text="@string/tip_divider_color" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -12,12 +12,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="4dp">
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_seek_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:singleLine="true"
|
||||
android:text="seek"
|
||||
tools:ignore="HardcodedText" />
|
||||
@@ -30,12 +32,14 @@
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@android:color/transparent">
|
||||
android:layout_marginEnd="4dp"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceVariant">
|
||||
<TextView
|
||||
android:id="@+id/tv_seek_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingHorizontal="12dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:singleLine="true"
|
||||
android:text="0" />
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSeekTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="标题"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorSecondary" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceVariant">
|
||||
<LinearLayout
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_seek_reduce"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
app:backgroundTint="?attr/colorSurfaceContainer"
|
||||
android:contentDescription="@string/reduce"
|
||||
app:icon="@drawable/ic_reduce"
|
||||
app:iconGravity="textStart"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSeekValue"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:text="16"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_seek_plus"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
app:backgroundTint="?attr/colorSurfaceContainer"
|
||||
android:contentDescription="@string/plus"
|
||||
app:icon="@drawable/ic_add"
|
||||
app:iconGravity="textStart"/>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_toast"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="10dp"/>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -74,9 +74,12 @@
|
||||
<attr name="speed" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<attr name="title" format="string" />
|
||||
<attr name="max" format="integer" />
|
||||
|
||||
<declare-styleable name="DetailSeekBar">
|
||||
<attr name="title" format="string" />
|
||||
<attr name="max" format="integer" />
|
||||
<attr name="title" />
|
||||
<attr name="max" />
|
||||
<attr name="isBottomBackground" />
|
||||
</declare-styleable>
|
||||
|
||||
@@ -236,4 +239,10 @@
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="SimpleCounterView">
|
||||
<attr name="title" />
|
||||
<attr name="max" />
|
||||
<attr name="min" format="integer" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user