更新界面
This commit is contained in:
+4
-2
@@ -49,7 +49,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "io.legato.kazusa"
|
applicationId "io.legato.kazusa"
|
||||||
minSdk 24
|
minSdk 26
|
||||||
targetSdk 35
|
targetSdk 35
|
||||||
versionCode 10000 + gitCommits
|
versionCode 10000 + gitCommits
|
||||||
versionName version
|
versionName version
|
||||||
@@ -81,7 +81,7 @@ android {
|
|||||||
signingConfig signingConfigs.myConfig
|
signingConfig signingConfigs.myConfig
|
||||||
}
|
}
|
||||||
//applicationIdSuffix '.release'
|
//applicationIdSuffix '.release'
|
||||||
manifestPlaceholders.put("app_name", "@string/app_name_a")
|
manifestPlaceholders.put("app_name", "@string/app_name")
|
||||||
|
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
shrinkResources true
|
shrinkResources true
|
||||||
@@ -104,6 +104,7 @@ android {
|
|||||||
abi {
|
abi {
|
||||||
enable true
|
enable true
|
||||||
reset()
|
reset()
|
||||||
|
//noinspection ChromeOsAbiSupport
|
||||||
include 'armeabi-v7a', 'arm64-v8a'
|
include 'armeabi-v7a', 'arm64-v8a'
|
||||||
universalApk true
|
universalApk true
|
||||||
}
|
}
|
||||||
@@ -306,4 +307,5 @@ dependencies {
|
|||||||
//epubLib集成到应用内
|
//epubLib集成到应用内
|
||||||
|
|
||||||
implementation libs.androidx.datastore.preferences
|
implementation libs.androidx.datastore.preferences
|
||||||
|
implementation libs.androidx.palette
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
android:name=".ui.main.MainActivity"
|
android:name=".ui.main.MainActivity"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
android:enableOnBackInvokedCallback="true"
|
android:enableOnBackInvokedCallback="true"
|
||||||
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
|
android:configChanges="locale|keyboardHidden|smallestScreenSize|screenLayout"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
<!-- 阅读界面 -->
|
<!-- 阅读界面 -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.book.read.ReadBookActivity"
|
android:name=".ui.book.read.ReadBookActivity"
|
||||||
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
|
android:configChanges="locale|keyboardHidden|smallestScreenSize|screenLayout"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class App : Application() {
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
DynamicColors.applyToActivitiesIfAvailable(this)
|
||||||
CrashHandler(this)
|
CrashHandler(this)
|
||||||
if (isDebuggable) {
|
if (isDebuggable) {
|
||||||
ThreadUtils.setThreadAssertsDisabledForTesting(true)
|
ThreadUtils.setThreadAssertsDisabledForTesting(true)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import android.view.MotionEvent
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
@@ -78,7 +79,7 @@ abstract class BaseActivity<VB : ViewBinding>(
|
|||||||
window.decorView.disableAutoFill()
|
window.decorView.disableAutoFill()
|
||||||
AppContextWrapper.applyLocaleAndFont(this)
|
AppContextWrapper.applyLocaleAndFont(this)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
//setupSystemBar()
|
//setupSystemBar()
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
upBackgroundImage()
|
upBackgroundImage()
|
||||||
@@ -90,9 +91,9 @@ abstract class BaseActivity<VB : ViewBinding>(
|
|||||||
onActivityCreated(savedInstanceState)
|
onActivityCreated(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean, newConfig: Configuration) {
|
override fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean, newConfig: Configuration) {
|
||||||
super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig)
|
super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig)
|
||||||
|
|
||||||
// findViewById<TitleBar>(R.id.title_bar)
|
// findViewById<TitleBar>(R.id.title_bar)
|
||||||
// ?.onMultiWindowModeChanged(isInMultiWindowMode, fullScreen)
|
// ?.onMultiWindowModeChanged(isInMultiWindowMode, fullScreen)
|
||||||
//setupSystemBar()
|
//setupSystemBar()
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ abstract class BaseFragment(@LayoutRes layoutID: Int) : Fragment(layoutID) {
|
|||||||
onMultiWindowModeChanged()
|
onMultiWindowModeChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
// override fun onConfigurationChanged(newConfig: Configuration) {
|
||||||
super.onConfigurationChanged(newConfig)
|
// super.onConfigurationChanged(newConfig)
|
||||||
onMultiWindowModeChanged()
|
// onMultiWindowModeChanged()
|
||||||
}
|
// }
|
||||||
|
|
||||||
private fun onMultiWindowModeChanged() {
|
private fun onMultiWindowModeChanged() {
|
||||||
// (activity as? BaseActivity<*>)?.let {
|
// (activity as? BaseActivity<*>)?.let {
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ object PreferKey {
|
|||||||
const val enableReview = "enableReview"
|
const val enableReview = "enableReview"
|
||||||
const val showRss = "showRss"
|
const val showRss = "showRss"
|
||||||
const val bookshelfLayout = "bookshelfLayout"
|
const val bookshelfLayout = "bookshelfLayout"
|
||||||
|
const val bookshelfLayoutPortrait = "bookshelfLayoutPortrait"
|
||||||
|
const val bookshelfLayoutLandscape = "bookshelf_layout_landscape"
|
||||||
const val bookshelfSort = "bookshelfSort"
|
const val bookshelfSort = "bookshelfSort"
|
||||||
const val bookExportFileName = "bookExportFileName"
|
const val bookExportFileName = "bookExportFileName"
|
||||||
const val bookImportFileName = "bookImportFileName"
|
const val bookImportFileName = "bookImportFileName"
|
||||||
|
|||||||
@@ -159,12 +159,19 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
appCtx.putPrefInt(PreferKey.bookGroupStyle, value)
|
appCtx.putPrefInt(PreferKey.bookGroupStyle, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
var bookshelfLayout: Int
|
var bookshelfLayoutPortrait: Int
|
||||||
get() = appCtx.getPrefInt(PreferKey.bookshelfLayout, 0)
|
get() = appCtx.getPrefInt(PreferKey.bookshelfLayoutPortrait, 3)
|
||||||
set(value) {
|
set(value) {
|
||||||
appCtx.putPrefInt(PreferKey.bookshelfLayout, value)
|
appCtx.putPrefInt(PreferKey.bookshelfLayoutPortrait, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var bookshelfLayoutLandscape: Int
|
||||||
|
get() = appCtx.getPrefInt(PreferKey.bookshelfLayoutLandscape, 5)
|
||||||
|
set(value) {
|
||||||
|
appCtx.putPrefInt(PreferKey.bookshelfLayoutLandscape, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var saveTabPosition: Int
|
var saveTabPosition: Int
|
||||||
get() = appCtx.getPrefInt(PreferKey.saveTabPosition, 0)
|
get() = appCtx.getPrefInt(PreferKey.saveTabPosition, 0)
|
||||||
set(value) {
|
set(value) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import io.legato.kazusa.utils.isContentScheme
|
|||||||
import io.legato.kazusa.utils.isDataUrl
|
import io.legato.kazusa.utils.isDataUrl
|
||||||
import io.legato.kazusa.utils.lifecycle
|
import io.legato.kazusa.utils.lifecycle
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
|
||||||
//https://bumptech.github.io/glide/doc/generatedapi.html
|
//https://bumptech.github.io/glide/doc/generatedapi.html
|
||||||
//Instead of GlideApp, use com.bumptech.Glide
|
//Instead of GlideApp, use com.bumptech.Glide
|
||||||
@@ -28,7 +29,7 @@ object ImageLoader {
|
|||||||
path.isNullOrEmpty() -> Glide.with(context).load(path)
|
path.isNullOrEmpty() -> Glide.with(context).load(path)
|
||||||
path.isDataUrl() -> Glide.with(context).load(path)
|
path.isDataUrl() -> Glide.with(context).load(path)
|
||||||
path.isAbsUrl() -> Glide.with(context).load(path)
|
path.isAbsUrl() -> Glide.with(context).load(path)
|
||||||
path.isContentScheme() -> Glide.with(context).load(Uri.parse(path))
|
path.isContentScheme() -> Glide.with(context).load(path.toUri())
|
||||||
else -> kotlin.runCatching {
|
else -> kotlin.runCatching {
|
||||||
Glide.with(context).load(File(path))
|
Glide.with(context).load(File(path))
|
||||||
}.getOrElse {
|
}.getOrElse {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import androidx.activity.result.contract.ActivityResultContracts
|
|||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.constant.AppLog
|
import io.legato.kazusa.constant.AppLog
|
||||||
import io.legato.kazusa.exception.NoStackTraceException
|
import io.legato.kazusa.exception.NoStackTraceException
|
||||||
@@ -195,7 +196,7 @@ class PermissionActivity : AppCompatActivity() {
|
|||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rationaleDialog = AlertDialog.Builder(this)
|
rationaleDialog = MaterialAlertDialogBuilder(this)
|
||||||
.setTitle(R.string.dialog_title)
|
.setTitle(R.string.dialog_title)
|
||||||
.setMessage(rationale)
|
.setMessage(rationale)
|
||||||
.setPositiveButton(R.string.dialog_setting) { _, _ ->
|
.setPositiveButton(R.string.dialog_setting) { _, _ ->
|
||||||
|
|||||||
@@ -22,18 +22,6 @@ private constructor(private val mContext: Context) : ThemeStoreInterface {
|
|||||||
|
|
||||||
private val mEditor = prefs(mContext).edit()
|
private val mEditor = prefs(mContext).edit()
|
||||||
|
|
||||||
// override fun enableDynamicColors(context: Context, enable: Boolean): ThemeStore {
|
|
||||||
// mEditor.putBoolean(ThemeStorePrefKeys.KEY_DYNAMIC_COLORS_ENABLED, enable)
|
|
||||||
// if (enable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
||||||
// // 使用系统动态颜色
|
|
||||||
// val dynamicColors = DynamicColorsOptions.Builder()
|
|
||||||
// .setThemeOverlay(R.style.Theme_App_Dynamic)
|
|
||||||
// .build()
|
|
||||||
// DynamicColors.applyToActivitiesIfAvailable(context.applicationContext, dynamicColors)
|
|
||||||
// }
|
|
||||||
// return this
|
|
||||||
// }
|
|
||||||
|
|
||||||
override fun primaryColor(@ColorInt color: Int): ThemeStore {
|
override fun primaryColor(@ColorInt color: Int): ThemeStore {
|
||||||
mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_COLOR, color)
|
mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_COLOR, color)
|
||||||
if (autoGeneratePrimaryDark(mContext))
|
if (autoGeneratePrimaryDark(mContext))
|
||||||
|
|||||||
@@ -18,22 +18,6 @@ class ThemeBottomNavigationVIew(context: Context, attrs: AttributeSet) :
|
|||||||
BottomNavigationView(context, attrs) {
|
BottomNavigationView(context, attrs) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// val bgColor = context.bottomBackground
|
|
||||||
// setBackgroundColor(bgColor)
|
|
||||||
// val textIsDark = ColorUtils.isColorLight(bgColor)
|
|
||||||
// val textColor = context.getSecondaryTextColor(textIsDark)
|
|
||||||
//
|
|
||||||
// val colorStateList = Selector.colorBuild()
|
|
||||||
// .setDefaultColor(textColor)
|
|
||||||
// .setSelectedColor(ThemeStore.accentColor(context)).create()
|
|
||||||
// itemIconTintList = colorStateList
|
|
||||||
// itemTextColor = colorStateList
|
|
||||||
|
|
||||||
if (AppConfig.isEInkMode) {
|
|
||||||
isItemHorizontalTranslationEnabled = false
|
|
||||||
itemBackground = Color.TRANSPARENT.toDrawable()
|
|
||||||
}
|
|
||||||
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(this, null)
|
ViewCompat.setOnApplyWindowInsetsListener(this, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ object BookCover {
|
|||||||
}.getOrDefault(appCtx.resources.getDrawable(R.drawable.image_cover_default, null))
|
}.getOrDefault(appCtx.resources.getDrawable(R.drawable.image_cover_default, null))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载封面
|
* 加载封面
|
||||||
*/
|
*/
|
||||||
@@ -127,6 +128,8 @@ object BookCover {
|
|||||||
.centerCrop()
|
.centerCrop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载漫画图片
|
* 加载漫画图片
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class OpenUrlConfirmDialog() : BaseDialogFragment(R.layout.dialog_open_url_confi
|
|||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
binding.toolBar.inflateMenu(R.menu.open_url_confirm)
|
binding.toolBar.inflateMenu(R.menu.open_url_confirm)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initView() {
|
private fun initView() {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class VerificationCodeDialog() : BaseDialogFragment(R.layout.dialog_verification
|
|||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
binding.toolBar.inflateMenu(R.menu.verification_code)
|
binding.toolBar.inflateMenu(R.menu.verification_code)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ class BookmarkDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_bookmark)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
val bookmark = arguments.getParcelable<Bookmark>("bookmark")
|
val bookmark = arguments.getParcelable<Bookmark>("bookmark")
|
||||||
bookmark ?: let {
|
bookmark ?: let {
|
||||||
dismiss()
|
dismiss()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val editPos = arguments.getInt("editPos", -1)
|
val editPos = arguments.getInt("editPos", -1)
|
||||||
binding.btnDelete.visible(editPos >= 0) // 替换 tvFooterLeft
|
binding.btnDelete.visible(editPos >= 0)
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
tvChapterName.text = bookmark.chapterName
|
tvChapterName.text = bookmark.chapterName
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
|
|||||||
|
|
||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.inflateMenu(R.menu.change_cover)
|
binding.toolBar.inflateMenu(R.menu.change_cover)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
|
|||||||
item.setTitle(R.string.refresh)
|
item.setTitle(R.string.refresh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -140,7 +140,7 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
|
|||||||
|
|
||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.inflateMenu(R.menu.change_source)
|
binding.toolBar.inflateMenu(R.menu.change_source)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
binding.toolBar.menu.findItem(R.id.menu_check_author)
|
binding.toolBar.menu.findItem(R.id.menu_check_author)
|
||||||
?.isChecked = AppConfig.changeSourceCheckAuthor
|
?.isChecked = AppConfig.changeSourceCheckAuthor
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class GroupManageDialog : BaseBottomSheetDialogFragment(R.layout.dialog_recycler
|
|||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
binding.toolBar.inflateMenu(R.menu.book_group_manage)
|
binding.toolBar.inflateMenu(R.menu.book_group_manage)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuItemClick(item: MenuItem?): Boolean {
|
override fun onMenuItemClick(item: MenuItem?): Boolean {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class GroupSelectDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_book_g
|
|||||||
private fun initView() {
|
private fun initView() {
|
||||||
binding.toolBar.title = getString(R.string.group_select)
|
binding.toolBar.title = getString(R.string.group_select)
|
||||||
binding.toolBar.inflateMenu(R.menu.book_group_manage)
|
binding.toolBar.inflateMenu(R.menu.book_group_manage)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
||||||
binding.recyclerView.addItemDecoration(VerticalDivider(requireContext()))
|
binding.recyclerView.addItemDecoration(VerticalDivider(requireContext()))
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class ServerConfigDialog() : BaseDialogFragment(R.layout.dialog_webdav_server, t
|
|||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
//inding.toolBar.setBackgroundColor(primaryColor)
|
//inding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.inflateMenu(R.menu.server_config)
|
binding.toolBar.inflateMenu(R.menu.server_config)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
viewModel.init(arguments?.getLong("id")) {
|
viewModel.init(arguments?.getLong("id")) {
|
||||||
upConfigView(viewModel.mServer)
|
upConfigView(viewModel.mServer)
|
||||||
|
|||||||
@@ -2,19 +2,28 @@ package io.legato.kazusa.ui.book.info
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.Color
|
||||||
import android.graphics.RenderEffect
|
import android.graphics.RenderEffect
|
||||||
import android.graphics.Shader
|
import android.graphics.Shader
|
||||||
|
import android.graphics.drawable.BitmapDrawable
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
import android.widget.CheckBox
|
import android.widget.CheckBox
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.palette.graphics.Palette
|
||||||
|
import com.google.android.material.button.MaterialButton
|
||||||
|
import com.google.android.material.color.utilities.Hct
|
||||||
|
import com.google.android.material.color.utilities.SchemeTonalSpot
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.VMBaseActivity
|
import io.legato.kazusa.base.VMBaseActivity
|
||||||
import io.legato.kazusa.constant.BookType
|
import io.legato.kazusa.constant.BookType
|
||||||
@@ -75,6 +84,7 @@ import io.legato.kazusa.utils.startActivity
|
|||||||
import io.legato.kazusa.utils.toastOnUi
|
import io.legato.kazusa.utils.toastOnUi
|
||||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||||
import io.legato.kazusa.utils.visible
|
import io.legato.kazusa.utils.visible
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Dispatchers.IO
|
import kotlinx.coroutines.Dispatchers.IO
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -161,12 +171,10 @@ class BookInfoActivity :
|
|||||||
// binding.llInfo.setBackgroundColor(backgroundColor)
|
// binding.llInfo.setBackgroundColor(backgroundColor)
|
||||||
// binding.flAction.setBackgroundColor(bottomBackground)
|
// binding.flAction.setBackgroundColor(bottomBackground)
|
||||||
//binding.flAction.applyNavigationBarPadding()
|
//binding.flAction.applyNavigationBarPadding()
|
||||||
binding.btnShelf?.text = getString(R.string.remove_from_bookshelf)
|
binding.btnShelf.text = getString(R.string.remove_from_bookshelf)
|
||||||
binding.tvToc.text = getString(R.string.toc_s, getString(R.string.loading))
|
binding.tvToc.text = getString(R.string.toc_s, getString(R.string.loading))
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
binding.tvDetail.revealOnFocusHint = false
|
||||||
binding.tvDetail?.let { it.revealOnFocusHint = false }
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.bookData.observe(this) { showBook(it) }
|
viewModel.bookData.observe(this) { showBook(it) }
|
||||||
viewModel.chapterListData.observe(this) { upLoading(false, it) }
|
viewModel.chapterListData.observe(this) { upLoading(false, it) }
|
||||||
@@ -340,8 +348,8 @@ class BookInfoActivity :
|
|||||||
tvAuthor.text = getString(R.string.author_show, book.getRealAuthor())
|
tvAuthor.text = getString(R.string.author_show, book.getRealAuthor())
|
||||||
tvOrigin.text = getString(R.string.origin_show, book.originName)
|
tvOrigin.text = getString(R.string.origin_show, book.originName)
|
||||||
tvLasted.text = getString(R.string.lasted_show, book.latestChapterTitle)
|
tvLasted.text = getString(R.string.lasted_show, book.latestChapterTitle)
|
||||||
tvDetail?.let { it.text = book.getDisplayIntro() }
|
tvDetail.let { it.text = book.getDisplayIntro() }
|
||||||
llToc?.visible(!book.isWebFile)
|
llToc.visible(!book.isWebFile)
|
||||||
upTvBookshelf()
|
upTvBookshelf()
|
||||||
upKinds(book)
|
upKinds(book)
|
||||||
upGroup(book.group)
|
upGroup(book.group)
|
||||||
@@ -412,10 +420,10 @@ class BookInfoActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun upTvBookshelf() {
|
private fun upTvBookshelf() {
|
||||||
binding.btnShelf?.apply {
|
binding.btnShelf.apply {
|
||||||
if (viewModel.inBookshelf) {
|
if (viewModel.inBookshelf) {
|
||||||
text = getString(R.string.remove_from_bookshelf)
|
text = getString(R.string.remove_from_bookshelf)
|
||||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_clear_all)
|
icon = ContextCompat.getDrawable(context, R.drawable.ic_star_fill)
|
||||||
} else {
|
} else {
|
||||||
text = getString(R.string.add_to_bookshelf)
|
text = getString(R.string.add_to_bookshelf)
|
||||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_star)
|
icon = ContextCompat.getDrawable(context, R.drawable.ic_star)
|
||||||
@@ -427,13 +435,15 @@ class BookInfoActivity :
|
|||||||
private fun upGroup(groupId: Long) {
|
private fun upGroup(groupId: Long) {
|
||||||
viewModel.loadGroup(groupId) {
|
viewModel.loadGroup(groupId) {
|
||||||
if (it.isNullOrEmpty()) {
|
if (it.isNullOrEmpty()) {
|
||||||
binding.tvGroup.text = if (book?.isLocal == true) {
|
binding.tvChangeGroup.text = if (book?.isLocal == true) {
|
||||||
getString(R.string.group_s, getString(R.string.local_no_group))
|
getString(R.string.local_no_group)
|
||||||
} else {
|
} else {
|
||||||
getString(R.string.group_s, getString(R.string.no_group))
|
getString(R.string.no_group)
|
||||||
}
|
}
|
||||||
|
binding.tvChangeGroup.setIconResource(R.drawable.ic_groups)
|
||||||
} else {
|
} else {
|
||||||
binding.tvGroup.text = getString(R.string.group_s, it)
|
binding.tvChangeGroup.text = getString(R.string.group_s, it)
|
||||||
|
binding.tvChangeGroup.setIconResource(R.drawable.ic_groups_fill)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -452,7 +462,7 @@ class BookInfoActivity :
|
|||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
btnRead?.setOnClickListener {
|
btnRead.setOnClickListener {
|
||||||
viewModel.getBook()?.let { book ->
|
viewModel.getBook()?.let { book ->
|
||||||
if (book.isWebFile) {
|
if (book.isWebFile) {
|
||||||
showWebFileDownloadAlert {
|
showWebFileDownloadAlert {
|
||||||
@@ -463,7 +473,7 @@ class BookInfoActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
btnShelf?.setOnClickListener {
|
btnShelf.setOnClickListener {
|
||||||
viewModel.getBook()?.let { book ->
|
viewModel.getBook()?.let { book ->
|
||||||
if (viewModel.inBookshelf) {
|
if (viewModel.inBookshelf) {
|
||||||
deleteBook()
|
deleteBook()
|
||||||
@@ -490,7 +500,7 @@ class BookInfoActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
btnChangeSource?.setOnClickListener {
|
btnChangeSource.setOnClickListener {
|
||||||
viewModel.getBook()?.let { book ->
|
viewModel.getBook()?.let { book ->
|
||||||
showDialogFragment(ChangeBookSourceDialog(book.name, book.author))
|
showDialogFragment(ChangeBookSourceDialog(book.name, book.author))
|
||||||
}
|
}
|
||||||
@@ -533,7 +543,7 @@ class BookInfoActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
refreshLayout?.setOnRefreshListener {
|
refreshLayout.setOnRefreshListener {
|
||||||
refreshLayout.isRefreshing = false
|
refreshLayout.isRefreshing = false
|
||||||
refreshBook()
|
refreshBook()
|
||||||
}
|
}
|
||||||
@@ -784,4 +794,16 @@ class BookInfoActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 扩展函数:从Drawable中提取主色调
|
||||||
|
suspend fun Drawable.extractDominantColor(): Int = withContext(Dispatchers.Default) {
|
||||||
|
// 将Drawable转换为Bitmap
|
||||||
|
val bitmap = (this@extractDominantColor as? BitmapDrawable)?.bitmap ?: return@withContext Color.TRANSPARENT
|
||||||
|
|
||||||
|
// 生成Palette
|
||||||
|
val palette = Palette.from(bitmap).generate()
|
||||||
|
|
||||||
|
// 返回主色调,若未找到则使用默认值
|
||||||
|
palette.getDominantColor(Color.WHITE)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ class SourcePickerDialog : BaseDialogFragment(R.layout.dialog_source_picker),
|
|||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
toolBar.setOnMenuItemClickListener(this)
|
toolBar.setOnMenuItemClickListener(this)
|
||||||
toolBar.inflateMenu(R.menu.source_picker)
|
toolBar.inflateMenu(R.menu.source_picker)
|
||||||
toolBar.menu.applyTint(requireContext())
|
//toolBar.menu.applyTint(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuItemClick(item: MenuItem?): Boolean {
|
override fun onMenuItemClick(item: MenuItem?): Boolean {
|
||||||
|
|||||||
@@ -121,9 +121,9 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangaBinding, ReadMangaViewMode
|
|||||||
|
|
||||||
private val loadMoreView by lazy {
|
private val loadMoreView by lazy {
|
||||||
LoadMoreView(this).apply {
|
LoadMoreView(this).apply {
|
||||||
setBackgroundColor(getCompatColor(R.color.book_ant_10))
|
// setBackgroundColor(getCompatColor(R.color.book_ant_10))
|
||||||
setLoadingColor(R.color.white)
|
// setLoadingColor(R.color.white)
|
||||||
setLoadingTextColor(R.color.white)
|
// setLoadingTextColor(R.color.white)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class ContentEditDialog : BaseDialogFragment(R.layout.dialog_content_edit) {
|
|||||||
|
|
||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.inflateMenu(R.menu.content_edit)
|
binding.toolBar.inflateMenu(R.menu.content_edit)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener {
|
binding.toolBar.setOnMenuItemClickListener {
|
||||||
when (it.itemId) {
|
when (it.itemId) {
|
||||||
R.id.menu_save -> {
|
R.id.menu_save -> {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import io.legato.kazusa.data.entities.Book
|
|||||||
import io.legato.kazusa.data.entities.BookChapter
|
import io.legato.kazusa.data.entities.BookChapter
|
||||||
import io.legato.kazusa.data.entities.BookProgress
|
import io.legato.kazusa.data.entities.BookProgress
|
||||||
import io.legato.kazusa.data.entities.BookSource
|
import io.legato.kazusa.data.entities.BookSource
|
||||||
|
import io.legato.kazusa.data.entities.ReplaceRule
|
||||||
import io.legato.kazusa.exception.NoStackTraceException
|
import io.legato.kazusa.exception.NoStackTraceException
|
||||||
import io.legato.kazusa.help.AppWebDav
|
import io.legato.kazusa.help.AppWebDav
|
||||||
import io.legato.kazusa.help.IntentData
|
import io.legato.kazusa.help.IntentData
|
||||||
@@ -508,6 +509,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
R.id.menu_setting_replace -> openReplaceRule()
|
||||||
R.id.menu_download -> showDownloadDialog()
|
R.id.menu_download -> showDownloadDialog()
|
||||||
R.id.menu_add_bookmark -> addBookmark()
|
R.id.menu_add_bookmark -> addBookmark()
|
||||||
R.id.menu_simulated_reading -> showSimulatedReading()
|
R.id.menu_simulated_reading -> showSimulatedReading()
|
||||||
@@ -1203,19 +1205,23 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
/**
|
/**
|
||||||
* 显示阅读样式配置
|
* 显示阅读样式配置
|
||||||
*/
|
*/
|
||||||
override fun showReadStyle() {
|
// override fun showReadStyle() {
|
||||||
|
// showDialogFragment<ReadStyleDialog>()
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 显示更多设置
|
||||||
|
// */
|
||||||
|
// override fun showMoreSetting() {
|
||||||
|
// showDialogFragment<MoreConfigDialog>()
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
override fun showSearchSetting() {
|
||||||
showDialogFragment<ReadStyleDialog>()
|
showDialogFragment<ReadStyleDialog>()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
override fun showReadStyle() {
|
||||||
* 显示更多设置
|
showDialogFragment<ReadStyleDialog>()
|
||||||
*/
|
|
||||||
override fun showMoreSetting() {
|
|
||||||
showDialogFragment<MoreConfigDialog>()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showSearchSetting() {
|
|
||||||
showDialogFragment<MoreConfigDialog>()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import io.legato.kazusa.lib.dialogs.alert
|
|||||||
//import io.legado.app.lib.theme.primaryColor
|
//import io.legado.app.lib.theme.primaryColor
|
||||||
//import io.legado.app.lib.theme.primaryTextColor
|
//import io.legado.app.lib.theme.primaryTextColor
|
||||||
import io.legato.kazusa.model.ReadBook
|
import io.legato.kazusa.model.ReadBook
|
||||||
|
import io.legato.kazusa.ui.book.read.config.MoreConfigDialog
|
||||||
import io.legato.kazusa.ui.browser.WebViewActivity
|
import io.legato.kazusa.ui.browser.WebViewActivity
|
||||||
import io.legato.kazusa.ui.widget.seekbar.SeekBarChangeListener
|
import io.legato.kazusa.ui.widget.seekbar.SeekBarChangeListener
|
||||||
import io.legato.kazusa.utils.ConstraintModify
|
import io.legato.kazusa.utils.ConstraintModify
|
||||||
@@ -44,6 +45,7 @@ import io.legato.kazusa.utils.loadAnimation
|
|||||||
import io.legato.kazusa.utils.modifyBegin
|
import io.legato.kazusa.utils.modifyBegin
|
||||||
import io.legato.kazusa.utils.openUrl
|
import io.legato.kazusa.utils.openUrl
|
||||||
import io.legato.kazusa.utils.putPrefBoolean
|
import io.legato.kazusa.utils.putPrefBoolean
|
||||||
|
import io.legato.kazusa.utils.showDialogFragment
|
||||||
import io.legato.kazusa.utils.startActivity
|
import io.legato.kazusa.utils.startActivity
|
||||||
import io.legato.kazusa.utils.visible
|
import io.legato.kazusa.utils.visible
|
||||||
import splitties.views.onClick
|
import splitties.views.onClick
|
||||||
@@ -159,11 +161,11 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initView(reset: Boolean = false) = binding.run {
|
private fun initView(reset: Boolean = false) = binding.run {
|
||||||
if (AppConfig.isNightTheme) {
|
// if (AppConfig.isNightTheme) {
|
||||||
fabNightTheme.setImageResource(R.drawable.ic_daytime)
|
// fabNightTheme.setIconResource(R.drawable.ic_daytime)
|
||||||
} else {
|
// } else {
|
||||||
fabNightTheme.setImageResource(R.drawable.ic_brightness)
|
// fabNightTheme.setIconResource(R.drawable.ic_brightness)
|
||||||
}
|
// }
|
||||||
initAnimation()
|
initAnimation()
|
||||||
if (immersiveMenu) {
|
if (immersiveMenu) {
|
||||||
// val lightTextColor = ColorUtils.withAlpha(ColorUtils.lightenColor(textColor), 0.75f)
|
// val lightTextColor = ColorUtils.withAlpha(ColorUtils.lightenColor(textColor), 0.75f)
|
||||||
@@ -223,7 +225,7 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
/**
|
/**
|
||||||
* 确保视图不被导航栏遮挡
|
* 确保视图不被导航栏遮挡
|
||||||
*/
|
*/
|
||||||
applyNavigationBarPadding()
|
binding.bottomView.applyNavigationBarPadding()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun reset() {
|
fun reset() {
|
||||||
@@ -361,8 +363,6 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
tvChapterName.setOnClickListener(chapterViewClickListener)
|
tvChapterName.setOnClickListener(chapterViewClickListener)
|
||||||
tvChapterName.setOnLongClickListener(chapterViewLongClickListener)
|
tvChapterName.setOnLongClickListener(chapterViewLongClickListener)
|
||||||
tvChapterUrl.setOnClickListener(chapterViewClickListener)
|
|
||||||
tvChapterUrl.setOnLongClickListener(chapterViewLongClickListener)
|
|
||||||
//书源操作
|
//书源操作
|
||||||
tvSourceAction.onClick {
|
tvSourceAction.onClick {
|
||||||
sourceMenu.menu.findItem(R.id.menu_login).isVisible =
|
sourceMenu.menu.findItem(R.id.menu_login).isVisible =
|
||||||
@@ -446,13 +446,13 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
//替换
|
//替换
|
||||||
fabReplaceRule.setOnClickListener { callBack.openReplaceRule() }
|
//fabReplaceRule.setOnClickListener { callBack.openReplaceRule() }
|
||||||
|
|
||||||
//夜间模式
|
//夜间模式
|
||||||
fabNightTheme.setOnClickListener {
|
// fabNightTheme.setOnClickListener {
|
||||||
AppConfig.isNightTheme = !AppConfig.isNightTheme
|
// AppConfig.isNightTheme = !AppConfig.isNightTheme
|
||||||
ThemeConfig.applyDayNight(context)
|
// ThemeConfig.applyDayNight(context)
|
||||||
}
|
// }
|
||||||
|
|
||||||
//上一章
|
//上一章
|
||||||
tvPre.setOnClickListener { ReadBook.moveToPrevChapter(upContent = true, toLast = false) }
|
tvPre.setOnClickListener { ReadBook.moveToPrevChapter(upContent = true, toLast = false) }
|
||||||
@@ -461,37 +461,31 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
tvNext.setOnClickListener { ReadBook.moveToNextChapter(true) }
|
tvNext.setOnClickListener { ReadBook.moveToNextChapter(true) }
|
||||||
|
|
||||||
//目录
|
//目录
|
||||||
llCatalog.setOnClickListener {
|
ivCatalog.setOnClickListener {
|
||||||
runMenuOut {
|
runMenuOut {
|
||||||
callBack.openChapterList()
|
callBack.openChapterList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//朗读
|
//朗读
|
||||||
llReadAloud.setOnClickListener {
|
ivReadAloud.setOnClickListener {
|
||||||
runMenuOut {
|
runMenuOut {
|
||||||
callBack.onClickReadAloud()
|
callBack.onClickReadAloud()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
llReadAloud.onLongClick {
|
|
||||||
|
ivReadAloud.onLongClick {
|
||||||
runMenuOut {
|
runMenuOut {
|
||||||
callBack.showReadAloudDialog()
|
callBack.showReadAloudDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//界面
|
//设置
|
||||||
llFont.setOnClickListener {
|
ivSetting.setOnClickListener {
|
||||||
runMenuOut {
|
runMenuOut {
|
||||||
callBack.showReadStyle()
|
callBack.showReadStyle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置
|
|
||||||
llSetting.setOnClickListener {
|
|
||||||
runMenuOut {
|
|
||||||
callBack.showMoreSetting()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initAnimation() {
|
private fun initAnimation() {
|
||||||
@@ -500,13 +494,13 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun upBookView() {
|
fun upBookView() {
|
||||||
binding.titleBar.title = ReadBook.book?.name
|
binding.titleBar.title = " "
|
||||||
|
binding.tvBookName.text = ReadBook.book?.name
|
||||||
ReadBook.curTextChapter?.let {
|
ReadBook.curTextChapter?.let {
|
||||||
binding.tvChapterName.text = it.title
|
binding.tvChapterName.text = it.title
|
||||||
binding.tvChapterName.visible()
|
|
||||||
if (!ReadBook.isLocalBook) {
|
if (!ReadBook.isLocalBook) {
|
||||||
binding.tvChapterUrl.text = it.chapter.getAbsoluteURL()
|
binding.tvChapterUrl.text = it.chapter.getAbsoluteURL()
|
||||||
binding.tvChapterUrl.visible()
|
//binding.tvChapterUrl.visible()
|
||||||
} else {
|
} else {
|
||||||
binding.tvChapterUrl.gone()
|
binding.tvChapterUrl.gone()
|
||||||
}
|
}
|
||||||
@@ -514,7 +508,6 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
binding.tvPre.isEnabled = ReadBook.durChapterIndex != 0
|
binding.tvPre.isEnabled = ReadBook.durChapterIndex != 0
|
||||||
binding.tvNext.isEnabled = ReadBook.durChapterIndex != ReadBook.simulatedChapterSize - 1
|
binding.tvNext.isEnabled = ReadBook.durChapterIndex != ReadBook.simulatedChapterSize - 1
|
||||||
} ?: let {
|
} ?: let {
|
||||||
binding.tvChapterName.gone()
|
|
||||||
binding.tvChapterUrl.gone()
|
binding.tvChapterUrl.gone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -526,20 +519,16 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
when (AppConfig.progressBarBehavior) {
|
when (AppConfig.progressBarBehavior) {
|
||||||
"page" -> {
|
"page" -> {
|
||||||
ReadBook.curTextChapter?.let { chapter ->
|
ReadBook.curTextChapter?.let { chapter ->
|
||||||
if (chapter.pageSize > 0 && ReadBook.durPageIndex > 0) {
|
if (chapter.pageSize >= 0 && ReadBook.durPageIndex >= 0) {
|
||||||
valueFrom = 1f
|
valueFrom = 1f
|
||||||
valueTo = chapter.pageSize.toFloat().coerceAtLeast(2f)
|
valueTo = chapter.pageSize.toFloat().coerceAtLeast(2f)
|
||||||
value = (ReadBook.durPageIndex).coerceIn(1, chapter.pageSize).toFloat()
|
|
||||||
stepSize = 1f
|
stepSize = 1f
|
||||||
|
value = (ReadBook.durPageIndex).coerceIn(1, chapter.pageSize).toFloat()
|
||||||
} else {
|
} else {
|
||||||
valueFrom = 1f
|
value = 0f
|
||||||
valueTo = 2f
|
valueFrom = 0f
|
||||||
value = 1f
|
valueTo = 1000f
|
||||||
}
|
}
|
||||||
}?: run {
|
|
||||||
valueFrom = 1f
|
|
||||||
valueTo = 2f
|
|
||||||
value = 1f
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,12 +537,12 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
{
|
{
|
||||||
valueFrom = 1f
|
valueFrom = 1f
|
||||||
valueTo = ReadBook.simulatedChapterSize.toFloat().coerceAtLeast(2f)
|
valueTo = ReadBook.simulatedChapterSize.toFloat().coerceAtLeast(2f)
|
||||||
value = (ReadBook.durChapterIndex).coerceIn(1, ReadBook.simulatedChapterSize).toFloat()
|
|
||||||
stepSize = 1f
|
stepSize = 1f
|
||||||
|
value = (ReadBook.durChapterIndex).coerceIn(1, ReadBook.simulatedChapterSize).toFloat()
|
||||||
} else {
|
} else {
|
||||||
valueFrom = 1f
|
valueFrom = 0f
|
||||||
valueTo = 2f
|
value = 0f
|
||||||
value = 1f
|
valueTo = 1000f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -579,15 +568,15 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
fun setSeekPage(seek: Int) {
|
fun setSeekPage(seek: Int) {
|
||||||
binding.seekReadPage.value = 1f
|
binding.seekReadPage.value = seek.toFloat() + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setAutoPage(autoPage: Boolean) = binding.run {
|
fun setAutoPage(autoPage: Boolean) = binding.run {
|
||||||
if (autoPage) {
|
if (autoPage) {
|
||||||
fabAutoPage.setImageResource(R.drawable.ic_auto_page_stop)
|
fabAutoPage.setIconResource(R.drawable.ic_auto_page_stop)
|
||||||
fabAutoPage.contentDescription = context.getString(R.string.auto_next_page_stop)
|
fabAutoPage.contentDescription = context.getString(R.string.auto_next_page_stop)
|
||||||
} else {
|
} else {
|
||||||
fabAutoPage.setImageResource(R.drawable.ic_auto_page)
|
fabAutoPage.setIconResource(R.drawable.ic_auto_page)
|
||||||
fabAutoPage.contentDescription = context.getString(R.string.auto_next_page)
|
fabAutoPage.contentDescription = context.getString(R.string.auto_next_page)
|
||||||
}
|
}
|
||||||
//fabAutoPage.setColorFilter(textColor)
|
//fabAutoPage.setColorFilter(textColor)
|
||||||
@@ -615,7 +604,6 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
fun openSourceEditActivity()
|
fun openSourceEditActivity()
|
||||||
fun openBookInfoActivity()
|
fun openBookInfoActivity()
|
||||||
fun showReadStyle()
|
fun showReadStyle()
|
||||||
fun showMoreSetting()
|
|
||||||
fun showReadAloudDialog()
|
fun showReadAloudDialog()
|
||||||
fun upSystemUiVisibility()
|
fun upSystemUiVisibility()
|
||||||
fun onClickReadAloud()
|
fun onClickReadAloud()
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class HttpTtsEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_http_t
|
|||||||
|
|
||||||
fun initMenu() {
|
fun initMenu() {
|
||||||
binding.toolBar.inflateMenu(R.menu.speak_engine_edit)
|
binding.toolBar.inflateMenu(R.menu.speak_engine_edit)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import android.view.ViewConfiguration
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.BasePrefDialogFragment
|
import io.legato.kazusa.base.BasePrefDialogFragment
|
||||||
import io.legato.kazusa.constant.EventBus
|
import io.legato.kazusa.constant.EventBus
|
||||||
@@ -31,20 +32,6 @@ import io.legato.kazusa.utils.removePref
|
|||||||
class MoreConfigDialog : BasePrefDialogFragment() {
|
class MoreConfigDialog : BasePrefDialogFragment() {
|
||||||
private val readPreferTag = "readPreferenceFragment"
|
private val readPreferTag = "readPreferenceFragment"
|
||||||
|
|
||||||
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, 360.dpToPx())
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
@@ -67,12 +54,7 @@ class MoreConfigDialog : BasePrefDialogFragment() {
|
|||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDismiss(dialog: DialogInterface) {
|
class ReadPreferenceFragment : PreferenceFragmentCompat(),
|
||||||
super.onDismiss(dialog)
|
|
||||||
(activity as ReadBookActivity).bottomDialog--
|
|
||||||
}
|
|
||||||
|
|
||||||
class ReadPreferenceFragment : PreferenceFragment(),
|
|
||||||
SharedPreferences.OnSharedPreferenceChangeListener {
|
SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
private val slopSquare by lazy { ViewConfiguration.get(requireContext()).scaledTouchSlop }
|
private val slopSquare by lazy { ViewConfiguration.get(requireContext()).scaledTouchSlop }
|
||||||
@@ -198,6 +180,5 @@ class MoreConfigDialog : BasePrefDialogFragment() {
|
|||||||
getString(R.string.page_touch_slop_summary, value)
|
getString(R.string.page_touch_slop_summary, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@ import splitties.views.onLongClick
|
|||||||
import androidx.core.graphics.drawable.toDrawable
|
import androidx.core.graphics.drawable.toDrawable
|
||||||
import androidx.transition.TransitionManager
|
import androidx.transition.TransitionManager
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
|
import io.legato.kazusa.help.config.ThemeConfig
|
||||||
|
|
||||||
class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_style),
|
class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_style),
|
||||||
FontSelectDialog.CallBack {
|
FontSelectDialog.CallBack {
|
||||||
@@ -39,21 +40,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
|||||||
|
|
||||||
private lateinit var allSliders: List<DetailSeekBar>
|
private lateinit var allSliders: List<DetailSeekBar>
|
||||||
|
|
||||||
|
|
||||||
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)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
(activity as ReadBookActivity).bottomDialog++
|
(activity as ReadBookActivity).bottomDialog++
|
||||||
initView()
|
initView()
|
||||||
@@ -75,6 +61,11 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
|||||||
// tvPageAnim.setTextColor(textColor)
|
// tvPageAnim.setTextColor(textColor)
|
||||||
// tvBgTs.setTextColor(textColor)
|
// tvBgTs.setTextColor(textColor)
|
||||||
// tvShareLayout.setTextColor(textColor)
|
// tvShareLayout.setTextColor(textColor)
|
||||||
|
if (AppConfig.isNightTheme) {
|
||||||
|
tvDayNight.setIconResource(R.drawable.ic_daytime)
|
||||||
|
} else {
|
||||||
|
tvDayNight.setIconResource(R.drawable.ic_brightness)
|
||||||
|
}
|
||||||
dsbTextSize.valueFormat = {
|
dsbTextSize.valueFormat = {
|
||||||
(it + 5).toString()
|
(it + 5).toString()
|
||||||
}
|
}
|
||||||
@@ -133,6 +124,13 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
|||||||
tvTip.setOnClickListener {
|
tvTip.setOnClickListener {
|
||||||
TipConfigDialog().show(childFragmentManager, "tipConfigDialog")
|
TipConfigDialog().show(childFragmentManager, "tipConfigDialog")
|
||||||
}
|
}
|
||||||
|
tvMore.setOnClickListener {
|
||||||
|
showDialogFragment<MoreConfigDialog>()
|
||||||
|
}
|
||||||
|
tvDayNight.setOnClickListener {
|
||||||
|
AppConfig.isNightTheme = !AppConfig.isNightTheme
|
||||||
|
ThemeConfig.applyDayNight(requireContext())
|
||||||
|
}
|
||||||
// rgPageAnim.setOnCheckedChangeListener { _, checkedId ->
|
// rgPageAnim.setOnCheckedChangeListener { _, checkedId ->
|
||||||
// ReadBook.book?.setPageAnim(-1)
|
// ReadBook.book?.setPageAnim(-1)
|
||||||
// ReadBookConfig.pageAnim = binding.rgPageAnim.getIndexById(checkedId)
|
// ReadBookConfig.pageAnim = binding.rgPageAnim.getIndexById(checkedId)
|
||||||
@@ -299,6 +297,5 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ class SpeakEngineDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_recycl
|
|||||||
|
|
||||||
private fun initMenu() = binding.run {
|
private fun initMenu() = binding.run {
|
||||||
toolBar.inflateMenu(R.menu.speak_engine)
|
toolBar.inflateMenu(R.menu.speak_engine)
|
||||||
toolBar.menu.applyTint(requireContext())
|
//toolBar.menu.applyTint(requireContext())
|
||||||
toolBar.setOnMenuItemClickListener(this@SpeakEngineDialog)
|
toolBar.setOnMenuItemClickListener(this@SpeakEngineDialog)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import io.legato.kazusa.utils.applyStatusBarPadding
|
|||||||
import io.legato.kazusa.utils.dpToPx
|
import io.legato.kazusa.utils.dpToPx
|
||||||
import io.legato.kazusa.utils.gone
|
import io.legato.kazusa.utils.gone
|
||||||
import io.legato.kazusa.utils.setTextIfNotEqual
|
import io.legato.kazusa.utils.setTextIfNotEqual
|
||||||
|
import io.legato.kazusa.utils.statusBarHeight
|
||||||
import splitties.views.backgroundColor
|
import splitties.views.backgroundColor
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
@@ -59,12 +60,10 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (!isInEditMode) {
|
|
||||||
upStyle()
|
upStyle()
|
||||||
binding.vwStatusBar.applyStatusBarPadding()
|
binding.vwStatusBar.applyStatusBarPadding()
|
||||||
binding.vwNavigationBar.applyNavigationBarPadding()
|
binding.vwNavigationBar.applyNavigationBarPadding()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||||
super.onSizeChanged(w, h, oldw, oldh)
|
super.onSizeChanged(w, h, oldw, oldh)
|
||||||
@@ -118,8 +117,8 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
* 显示状态栏时隐藏header
|
* 显示状态栏时隐藏header
|
||||||
*/
|
*/
|
||||||
fun upStatusBar() = with(binding.vwStatusBar) {
|
fun upStatusBar() = with(binding.vwStatusBar) {
|
||||||
// setPadding(paddingLeft, context.statusBarHeight, paddingRight, paddingBottom)
|
setPadding(paddingLeft, context.statusBarHeight, paddingRight, paddingBottom)
|
||||||
isGone = ReadBookConfig.hideStatusBar || readBookActivity?.isInMultiWindow == true
|
isGone = ReadBookConfig.hideStatusBar
|
||||||
}
|
}
|
||||||
|
|
||||||
fun upNavigationBar() {
|
fun upNavigationBar() {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
|||||||
|
|
||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.inflateMenu(R.menu.book_search_scope)
|
binding.toolBar.inflateMenu(R.menu.book_search_scope)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initSearchView() {
|
private fun initSearchView() {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class GroupManageDialog : BaseDialogFragment(R.layout.dialog_recycler_view),
|
|||||||
// binding.toolBar.setBackgroundColor(primaryColor)
|
// binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.title = getString(R.string.group_manage)
|
binding.toolBar.title = getString(R.string.group_manage)
|
||||||
binding.toolBar.inflateMenu(R.menu.group_manage)
|
binding.toolBar.inflateMenu(R.menu.group_manage)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
||||||
binding.recyclerView.addItemDecoration(VerticalDivider(requireContext()))
|
binding.recyclerView.addItemDecoration(VerticalDivider(requireContext()))
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class TxtTocRuleDialog() : BaseDialogFragment(R.layout.dialog_toc_regex),
|
|||||||
durRegex = arguments?.getString("tocRegex")
|
durRegex = arguments?.getString("tocRegex")
|
||||||
binding.toolBar.setTitle(R.string.txt_toc_rule)
|
binding.toolBar.setTitle(R.string.txt_toc_rule)
|
||||||
binding.toolBar.inflateMenu(R.menu.txt_toc_rule)
|
binding.toolBar.inflateMenu(R.menu.txt_toc_rule)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
initView()
|
initView()
|
||||||
initData()
|
initData()
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class TxtTocRuleEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_toc
|
|||||||
|
|
||||||
private fun initMenu() {
|
private fun initMenu() {
|
||||||
binding.toolBar.inflateMenu(R.menu.txt_toc_rule_edit)
|
binding.toolBar.inflateMenu(R.menu.txt_toc_rule_edit)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class DictRuleEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_dict_
|
|||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.inflateMenu(R.menu.dict_rule_edit)
|
binding.toolBar.inflateMenu(R.menu.dict_rule_edit)
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
//binding.toolBar.menu.applyTint(requireContext())
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
binding.toolBar.setOnMenuItemClickListener(this)
|
||||||
viewModel.initData(arguments?.getString("name")) {
|
viewModel.initData(arguments?.getString("name")) {
|
||||||
upRuleView(viewModel.dictRule)
|
upRuleView(viewModel.dictRule)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.documentfile.provider.DocumentFile
|
|||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
|
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||||
import io.legato.kazusa.base.BaseDialogFragment
|
import io.legato.kazusa.base.BaseDialogFragment
|
||||||
import io.legato.kazusa.constant.AppLog
|
import io.legato.kazusa.constant.AppLog
|
||||||
import io.legato.kazusa.constant.PreferKey
|
import io.legato.kazusa.constant.PreferKey
|
||||||
@@ -36,11 +37,12 @@ import io.legato.kazusa.utils.toastOnUi
|
|||||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字体选择对话框
|
* 字体选择对话框
|
||||||
*/
|
*/
|
||||||
class FontSelectDialog : BaseDialogFragment(R.layout.dialog_font_select),
|
class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_select),
|
||||||
Toolbar.OnMenuItemClickListener,
|
Toolbar.OnMenuItemClickListener,
|
||||||
FontAdapter.CallBack {
|
FontAdapter.CallBack {
|
||||||
private val fontRegex = Regex("(?i).*\\.[ot]tf")
|
private val fontRegex = Regex("(?i).*\\.[ot]tf")
|
||||||
@@ -70,11 +72,6 @@ class FontSelectDialog : BaseDialogFragment(R.layout.dialog_font_select),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
|
||||||
super.onStart()
|
|
||||||
setLayout(0.9f, 0.9f)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.setTitle(R.string.select_font)
|
binding.toolBar.setTitle(R.string.select_font)
|
||||||
@@ -89,7 +86,7 @@ class FontSelectDialog : BaseDialogFragment(R.layout.dialog_font_select),
|
|||||||
openFolder()
|
openFolder()
|
||||||
} else {
|
} else {
|
||||||
if (fontPath.isContentScheme()) {
|
if (fontPath.isContentScheme()) {
|
||||||
val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath))
|
val doc = DocumentFile.fromTreeUri(requireContext(), fontPath.toUri())
|
||||||
if (doc?.canRead() == true) {
|
if (doc?.canRead() == true) {
|
||||||
loadFontFiles(FileDoc.fromDocumentFile(doc))
|
loadFontFiles(FileDoc.fromDocumentFile(doc))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
package io.legato.kazusa.ui.main
|
package io.legato.kazusa.ui.main
|
||||||
|
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.format.DateUtils
|
import android.text.format.DateUtils
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.core.view.postDelayed
|
import androidx.core.view.postDelayed
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
@@ -57,7 +59,10 @@ import splitties.views.bottomPadding
|
|||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
|
import com.google.android.material.navigation.NavigationBarView
|
||||||
import io.legato.kazusa.ui.welcome.WelcomeActivity
|
import io.legato.kazusa.ui.welcome.WelcomeActivity
|
||||||
|
import io.legato.kazusa.utils.applyNavigationBarPadding
|
||||||
|
import io.legato.kazusa.utils.applyStatusBarPadding
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主界面
|
* 主界面
|
||||||
@@ -84,10 +89,12 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
private val adapter by lazy {
|
private val adapter by lazy {
|
||||||
TabFragmentPageAdapter(supportFragmentManager)
|
TabFragmentPageAdapter(supportFragmentManager)
|
||||||
}
|
}
|
||||||
private val onUpBooksBadgeView by lazy {
|
|
||||||
binding.bottomNavigationView.addBadgeView(0)
|
private val badge by lazy {
|
||||||
|
getNavigationBarView().getOrCreateBadge(R.id.menu_bookshelf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
upBottomMenu()
|
upBottomMenu()
|
||||||
initView()
|
initView()
|
||||||
@@ -197,13 +204,18 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
viewPagerMain.adapter = adapter
|
viewPagerMain.adapter = adapter
|
||||||
viewPagerMain.addOnPageChangeListener(PageChangeCallback())
|
viewPagerMain.addOnPageChangeListener(PageChangeCallback())
|
||||||
//bottomNavigationView.elevation = elevation
|
//bottomNavigationView.elevation = elevation
|
||||||
bottomNavigationView.setOnNavigationItemSelectedListener(this@MainActivity)
|
getNavigationBarView().apply {
|
||||||
bottomNavigationView.setOnNavigationItemReselectedListener(this@MainActivity)
|
setOnItemSelectedListener { onNavigationItemSelected(it) }
|
||||||
bottomNavigationView.setOnApplyWindowInsetsListenerCompat { view, windowInsets ->
|
setOnItemReselectedListener { onNavigationItemReselected(it) }
|
||||||
val height = windowInsets.navigationBarHeight
|
|
||||||
view.bottomPadding = height
|
|
||||||
windowInsets.inset(0, 0, 0, height)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//getNavigationBarView().applyNavigationBarPadding()
|
||||||
|
|
||||||
|
// bottomNavigationView.setOnApplyWindowInsetsListenerCompat { view, windowInsets ->
|
||||||
|
// val height = windowInsets.navigationBarHeight
|
||||||
|
// view.bottomPadding = height
|
||||||
|
// windowInsets.inset(0, 0, 0, height)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -344,8 +356,10 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
override fun observeLiveBus() {
|
override fun observeLiveBus() {
|
||||||
super.observeLiveBus()
|
super.observeLiveBus()
|
||||||
viewModel.onUpBooksLiveData.observe(this) {
|
viewModel.onUpBooksLiveData.observe(this) {
|
||||||
onUpBooksBadgeView.setBadgeCount(it)
|
badge.isVisible = it > 0
|
||||||
|
badge.number = it
|
||||||
}
|
}
|
||||||
|
|
||||||
observeEvent<Boolean>(EventBus.NOTIFY_MAIN) {
|
observeEvent<Boolean>(EventBus.NOTIFY_MAIN) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
upBottomMenu()
|
upBottomMenu()
|
||||||
@@ -359,13 +373,24 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getNavigationBarView(): NavigationBarView {
|
||||||
|
return findViewById(
|
||||||
|
if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT)
|
||||||
|
R.id.bottom_navigation_view
|
||||||
|
else
|
||||||
|
R.id.navigation_rail_view
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun upBottomMenu() {
|
private fun upBottomMenu() {
|
||||||
|
|
||||||
val showDiscovery = AppConfig.showDiscovery
|
val showDiscovery = AppConfig.showDiscovery
|
||||||
val showRss = AppConfig.showRSS
|
val showRss = AppConfig.showRSS
|
||||||
binding.bottomNavigationView.menu.let { menu ->
|
val menu = getNavigationBarView().menu
|
||||||
menu.findItem(R.id.menu_discovery).isVisible = showDiscovery
|
menu.findItem(R.id.menu_discovery).isVisible = showDiscovery
|
||||||
menu.findItem(R.id.menu_rss).isVisible = showRss
|
menu.findItem(R.id.menu_rss).isVisible = showRss
|
||||||
}
|
|
||||||
var index = 0
|
var index = 0
|
||||||
if (showDiscovery) {
|
if (showDiscovery) {
|
||||||
index++
|
index++
|
||||||
@@ -408,8 +433,9 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
|||||||
|
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
pagePosition = position
|
pagePosition = position
|
||||||
binding.bottomNavigationView.menu[realPositions[position]].isChecked = true
|
getNavigationBarView().menu[realPositions[position]].isChecked = true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package io.legato.kazusa.ui.main.bookshelf
|
package io.legato.kazusa.ui.main.bookshelf
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
@@ -28,6 +30,7 @@ import io.legato.kazusa.ui.file.HandleFileContract
|
|||||||
import io.legato.kazusa.ui.main.MainFragmentInterface
|
import io.legato.kazusa.ui.main.MainFragmentInterface
|
||||||
import io.legato.kazusa.ui.main.MainViewModel
|
import io.legato.kazusa.ui.main.MainViewModel
|
||||||
import io.legato.kazusa.ui.widget.dialog.WaitDialog
|
import io.legato.kazusa.ui.widget.dialog.WaitDialog
|
||||||
|
import io.legato.kazusa.utils.bookshelfLayout
|
||||||
import io.legato.kazusa.utils.checkByIndex
|
import io.legato.kazusa.utils.checkByIndex
|
||||||
import io.legato.kazusa.utils.getCheckedIndex
|
import io.legato.kazusa.utils.getCheckedIndex
|
||||||
import io.legato.kazusa.utils.isAbsUrl
|
import io.legato.kazusa.utils.isAbsUrl
|
||||||
@@ -164,7 +167,17 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
|||||||
@SuppressLint("InflateParams")
|
@SuppressLint("InflateParams")
|
||||||
fun configBookshelf() {
|
fun configBookshelf() {
|
||||||
alert(titleResource = R.string.bookshelf_layout) {
|
alert(titleResource = R.string.bookshelf_layout) {
|
||||||
val bookshelfLayout = AppConfig.bookshelfLayout
|
|
||||||
|
val orientation = requireContext().resources.configuration.orientation
|
||||||
|
val bookshelfLayout = if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
AppConfig.bookshelfLayoutLandscape
|
||||||
|
} else {
|
||||||
|
AppConfig.bookshelfLayoutPortrait
|
||||||
|
}
|
||||||
|
|
||||||
|
val isGrid = bookshelfLayout > 0
|
||||||
|
val columnCount = (bookshelfLayout.takeIf { it > 0 } ?: 1)
|
||||||
|
|
||||||
val bookshelfSort = AppConfig.bookshelfSort
|
val bookshelfSort = AppConfig.bookshelfSort
|
||||||
val alertBinding =
|
val alertBinding =
|
||||||
DialogBookshelfConfigBinding.inflate(layoutInflater)
|
DialogBookshelfConfigBinding.inflate(layoutInflater)
|
||||||
@@ -174,10 +187,20 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
|||||||
swShowLastUpdateTime.isChecked = AppConfig.showLastUpdateTime
|
swShowLastUpdateTime.isChecked = AppConfig.showLastUpdateTime
|
||||||
swShowWaitUpBooks.isChecked = AppConfig.showWaitUpCount
|
swShowWaitUpBooks.isChecked = AppConfig.showWaitUpCount
|
||||||
swShowBookshelfFastScroller.isChecked = AppConfig.showBookshelfFastScroller
|
swShowBookshelfFastScroller.isChecked = AppConfig.showBookshelfFastScroller
|
||||||
rgLayout.checkByIndex(bookshelfLayout)
|
|
||||||
rgSort.checkByIndex(bookshelfSort)
|
rgSort.checkByIndex(bookshelfSort)
|
||||||
|
|
||||||
|
chipList.isChecked = !isGrid
|
||||||
|
chipGrid.isChecked = isGrid
|
||||||
|
llGridSlider.isVisible = isGrid
|
||||||
|
sliderGridCount.value = columnCount.toFloat()
|
||||||
|
|
||||||
|
chipGroupLayout.setOnCheckedChangeListener { _, checkedId ->
|
||||||
|
llGridSlider.isVisible = checkedId == R.id.chip_grid
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
customView { alertBinding.root }
|
customView { alertBinding.root }
|
||||||
|
|
||||||
okButton {
|
okButton {
|
||||||
alertBinding.apply {
|
alertBinding.apply {
|
||||||
var notifyMain = false
|
var notifyMain = false
|
||||||
@@ -206,15 +229,30 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
|||||||
AppConfig.bookshelfSort = rgSort.getCheckedIndex()
|
AppConfig.bookshelfSort = rgSort.getCheckedIndex()
|
||||||
upSort()
|
upSort()
|
||||||
}
|
}
|
||||||
if (bookshelfLayout != rgLayout.getCheckedIndex()) {
|
|
||||||
AppConfig.bookshelfLayout = rgLayout.getCheckedIndex()
|
val isNowGrid = alertBinding.chipGrid.isChecked
|
||||||
if (AppConfig.bookshelfLayout == 0) {
|
val selectedColumn = alertBinding.sliderGridCount.value.toInt()
|
||||||
|
val newLayout = if (isNowGrid) selectedColumn else 0
|
||||||
|
|
||||||
|
if (bookshelfLayout != newLayout) {
|
||||||
|
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
AppConfig.bookshelfLayoutLandscape = newLayout
|
||||||
|
if (newLayout == 0) {
|
||||||
activityViewModel.booksGridRecycledViewPool.clear()
|
activityViewModel.booksGridRecycledViewPool.clear()
|
||||||
} else {
|
} else {
|
||||||
activityViewModel.booksListRecycledViewPool.clear()
|
activityViewModel.booksListRecycledViewPool.clear()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
AppConfig.bookshelfLayoutPortrait = newLayout
|
||||||
|
if (newLayout == 0) {
|
||||||
|
activityViewModel.booksGridRecycledViewPool.clear()
|
||||||
|
} else {
|
||||||
|
activityViewModel.booksListRecycledViewPool.clear()
|
||||||
|
}
|
||||||
|
}
|
||||||
recreate = true
|
recreate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recreate) {
|
if (recreate) {
|
||||||
postEvent(EventBus.RECREATE, "")
|
postEvent(EventBus.RECREATE, "")
|
||||||
} else if (notifyMain) {
|
} else if (notifyMain) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package io.legato.kazusa.ui.main.bookshelf.style1.books
|
package io.legato.kazusa.ui.main.bookshelf.style1.books
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewConfiguration
|
import android.view.ViewConfiguration
|
||||||
@@ -27,6 +28,7 @@ import io.legato.kazusa.help.config.AppConfig
|
|||||||
//import io.legado.app.lib.theme.primaryColor
|
//import io.legado.app.lib.theme.primaryColor
|
||||||
import io.legato.kazusa.ui.book.info.BookInfoActivity
|
import io.legato.kazusa.ui.book.info.BookInfoActivity
|
||||||
import io.legato.kazusa.ui.main.MainViewModel
|
import io.legato.kazusa.ui.main.MainViewModel
|
||||||
|
import io.legato.kazusa.utils.bookshelfLayout
|
||||||
import io.legato.kazusa.utils.cnCompare
|
import io.legato.kazusa.utils.cnCompare
|
||||||
import io.legato.kazusa.utils.flowWithLifecycleAndDatabaseChangeFirst
|
import io.legato.kazusa.utils.flowWithLifecycleAndDatabaseChangeFirst
|
||||||
import io.legato.kazusa.utils.observeEvent
|
import io.legato.kazusa.utils.observeEvent
|
||||||
@@ -61,7 +63,10 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
|
|
||||||
private val binding by viewBinding(FragmentBooksBinding::bind)
|
private val binding by viewBinding(FragmentBooksBinding::bind)
|
||||||
private val activityViewModel by activityViewModels<MainViewModel>()
|
private val activityViewModel by activityViewModels<MainViewModel>()
|
||||||
private val bookshelfLayout by lazy { AppConfig.bookshelfLayout }
|
|
||||||
|
private val bookshelfLayout by lazy { requireContext().bookshelfLayout }
|
||||||
|
|
||||||
|
|
||||||
private val booksAdapter: BaseBooksAdapter<*> by lazy {
|
private val booksAdapter: BaseBooksAdapter<*> by lazy {
|
||||||
if (bookshelfLayout == 0) {
|
if (bookshelfLayout == 0) {
|
||||||
BooksAdapterList(requireContext(), this, this, viewLifecycleOwner.lifecycle)
|
BooksAdapterList(requireContext(), this, this, viewLifecycleOwner.lifecycle)
|
||||||
@@ -102,7 +107,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
if (bookshelfLayout == 0) {
|
if (bookshelfLayout == 0) {
|
||||||
binding.rvBookshelf.layoutManager = LinearLayoutManager(context)
|
binding.rvBookshelf.layoutManager = LinearLayoutManager(context)
|
||||||
} else {
|
} else {
|
||||||
binding.rvBookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout + 2)
|
binding.rvBookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout)
|
||||||
}
|
}
|
||||||
if (bookshelfLayout == 0) {
|
if (bookshelfLayout == 0) {
|
||||||
binding.rvBookshelf.setRecycledViewPool(activityViewModel.booksListRecycledViewPool)
|
binding.rvBookshelf.setRecycledViewPool(activityViewModel.booksListRecycledViewPool)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import io.legato.kazusa.ui.book.group.GroupEditDialog
|
|||||||
import io.legato.kazusa.ui.book.info.BookInfoActivity
|
import io.legato.kazusa.ui.book.info.BookInfoActivity
|
||||||
import io.legato.kazusa.ui.book.search.SearchActivity
|
import io.legato.kazusa.ui.book.search.SearchActivity
|
||||||
import io.legato.kazusa.ui.main.bookshelf.BaseBookshelfFragment
|
import io.legato.kazusa.ui.main.bookshelf.BaseBookshelfFragment
|
||||||
|
import io.legato.kazusa.utils.bookshelfLayout
|
||||||
import io.legato.kazusa.utils.cnCompare
|
import io.legato.kazusa.utils.cnCompare
|
||||||
import io.legato.kazusa.utils.flowWithLifecycleAndDatabaseChangeFirst
|
import io.legato.kazusa.utils.flowWithLifecycleAndDatabaseChangeFirst
|
||||||
import io.legato.kazusa.utils.observeEvent
|
import io.legato.kazusa.utils.observeEvent
|
||||||
@@ -56,7 +57,9 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val binding by viewBinding(FragmentBookshelf2Binding::bind)
|
private val binding by viewBinding(FragmentBookshelf2Binding::bind)
|
||||||
private val bookshelfLayout by lazy { AppConfig.bookshelfLayout }
|
|
||||||
|
private val bookshelfLayout by lazy { requireContext().bookshelfLayout }
|
||||||
|
|
||||||
private val booksAdapter: BaseBooksAdapter<*> by lazy {
|
private val booksAdapter: BaseBooksAdapter<*> by lazy {
|
||||||
if (bookshelfLayout == 0) {
|
if (bookshelfLayout == 0) {
|
||||||
BooksAdapterList(requireContext(), this)
|
BooksAdapterList(requireContext(), this)
|
||||||
@@ -87,7 +90,7 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
|||||||
if (bookshelfLayout == 0) {
|
if (bookshelfLayout == 0) {
|
||||||
binding.rvBookshelf.layoutManager = LinearLayoutManager(context)
|
binding.rvBookshelf.layoutManager = LinearLayoutManager(context)
|
||||||
} else {
|
} else {
|
||||||
binding.rvBookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout + 2)
|
binding.rvBookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout)
|
||||||
}
|
}
|
||||||
binding.rvBookshelf.itemAnimator = null
|
binding.rvBookshelf.itemAnimator = null
|
||||||
binding.rvBookshelf.adapter = booksAdapter
|
binding.rvBookshelf.adapter = booksAdapter
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import android.widget.TextView
|
|||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.children
|
import androidx.core.view.children
|
||||||
import com.google.android.flexbox.FlexboxLayout
|
import com.google.android.flexbox.FlexboxLayout
|
||||||
|
import com.google.android.material.card.MaterialCardView
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.adapter.ItemViewHolder
|
import io.legato.kazusa.base.adapter.ItemViewHolder
|
||||||
import io.legato.kazusa.base.adapter.RecyclerAdapter
|
import io.legato.kazusa.base.adapter.RecyclerAdapter
|
||||||
@@ -85,14 +86,17 @@ class ExploreAdapter(context: Context, val callBack: CallBack) :
|
|||||||
recyclerFlexbox(flexbox)
|
recyclerFlexbox(flexbox)
|
||||||
flexbox.visible()
|
flexbox.visible()
|
||||||
kinds.forEach { kind ->
|
kinds.forEach { kind ->
|
||||||
val tv = getFlexboxChild(flexbox)
|
val cardView = getFlexboxChild(flexbox)
|
||||||
flexbox.addView(tv)
|
val textView = cardView.findViewById<TextView>(R.id.text_view)
|
||||||
tv.text = kind.title
|
flexbox.addView(cardView)
|
||||||
kind.style().apply(tv)
|
|
||||||
|
textView.text = kind.title
|
||||||
|
//kind.style().apply(textView)
|
||||||
|
|
||||||
if (kind.url.isNullOrBlank()) {
|
if (kind.url.isNullOrBlank()) {
|
||||||
tv.setOnClickListener(null)
|
cardView.setOnClickListener(null)
|
||||||
} else {
|
} else {
|
||||||
tv.setOnClickListener {
|
cardView.setOnClickListener {
|
||||||
if (kind.title.startsWith("ERROR:")) {
|
if (kind.title.startsWith("ERROR:")) {
|
||||||
it.activity?.showDialogFragment(TextDialog("ERROR", kind.url))
|
it.activity?.showDialogFragment(TextDialog("ERROR", kind.url))
|
||||||
} else {
|
} else {
|
||||||
@@ -104,12 +108,13 @@ class ExploreAdapter(context: Context, val callBack: CallBack) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
private fun getFlexboxChild(flexbox: FlexboxLayout): TextView {
|
private fun getFlexboxChild(flexbox: FlexboxLayout): MaterialCardView {
|
||||||
return if (recycler.isEmpty()) {
|
return if (recycler.isEmpty()) {
|
||||||
ItemFilletTextBinding.inflate(inflater, flexbox, false).root
|
ItemFilletTextBinding.inflate(inflater, flexbox, false).root
|
||||||
} else {
|
} else {
|
||||||
recycler.removeLastElement() as TextView
|
recycler.removeLastElement() as MaterialCardView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class GroupManageDialog : BaseBottomSheetDialogFragment(R.layout.dialog_recycler
|
|||||||
//toolBar.setBackgroundColor(primaryColor)
|
//toolBar.setBackgroundColor(primaryColor)
|
||||||
toolBar.title = getString(R.string.group_manage)
|
toolBar.title = getString(R.string.group_manage)
|
||||||
toolBar.inflateMenu(R.menu.group_manage)
|
toolBar.inflateMenu(R.menu.group_manage)
|
||||||
toolBar.menu.applyTint(requireContext())
|
//toolBar.menu.applyTint(requireContext())
|
||||||
toolBar.setOnMenuItemClickListener(this@GroupManageDialog)
|
toolBar.setOnMenuItemClickListener(this@GroupManageDialog)
|
||||||
recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
||||||
recyclerView.addItemDecoration(VerticalDivider(requireContext()))
|
recyclerView.addItemDecoration(VerticalDivider(requireContext()))
|
||||||
|
|||||||
@@ -167,12 +167,6 @@ class TitleBar @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppConfig.isEInkMode) {
|
|
||||||
setBackgroundResource(R.drawable.bg_eink_border_bottom)
|
|
||||||
} else {
|
|
||||||
//setBackgroundColor(context.primaryColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
stateListAnimator = null
|
stateListAnimator = null
|
||||||
//elevation = context.elevation
|
//elevation = context.elevation
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import android.view.LayoutInflater
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import androidx.annotation.ColorRes
|
import androidx.annotation.ColorRes
|
||||||
|
import androidx.core.view.isInvisible
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.databinding.ViewLoadMoreBinding
|
import io.legato.kazusa.databinding.ViewLoadMoreBinding
|
||||||
import io.legato.kazusa.lib.dialogs.alert
|
import io.legato.kazusa.lib.dialogs.alert
|
||||||
@@ -51,7 +53,7 @@ class LoadMoreView(context: Context, attrs: AttributeSet? = null) : FrameLayout(
|
|||||||
|
|
||||||
fun stopLoad() {
|
fun stopLoad() {
|
||||||
isLoading = false
|
isLoading = false
|
||||||
binding.rotateLoading.inVisible()
|
binding.rotateLoading.invisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hasMore() {
|
fun hasMore() {
|
||||||
@@ -81,14 +83,6 @@ class LoadMoreView(context: Context, attrs: AttributeSet? = null) : FrameLayout(
|
|||||||
binding.tvText.visible()
|
binding.tvText.visible()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setLoadingColor(@ColorRes color: Int) {
|
|
||||||
binding.rotateLoading.loadingColor = context.getCompatColor(color)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setLoadingTextColor(@ColorRes color: Int) {
|
|
||||||
binding.tvText.setTextColor(context.getCompatColor(color))
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showErrorDialog(): Boolean {
|
private fun showErrorDialog(): Boolean {
|
||||||
if (errorMsg.isBlank()) {
|
if (errorMsg.isBlank()) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ class FastScroller : LinearLayout {
|
|||||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||||
when (event.action) {
|
when (event.action) {
|
||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
if (event.x < mHandleView.x - ViewCompat.getPaddingStart(mHandleView)) {
|
if (event.x < mHandleView.x - mHandleView.paddingStart) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (!mScrollbar.isVisible) {
|
if (!mScrollbar.isVisible) {
|
||||||
|
|||||||
@@ -418,6 +418,13 @@ val Context.isDebuggable: Boolean
|
|||||||
|
|
||||||
val Context.dataStore by preferencesDataStore(name = "settings")
|
val Context.dataStore by preferencesDataStore(name = "settings")
|
||||||
|
|
||||||
|
val Context.bookshelfLayout: Int
|
||||||
|
get() = if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
AppConfig.bookshelfLayoutLandscape
|
||||||
|
} else {
|
||||||
|
AppConfig.bookshelfLayoutPortrait
|
||||||
|
}
|
||||||
|
|
||||||
fun Context.themeColor(attr: Int): Int {
|
fun Context.themeColor(attr: Int): Int {
|
||||||
val typedValue = TypedValue()
|
val typedValue = TypedValue()
|
||||||
theme.resolveAttribute(attr, typedValue, true)
|
theme.resolveAttribute(attr, typedValue, true)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ object DataStoreUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun <T> read(context: Context, key: String, defaultValue: T): T {
|
suspend fun <T> read(context: Context, key: String, defaultValue: T): T {
|
||||||
return context.dataStore.data.map { preferences ->
|
return context.dataStore.data.map { preferences ->
|
||||||
when (defaultValue) {
|
when (defaultValue) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import io.legato.kazusa.ui.widget.dialog.TextDialog
|
|||||||
inline fun <reified T : DialogFragment> Fragment.showDialogFragment(
|
inline fun <reified T : DialogFragment> Fragment.showDialogFragment(
|
||||||
arguments: Bundle.() -> Unit = {}
|
arguments: Bundle.() -> Unit = {}
|
||||||
) {
|
) {
|
||||||
val dialog = T::class.java.newInstance()
|
val dialog = T::class.java.getDeclaredConstructor().newInstance()
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.apply(arguments)
|
bundle.apply(arguments)
|
||||||
dialog.arguments = bundle
|
dialog.arguments = bundle
|
||||||
|
|||||||
@@ -69,9 +69,7 @@ fun EditText.showSoftInput() = run {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun View.disableAutoFill() = run {
|
fun View.disableAutoFill() = run {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
this.importantForAutofill = IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
|
this.importantForAutofill = IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun View.applyTint(
|
fun View.applyTint(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:duration="150">
|
android:duration="320"
|
||||||
|
android:interpolator="@android:interpolator/decelerate_cubic">
|
||||||
<translate
|
<translate
|
||||||
android:fromYDelta="100%"
|
android:fromYDelta="100%"
|
||||||
android:toYDelta="0" />
|
android:toYDelta="0" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:duration="200">
|
android:duration="320"
|
||||||
|
android:interpolator="@android:interpolator/decelerate_cubic">
|
||||||
<translate
|
<translate
|
||||||
android:fromYDelta="0%"
|
android:fromYDelta="0%"
|
||||||
android:toYDelta="100%" />
|
android:toYDelta="100%" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:duration="200">
|
android:duration="320"
|
||||||
|
android:interpolator="@android:interpolator/decelerate_cubic">
|
||||||
<translate
|
<translate
|
||||||
android:fromYDelta="-100%"
|
android:fromYDelta="-100%"
|
||||||
android:toYDelta="0" />
|
android:toYDelta="0" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:duration="200">
|
android:duration="320"
|
||||||
|
android:interpolator="@android:interpolator/decelerate_cubic">
|
||||||
<translate
|
<translate
|
||||||
android:fromYDelta="0"
|
android:fromYDelta="0"
|
||||||
android:toYDelta="-100%" />
|
android:toYDelta="-100%" />
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960" android:tint="?attr/colorControlNormal">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M856,570L570,856Q558,868 543,874Q528,880 513,880Q498,880 483,874Q468,868 456,856L103,503Q92,492 86,477.5Q80,463 80,447L80,160Q80,127 103.5,103.5Q127,80 160,80L447,80Q463,80 478,86.5Q493,93 504,104L856,457Q868,469 873.5,484Q879,499 879,514Q879,529 873.5,543.5Q868,558 856,570ZM260,320Q285,320 302.5,302.5Q320,285 320,260Q320,235 302.5,217.5Q285,200 260,200Q235,200 217.5,217.5Q200,235 200,260Q200,285 217.5,302.5Q235,320 260,320Z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960" android:tint="?attr/colorControlNormal">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M480,840L422,788Q321,697 255,631Q189,565 150,512.5Q111,460 95.5,416Q80,372 80,326Q80,232 143,169Q206,106 300,106Q352,106 399,128Q446,150 480,190Q514,150 561,128Q608,106 660,106Q754,106 817,169Q880,232 880,326Q880,372 864.5,416Q849,460 810,512.5Q771,565 705,631Q639,697 538,788L480,840Z"/>
|
||||||
|
</vector>
|
||||||
@@ -1,206 +1,137 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/bg_book"
|
android:id="@+id/bg_book"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:contentDescription="@string/bg_image"
|
android:contentDescription="@string/bg_image"
|
||||||
android:scaleType="centerCrop"
|
android:foreground="@drawable/bg_book_mask"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:scaleType="centerCrop" />
|
||||||
tools:ignore="ImageContrastCheck" />
|
|
||||||
|
|
||||||
<View
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/vw_bg"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="#50000000" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.TitleBar
|
|
||||||
android:id="@+id/title_bar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:background="@android:color/transparent"
|
||||||
app:title="@string/book_info"
|
android:fitsSystemWindows="true">
|
||||||
app:themeMode="dark" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
|
||||||
android:orientation="horizontal"
|
style="?attr/collapsingToolbarLayoutLargeSize"
|
||||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
app:collapsedTitleTextAppearance="?attr/textAppearanceTitleLarge"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:expandedTitleTextAppearance="?attr/textAppearanceHeadlineLarge"
|
||||||
tools:ignore="DisableBaselineAlignment">
|
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/top_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
app:navigationIcon="@drawable/ic_arrow_back"
|
||||||
|
app:title=" "
|
||||||
|
app:layout_collapseMode="pin" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/refresh_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_gradient_mask"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1.0"
|
android:orientation="horizontal">
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="30dp">
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="32dp"
|
||||||
<io.legato.kazusa.ui.widget.image.ArcView
|
tools:ignore="RtlSymmetry">
|
||||||
android:id="@+id/arc_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="78dp"
|
|
||||||
android:layout_marginTop="128dp"
|
|
||||||
app:arcDirectionTop="true"
|
|
||||||
app:arcHeight="36dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_marginEnd="96dp"
|
||||||
android:layout_margin="3dp"
|
android:layout_marginStart="16dp"
|
||||||
app:cardCornerRadius="5dp"
|
app:cardCornerRadius="16dp">
|
||||||
app:cardElevation="8dp">
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.image.CoverImageView
|
<io.legato.kazusa.ui.widget.image.CoverImageView
|
||||||
android:id="@+id/iv_cover"
|
android:id="@+id/iv_cover"
|
||||||
android:layout_width="130dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="200dp"
|
android:layout_height="210dp"
|
||||||
android:contentDescription="@string/img_cover"
|
android:contentDescription="@string/img_cover"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/image_cover_default"
|
android:src="@drawable/image_cover_default" />
|
||||||
tools:ignore="ImageContrastCheck" />
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_info"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="10dp"
|
android:padding="12dp">
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
tools:ignore="RtlHardcoded">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="6dp"
|
android:maxLines="2"
|
||||||
android:gravity="center"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/book_name"
|
android:text="@string/book_name"
|
||||||
android:textSize="18sp"
|
style="@style/TextAppearance.Material3.ActionBar.Title"
|
||||||
tools:ignore="RtlHardcoded" />
|
tools:ignore="RtlHardcoded" />
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.LabelsBar
|
<LinearLayout
|
||||||
android:id="@+id/lb_kind"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginBottom="6dp"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="6dp"
|
||||||
android:paddingBottom="3dp"
|
android:paddingBottom="2dp"
|
||||||
tools:ignore="UseCompoundDrawables">
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="18sp"
|
android:layout_width="18sp"
|
||||||
android:layout_height="18sp"
|
android:layout_height="18sp"
|
||||||
android:contentDescription="@string/origin_format"
|
android:contentDescription="@string/author"
|
||||||
android:paddingRight="4dp"
|
|
||||||
android:src="@drawable/ic_author"
|
android:src="@drawable/ic_author"
|
||||||
app:tint="@color/tv_text_summary"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_author"
|
android:id="@+id/tv_author"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/author"
|
android:text="@string/author"
|
||||||
android:textSize="13sp"
|
android:textSize="14sp"
|
||||||
tools:ignore="NestedWeights,TextContrastCheck" />
|
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
|
||||||
android:id="@+id/scroll_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:fillViewport="true"
|
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:padding="0dp"
|
|
||||||
android:scrollbarStyle="outsideInset"
|
|
||||||
android:scrollbars="vertical"
|
|
||||||
tools:ignore="NestedWeights">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingBottom="8dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingBottom="8dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:paddingBottom="3dp">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_web"
|
android:id="@+id/iv_web"
|
||||||
android:layout_width="18sp"
|
android:layout_width="18sp"
|
||||||
android:layout_height="18sp"
|
android:layout_height="18sp"
|
||||||
android:contentDescription="@string/origin_format"
|
android:contentDescription="@string/origin_format"
|
||||||
android:paddingRight="2dp"
|
|
||||||
android:src="@drawable/ic_web_outline"
|
android:src="@drawable/ic_web_outline"
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
@@ -209,24 +140,158 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
|
||||||
|
tools:text="@string/origin_format" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<io.legato.kazusa.ui.widget.NoChildScrollNestedScrollView
|
||||||
|
android:id="@+id/scroll_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
|
android:focusable="true"
|
||||||
|
android:padding="0dp"
|
||||||
|
android:scrollbarStyle="outsideOverlay"
|
||||||
|
android:scrollbars="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_info"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<io.legato.kazusa.ui.widget.LabelsBar
|
||||||
|
android:id="@+id/lb_kind"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="8dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="4"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_shelf"
|
||||||
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/remove_from_bookshelf"
|
||||||
|
android:textSize="13sp"
|
||||||
|
app:icon="@drawable/ic_clear_all"
|
||||||
|
app:iconGravity="top"
|
||||||
|
app:iconPadding="4dp"
|
||||||
|
app:iconSize="20dp" />
|
||||||
|
|
||||||
|
<!-- 查看目录按钮 -->
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/tv_toc_view"
|
||||||
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/view_toc"
|
||||||
|
android:textSize="13sp"
|
||||||
|
app:icon="@drawable/ic_toc"
|
||||||
|
app:iconGravity="top"
|
||||||
|
app:iconPadding="4dp"
|
||||||
|
app:iconSize="20dp" />
|
||||||
|
|
||||||
|
<!-- 更换分组按钮 -->
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/tv_change_group"
|
||||||
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/change_group"
|
||||||
|
android:textSize="13sp"
|
||||||
|
app:icon="@drawable/ic_groups"
|
||||||
|
app:iconGravity="top"
|
||||||
|
app:iconPadding="4dp"
|
||||||
|
app:iconSize="20dp" />
|
||||||
|
|
||||||
|
<!-- 更换来源按钮(保持原样) -->
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_change_source"
|
||||||
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/book_source"
|
||||||
|
android:padding="8dp"
|
||||||
|
app:icon="@drawable/ic_change_source"
|
||||||
|
android:textSize="13sp"
|
||||||
|
app:iconGravity="top"
|
||||||
|
app:iconPadding="4dp"
|
||||||
|
app:iconSize="20dp"
|
||||||
|
tools:contentDescription="@string/change_origin" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_toc"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18sp"
|
||||||
|
android:layout_height="18sp"
|
||||||
|
android:contentDescription="@string/read_dur_progress"
|
||||||
|
android:paddingRight="2dp"
|
||||||
|
android:src="@drawable/ic_chapter"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_toc"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
android:singleLine="true"
|
android:textSize="14sp"
|
||||||
android:textSize="13sp"
|
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
|
||||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry,TextContrastCheck"
|
tools:text="@string/toc_s" />
|
||||||
tools:text="@string/origin_format" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.text.AccentBgTextView
|
|
||||||
android:id="@+id/tv_change_source"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:paddingLeft="5dp"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:text="@string/change_origin"
|
|
||||||
android:textSize="13sp"
|
|
||||||
app:radius="2dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -257,8 +322,8 @@
|
|||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="13sp"
|
android:textSize="14sp"
|
||||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry,TextContrastCheck"
|
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
|
||||||
tools:text="@string/read_dur_progress" />
|
tools:text="@string/read_dur_progress" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -269,7 +334,8 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
android:paddingBottom="3dp">
|
android:paddingBottom="3dp"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="18sp"
|
android:layout_width="18sp"
|
||||||
@@ -279,86 +345,20 @@
|
|||||||
android:src="@drawable/ic_groups"
|
android:src="@drawable/ic_groups"
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_group"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textSize="13sp"
|
|
||||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry,TextContrastCheck"
|
|
||||||
tools:text="@string/group_s" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.text.AccentBgTextView
|
|
||||||
android:id="@+id/tv_change_group"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:paddingLeft="5dp"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:text="@string/change_group"
|
|
||||||
android:textSize="13sp"
|
|
||||||
app:radius="2dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:paddingBottom="3dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="18sp"
|
|
||||||
android:layout_height="18sp"
|
|
||||||
android:contentDescription="@string/read_dur_progress"
|
|
||||||
android:paddingRight="2dp"
|
|
||||||
android:src="@drawable/ic_folder_open"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_toc"
|
android:id="@+id/tv_detail"
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textSize="13sp"
|
|
||||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry,TextContrastCheck"
|
|
||||||
tools:text="@string/toc_s" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.text.AccentBgTextView
|
|
||||||
android:id="@+id/tv_toc_view"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:paddingLeft="5dp"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:text="@string/view_toc"
|
|
||||||
android:textSize="13sp"
|
|
||||||
app:radius="2dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.text.ScrollTextView
|
|
||||||
android:id="@+id/tv_intro"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:minHeight="48dp"
|
android:minHeight="48dp"
|
||||||
android:paddingLeft="8dp"
|
android:paddingHorizontal="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="80dp"
|
||||||
|
android:lineSpacingExtra="4dp"
|
||||||
android:text="@string/book_intro"
|
android:text="@string/book_intro"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
@@ -366,44 +366,24 @@
|
|||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</io.legato.kazusa.ui.widget.NoChildScrollNestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||||
|
android:id="@+id/btn_read"
|
||||||
<LinearLayout
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/fl_action"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_height="50dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:orientation="horizontal"
|
android:layout_marginBottom="24dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_shelf"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:gravity="center"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:text="@string/remove_from_bookshelf"
|
|
||||||
android:textSize="15sp" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.text.AccentBgTextView
|
|
||||||
android:id="@+id/tv_read"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:text="@string/reading"
|
android:text="@string/reading"
|
||||||
android:textSize="15sp" />
|
android:textColor="?attr/colorOnPrimary"
|
||||||
|
android:contentDescription="@string/reading"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
app:icon="@drawable/ic_bottom_books"
|
||||||
|
app:backgroundTint="?attr/colorSecondary"
|
||||||
|
app:iconTint="?attr/colorOnPrimary"
|
||||||
|
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.navigationrail.NavigationRailView
|
||||||
|
android:id="@+id/navigation_rail_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:menuGravity="center"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:menu="@menu/main_bnv" />
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/view_pager_main"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/navigation_rail_view"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -0,0 +1,264 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/vw_menu_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/vw_menu_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@string/content"
|
||||||
|
tools:layout_editor_absoluteX="0dp"
|
||||||
|
tools:layout_editor_absoluteY="0dp" />
|
||||||
|
|
||||||
|
<io.legato.kazusa.ui.widget.TitleBar
|
||||||
|
android:id="@+id/title_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/colorSurfaceContainer"
|
||||||
|
android:alpha="0.92"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="32dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_book_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/TextAppearance.Material3.TitleLarge"
|
||||||
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/title_bar_addition"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_chapter_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/TextAppearance.Material3.BodyMedium"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_chapter_url"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_source_action"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
|
android:text="@string/book_source" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</io.legato.kazusa.ui.widget.TitleBar>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_brightness"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/bottom_menu"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/title_bar"
|
||||||
|
tools:ignore="RtlHardcoded">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_brightness_auto"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:contentDescription="@string/brightness_auto"
|
||||||
|
android:src="@drawable/ic_brightness_auto"
|
||||||
|
tools:ignore="ImageContrastCheck" />
|
||||||
|
|
||||||
|
<io.legato.kazusa.ui.widget.seekbar.VerticalSeekBarWrapper
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<io.legato.kazusa.ui.widget.seekbar.VerticalSeekBar
|
||||||
|
android:id="@+id/seek_brightness"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:max="255"
|
||||||
|
app:seekBarRotation="CW270" />
|
||||||
|
|
||||||
|
</io.legato.kazusa.ui.widget.seekbar.VerticalSeekBarWrapper>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/vw_brightness_pos_adjust"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:contentDescription="@string/adjust_pos"
|
||||||
|
android:src="@drawable/ic_swap_horiz"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bottom_menu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:alpha="0.92"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_bottom_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<!--章节设置-->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/tv_pre"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clickable="true"
|
||||||
|
android:enabled="false"
|
||||||
|
android:focusable="true"
|
||||||
|
app:icon="@drawable/ic_previous"
|
||||||
|
android:contentDescription="@string/previous_chapter"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:cardCornerRadius="32dp"
|
||||||
|
app:cardBackgroundColor="?attr/colorSurfaceContainer"
|
||||||
|
app:strokeWidth="0dp">
|
||||||
|
<com.google.android.material.slider.Slider
|
||||||
|
android:id="@+id/seek_read_page"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"/>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/tv_next"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clickable="true"
|
||||||
|
android:enabled="false"
|
||||||
|
android:focusable="true"
|
||||||
|
app:icon="@drawable/ic_next"
|
||||||
|
android:contentDescription="@string/next_chapter"
|
||||||
|
tools:ignore="TouchTargetSizeCheck"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bottom_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="end"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/fabSearch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:contentDescription="@string/search_content"
|
||||||
|
android:tooltipText="@string/search_content"
|
||||||
|
app:icon="@drawable/ic_search"
|
||||||
|
app:iconGravity="textStart"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/iv_read_aloud"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:contentDescription="@string/read_aloud"
|
||||||
|
android:maxHeight="24dp"
|
||||||
|
app:icon="@drawable/ic_read_aloud"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
tools:ignore="NestedWeights" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/iv_catalog"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:contentDescription="@string/chapter_list"
|
||||||
|
android:tooltipText="@string/chapter_list"
|
||||||
|
android:maxHeight="24dp"
|
||||||
|
app:icon="@drawable/ic_toc"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
tools:ignore="NestedWeights" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/fabAutoPage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:contentDescription="@string/auto_next_page"
|
||||||
|
android:tooltipText="@string/auto_next_page"
|
||||||
|
app:icon="@drawable/ic_auto_page"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
tools:ignore="UnusedAttribute" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/iv_setting"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:contentDescription="@string/setting"
|
||||||
|
android:tooltipText="@string/setting"
|
||||||
|
android:maxHeight="24dp"
|
||||||
|
app:icon="@drawable/ic_settings"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
tools:ignore="NestedWeights" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -66,12 +66,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_gradient_mask"
|
android:background="@drawable/bg_gradient_mask"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingTop="8dp">
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:cardCornerRadius="8dp">
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.image.CoverImageView
|
<io.legato.kazusa.ui.widget.image.CoverImageView
|
||||||
android:id="@+id/iv_cover"
|
android:id="@+id/iv_cover"
|
||||||
@@ -81,7 +78,7 @@
|
|||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/image_cover_default" />
|
android:src="@drawable/image_cover_default" />
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -341,19 +338,6 @@
|
|||||||
android:src="@drawable/ic_groups"
|
android:src="@drawable/ic_groups"
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_group"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
|
|
||||||
tools:text="@string/group_s" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/coordinator_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:id="@+id/view_pager_main"
|
android:id="@+id/view_pager_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_constraintBottom_toTopOf="@id/bottom_navigation_view"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:ignore="SpeakableTextPresentCheck" />
|
tools:ignore="SpeakableTextPresentCheck" />
|
||||||
|
|
||||||
<!-- 底部导航栏 -->
|
<!-- 底部导航栏 -->
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeBottomNavigationVIew
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
android:id="@+id/bottom_navigation_view"
|
android:id="@+id/bottom_navigation_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:menu="@menu/main_bnv"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:menu="@menu/main_bnv" />
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -1,137 +1,137 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:fillViewport="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/sw_show_unread"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/show_unread"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/sw_show_last_update_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/show_last_update_time"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/sw_show_wait_up_books"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/show_wait_up_count"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/sw_show_bookshelf_fast_scroller"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:text="@string/show_bookshelf_fast_scroller"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_group_style"
|
android:id="@+id/ll_group_style"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:padding="6dp"
|
android:paddingHorizontal="6dp"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
android:text="@string/group_style" />
|
android:text="@string/group_style" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatSpinner
|
<Spinner
|
||||||
android:id="@+id/sp_group_style"
|
android:id="@+id/sp_group_style"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:entries="@array/group_style"
|
android:entries="@array/group_style"
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:id="@+id/sw_show_unread"
|
android:id="@+id/chip_group_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
app:singleSelection="true"
|
||||||
android:text="@string/show_unread"
|
app:selectionRequired="true"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ll_group_style"
|
android:paddingVertical="8dp"
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
android:paddingHorizontal="4dp">
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
<com.google.android.material.chip.Chip
|
||||||
android:id="@+id/sw_show_last_update_time"
|
android:id="@+id/chip_list"
|
||||||
android:layout_width="match_parent"
|
style="@style/Widget.Material3.Chip.Filter"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:text="列表" />
|
||||||
android:text="@string/show_last_update_time"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sw_show_unread"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
<com.google.android.material.chip.Chip
|
||||||
android:id="@+id/sw_show_wait_up_books"
|
android:id="@+id/chip_grid"
|
||||||
android:layout_width="match_parent"
|
style="@style/Widget.Material3.Chip.Filter"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:text="网格" />
|
||||||
android:text="@string/show_wait_up_count"
|
</com.google.android.material.chip.ChipGroup>
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sw_show_last_update_time"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
|
||||||
android:id="@+id/sw_show_bookshelf_fast_scroller"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="6dp"
|
|
||||||
android:text="@string/show_bookshelf_fast_scroller"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sw_show_wait_up_books"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_layout"
|
android:id="@+id/ll_grid_slider"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintRight_toLeftOf="@+id/ll_sort"
|
android:visibility="visible">
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sw_show_bookshelf_fast_scroller"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:text="每行列数:"
|
||||||
android:text="@string/view"
|
android:textSize="14sp"
|
||||||
android:textSize="16sp" />
|
android:paddingVertical="8dp"
|
||||||
|
android:paddingHorizontal="4dp"/>
|
||||||
|
|
||||||
<RadioGroup
|
<com.google.android.material.slider.Slider
|
||||||
android:id="@+id/rg_layout"
|
android:id="@+id/slider_grid_count"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:paddingVertical="8dp"
|
||||||
|
android:valueFrom="1"
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
android:valueTo="9"
|
||||||
android:layout_width="match_parent"
|
android:stepSize="1"
|
||||||
android:layout_height="wrap_content"
|
android:value="3" />
|
||||||
android:text="@string/layout_list"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/layout_grid3"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/layout_grid4"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/layout_grid5"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/layout_grid6"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
</RadioGroup>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:baselineAligned="false"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_sort"
|
android:id="@+id/ll_sort"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:layout_weight="1"
|
||||||
app:layout_constraintLeft_toRightOf="@+id/ll_layout"
|
android:orientation="vertical">
|
||||||
app:layout_constraintTop_toBottomOf="@id/sw_show_bookshelf_fast_scroller"
|
|
||||||
app:layout_constraintRight_toRightOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:padding="6dp"
|
||||||
android:text="@string/sort"
|
android:text="@string/sort"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
@@ -177,9 +177,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/bookshelf_px_5"
|
android:text="@string/bookshelf_px_5"
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tool="http://schemas.android.com/tools"
|
xmlns:tool="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<LinearLayout
|
||||||
android:id="@+id/root_view"
|
android:id="@+id/root_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -22,6 +26,11 @@
|
|||||||
android:background="@drawable/bg_bottom_sheet_handle"
|
android:background="@drawable/bg_bottom_sheet_handle"
|
||||||
android:layout_marginBottom="16dp" />
|
android:layout_marginBottom="16dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bottom_sheet_title"
|
android:id="@+id/bottom_sheet_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -30,6 +39,16 @@
|
|||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/tv_day_night"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
app:icon="@drawable/ic_brightness"
|
||||||
|
app:iconGravity="textStart" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -47,8 +66,8 @@
|
|||||||
<io.legato.kazusa.ui.book.read.config.TextFontWeightConverter
|
<io.legato.kazusa.ui.book.read.config.TextFontWeightConverter
|
||||||
android:id="@+id/text_font_weight_converter"
|
android:id="@+id/text_font_weight_converter"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:layout_width="72dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="72dp"
|
android:layout_height="64dp"
|
||||||
app:icon="@drawable/font_bold"
|
app:icon="@drawable/font_bold"
|
||||||
app:iconGravity="textTop"
|
app:iconGravity="textTop"
|
||||||
android:text="@string/font_weight_text" />
|
android:text="@string/font_weight_text" />
|
||||||
@@ -60,8 +79,8 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_text_font"
|
android:id="@+id/tv_text_font"
|
||||||
android:layout_width="72dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="72dp"
|
android:layout_height="64dp"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
app:icon="@drawable/font_style"
|
app:icon="@drawable/font_style"
|
||||||
app:iconGravity="textTop"
|
app:iconGravity="textTop"
|
||||||
@@ -74,8 +93,8 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_text_indent"
|
android:id="@+id/tv_text_indent"
|
||||||
android:layout_width="72dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="72dp"
|
android:layout_height="64dp"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
app:icon="@drawable/ic_segment"
|
app:icon="@drawable/ic_segment"
|
||||||
app:iconGravity="textTop"
|
app:iconGravity="textTop"
|
||||||
@@ -88,8 +107,8 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_padding"
|
android:id="@+id/tv_padding"
|
||||||
android:layout_width="72dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="72dp"
|
android:layout_height="64dp"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
app:icon="@drawable/ic_padding"
|
app:icon="@drawable/ic_padding"
|
||||||
app:iconGravity="textTop"
|
app:iconGravity="textTop"
|
||||||
@@ -120,7 +139,16 @@
|
|||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
android:text="@string/information" />
|
android:text="@string/information" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/tv_more"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:text="@string/more_setting" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.DetailSeekBar
|
<io.legato.kazusa.ui.widget.DetailSeekBar
|
||||||
@@ -160,19 +188,12 @@
|
|||||||
app:max="20"
|
app:max="20"
|
||||||
app:title="@string/paragraph_size" />
|
app:title="@string/paragraph_size" />
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/vw_bg_fg"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_marginVertical="8dp"
|
|
||||||
android:background="@color/btn_bg_press" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/set_bottom_bar"
|
android:id="@+id/set_bottom_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_page_anim"
|
android:id="@+id/tv_page_anim"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -247,13 +268,6 @@
|
|||||||
</com.google.android.material.chip.ChipGroup>
|
</com.google.android.material.chip.ChipGroup>
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/vw_bg_fg1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_marginVertical="8dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -270,8 +284,6 @@
|
|||||||
android:text="@string/text_bg_style"
|
android:text="@string/text_bg_style"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.checkbox.MaterialCheckBox
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
android:id="@+id/cb_share_layout"
|
android:id="@+id/cb_share_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -293,6 +305,8 @@
|
|||||||
android:paddingHorizontal="12dp"
|
android:paddingHorizontal="12dp"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
tool:listitem="@layout/item_read_style" />
|
tool:listitem="@layout/item_read_style" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="20dp"
|
android:padding="16dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ProgressBar
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
android:id="@+id/pb"
|
android:id="@+id/pb"
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
android:id="@+id/tv_msg"
|
android:id="@+id/tv_msg"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:padding="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/loading" />
|
android:text="@string/loading" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,10 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true">
|
||||||
|
<TextView
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/text_view"
|
android:id="@+id/text_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/selector_fillet_btn_bg"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
@@ -15,3 +20,5 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="?attr/colorPrimary"
|
android:textColor="?attr/colorPrimary"
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
android:name="@string/enable"
|
android:name="@string/enable"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="6dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginRight="6dp"
|
android:layout_marginEnd="8dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_edit"
|
app:layout_constraintRight_toLeftOf="@id/iv_edit"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
@@ -37,12 +37,12 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_edit"
|
android:id="@+id/iv_edit"
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/edit"
|
android:contentDescription="@string/edit"
|
||||||
android:padding="6dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:src="@drawable/ic_edit"
|
android:src="@drawable/ic_edit"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_menu_more"
|
app:layout_constraintRight_toLeftOf="@id/iv_menu_more"
|
||||||
@@ -50,11 +50,11 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_menu_more"
|
android:id="@+id/iv_menu_more"
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/more_menu"
|
android:contentDescription="@string/more_menu"
|
||||||
android:padding="6dp"
|
|
||||||
android:src="@drawable/ic_more_vert"
|
android:src="@drawable/ic_more_vert"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
|||||||
@@ -7,9 +7,10 @@
|
|||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:padding="16dp">
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeCheckBox
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
android:id="@+id/cb_source"
|
android:id="@+id/cb_source"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -21,13 +22,13 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:ignore="TouchTargetSizeCheck,DuplicateSpeakableTextCheck" />
|
tools:ignore="TouchTargetSizeCheck,DuplicateSpeakableTextCheck" />
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
android:id="@+id/swt_enabled"
|
android:id="@+id/swt_enabled"
|
||||||
android:name="@string/enable"
|
android:name="@string/enable"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="6dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginRight="6dp"
|
android:layout_marginEnd="8dp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/title_example"
|
app:layout_constraintBottom_toTopOf="@id/title_example"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_edit"
|
app:layout_constraintRight_toLeftOf="@id/iv_edit"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
@@ -35,12 +36,12 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_edit"
|
android:id="@+id/iv_edit"
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/edit"
|
android:contentDescription="@string/edit"
|
||||||
android:padding="6dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:src="@drawable/ic_edit"
|
android:src="@drawable/ic_edit"
|
||||||
app:layout_constraintBottom_toTopOf="@id/title_example"
|
app:layout_constraintBottom_toTopOf="@id/title_example"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_menu_more"
|
app:layout_constraintRight_toLeftOf="@id/iv_menu_more"
|
||||||
@@ -48,11 +49,11 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_menu_more"
|
android:id="@+id/iv_menu_more"
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/more_menu"
|
android:contentDescription="@string/more_menu"
|
||||||
android:padding="6dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:src="@drawable/ic_more_vert"
|
android:src="@drawable/ic_more_vert"
|
||||||
app:layout_constraintBottom_toTopOf="@id/title_example"
|
app:layout_constraintBottom_toTopOf="@id/title_example"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.anima.RotateLoading
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
android:id="@+id/rotate_loading"
|
android:id="@+id/rotate_loading"
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:layout_margin="6dp"
|
android:layout_margin="6dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
app:loading_width="2dp" />
|
android:indeterminate="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_text"
|
android:id="@+id/tv_text"
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
|
|||||||
@@ -5,10 +5,8 @@
|
|||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingVertical="16dp"
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
@@ -20,9 +18,8 @@
|
|||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
android:paddingTop="1dp"
|
android:layout_width="28dp"
|
||||||
android:layout_width="30dp"
|
android:layout_height="28dp"
|
||||||
android:layout_height="30dp"
|
|
||||||
app:tint="?attr/colorPrimary"
|
app:tint="?attr/colorPrimary"
|
||||||
tools:ignore="ContentDescription,RtlHardcoded" />
|
tools:ignore="ContentDescription,RtlHardcoded" />
|
||||||
|
|
||||||
@@ -53,10 +50,8 @@
|
|||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/preference_widget"
|
android:id="@+id/preference_widget"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:layout_marginBottom="2dp"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:gravity="right|center_vertical"
|
android:gravity="right|center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -19,53 +19,55 @@
|
|||||||
android:id="@+id/title_bar"
|
android:id="@+id/title_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/colorSurfaceContainer"
|
||||||
|
android:alpha="0.92"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_book_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/TextAppearance.Material3.TitleLarge"
|
||||||
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:id="@+id/title_bar_addition"
|
android:id="@+id/title_bar_addition"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_chapter_name"
|
android:id="@+id/tv_chapter_name"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="10dp"
|
style="@style/TextAppearance.Material3.BodyMedium"
|
||||||
android:paddingRight="10dp"
|
android:layout_weight="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true" />
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toLeftOf="@+id/tv_source_action"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_chapter_url"
|
android:id="@+id/tv_chapter_url"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:visibility="gone"
|
android:visibility="gone" />
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toLeftOf="@+id/tv_source_action"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_chapter_name" />
|
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.text.AccentBgTextView
|
<TextView
|
||||||
android:id="@+id/tv_source_action"
|
android:id="@+id/tv_source_action"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="1dp"
|
android:paddingVertical="8dp"
|
||||||
android:gravity="center"
|
android:text="@string/book_source" />
|
||||||
android:maxWidth="120dp"
|
|
||||||
android:paddingLeft="6dp"
|
</LinearLayout>
|
||||||
android:paddingRight="6dp"
|
</LinearLayout>
|
||||||
android:text="@string/book_source"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_chapter_url"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:radius="2dp" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</io.legato.kazusa.ui.widget.TitleBar>
|
</io.legato.kazusa.ui.widget.TitleBar>
|
||||||
|
|
||||||
@@ -119,113 +121,32 @@
|
|||||||
android:id="@+id/bottom_menu"
|
android:id="@+id/bottom_menu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:alpha="0.92"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_floating_button"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingStart="12dp"
|
|
||||||
android:paddingEnd="12dp">
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/fabSearch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="12dp"
|
|
||||||
android:contentDescription="@string/search_content"
|
|
||||||
android:src="@drawable/ic_search"
|
|
||||||
android:tooltipText="@string/search_content"
|
|
||||||
app:elevation="2dp"
|
|
||||||
app:fabSize="mini"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/fabAutoPage"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="12dp"
|
|
||||||
android:contentDescription="@string/auto_next_page"
|
|
||||||
android:src="@drawable/ic_auto_page"
|
|
||||||
android:tooltipText="@string/auto_next_page"
|
|
||||||
app:elevation="2dp"
|
|
||||||
app:fabSize="mini"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/fabReplaceRule"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="12dp"
|
|
||||||
android:contentDescription="@string/replace_rule_title"
|
|
||||||
android:src="@drawable/ic_find_replace"
|
|
||||||
android:tooltipText="@string/replace_rule_title"
|
|
||||||
app:elevation="2dp"
|
|
||||||
app:fabSize="mini"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/fabNightTheme"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="12dp"
|
|
||||||
android:contentDescription="@string/dark_theme"
|
|
||||||
android:src="@drawable/ic_brightness"
|
|
||||||
android:tooltipText="@string/dark_theme"
|
|
||||||
app:elevation="2dp"
|
|
||||||
app:fabSize="mini"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:strokeWidth="0dp"
|
|
||||||
android:layout_margin="8dp">
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_bottom_bg"
|
android:id="@+id/ll_bottom_bg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/colorSurface"
|
android:background="@android:color/transparent"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<!--章节设置-->
|
<!--章节设置-->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginVertical="8dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_pre"
|
android:id="@+id/tv_pre"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
@@ -233,22 +154,27 @@
|
|||||||
android:contentDescription="@string/previous_chapter"
|
android:contentDescription="@string/previous_chapter"
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
<com.google.android.material.slider.Slider
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/seek_read_page"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:valueTo="2.0"
|
app:cardCornerRadius="32dp"
|
||||||
android:valueFrom="1.0"
|
app:cardBackgroundColor="?attr/colorSurfaceContainer"
|
||||||
android:value="1.0"/>
|
app:strokeWidth="0dp">
|
||||||
|
<com.google.android.material.slider.Slider
|
||||||
|
android:id="@+id/seek_read_page"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"/>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_next"
|
android:id="@+id/tv_next"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
@@ -258,189 +184,102 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/bottom_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:baselineAligned="false"
|
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:background="?attr/colorSurfaceContainer"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<View
|
<com.google.android.material.button.MaterialButton
|
||||||
android:layout_width="0dp"
|
android:id="@+id/fabSearch"
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:importantForAccessibility="no" />
|
|
||||||
|
|
||||||
<!--目录按钮-->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_catalog"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/chapter_list"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingBottom="4dp"
|
|
||||||
tools:ignore="VisualLintBounds">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_catalog"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/chapter_list"
|
|
||||||
android:maxHeight="24dp"
|
|
||||||
android:src="@drawable/ic_toc"
|
|
||||||
tools:ignore="NestedWeights" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_catalog"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:ellipsize="middle"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:singleLine="true"
|
android:contentDescription="@string/search_content"
|
||||||
android:text="@string/chapter_list"
|
android:tooltipText="@string/search_content"
|
||||||
android:textSize="12sp" />
|
app:icon="@drawable/ic_search"
|
||||||
</LinearLayout>
|
app:iconGravity="textStart"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="2"
|
android:layout_weight="1"
|
||||||
android:importantForAccessibility="no" />
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
<!--调节按钮-->
|
<com.google.android.material.button.MaterialButton
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_read_aloud"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/read_aloud"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingBottom="4dp"
|
|
||||||
tools:ignore="VisualLintBounds">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_read_aloud"
|
android:id="@+id/iv_read_aloud"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:adjustViewBounds="true"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:contentDescription="@string/read_aloud"
|
android:contentDescription="@string/read_aloud"
|
||||||
android:maxHeight="24dp"
|
android:maxHeight="24dp"
|
||||||
android:src="@drawable/ic_read_aloud"
|
app:icon="@drawable/ic_read_aloud"
|
||||||
|
app:iconGravity="textStart"
|
||||||
tools:ignore="NestedWeights" />
|
tools:ignore="NestedWeights" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_read_aloud"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:ellipsize="middle"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/read_aloud"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="2"
|
|
||||||
android:importantForAccessibility="no" />
|
|
||||||
|
|
||||||
<!--界面按钮-->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_font"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
|
||||||
android:clickable="true"
|
|
||||||
android:contentDescription="@string/interface_setting"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingBottom="4dp"
|
|
||||||
tools:ignore="VisualLintBounds">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_font"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:adjustViewBounds="true"
|
android:importantForAccessibility="no" />
|
||||||
android:contentDescription="@string/interface_setting"
|
|
||||||
android:maxHeight="24dp"
|
|
||||||
android:src="@drawable/ic_interface_setting"
|
|
||||||
tools:ignore="NestedWeights" />
|
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_font"
|
android:id="@+id/iv_catalog"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:ellipsize="middle"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:singleLine="true"
|
android:contentDescription="@string/chapter_list"
|
||||||
android:text="@string/interface_setting"
|
android:tooltipText="@string/chapter_list"
|
||||||
android:textSize="12sp" />
|
android:maxHeight="24dp"
|
||||||
</LinearLayout>
|
app:icon="@drawable/ic_toc"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
tools:ignore="NestedWeights" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="2"
|
android:layout_weight="1"
|
||||||
android:importantForAccessibility="no" />
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
<!--设置按钮-->
|
<com.google.android.material.button.MaterialButton
|
||||||
<LinearLayout
|
android:id="@+id/fabAutoPage"
|
||||||
android:id="@+id/ll_setting"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:clickable="true"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:contentDescription="@string/setting"
|
android:contentDescription="@string/auto_next_page"
|
||||||
android:focusable="true"
|
android:tooltipText="@string/auto_next_page"
|
||||||
android:orientation="vertical"
|
app:icon="@drawable/ic_auto_page"
|
||||||
android:gravity="center"
|
app:iconGravity="textStart"
|
||||||
android:paddingBottom="4dp"
|
tools:ignore="UnusedAttribute" />
|
||||||
tools:ignore="VisualLintBounds">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/iv_setting"
|
android:id="@+id/iv_setting"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/setting"
|
|
||||||
android:maxHeight="24dp"
|
|
||||||
android:src="@drawable/ic_settings"
|
|
||||||
tools:ignore="NestedWeights" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_setting"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
android:ellipsize="middle"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:singleLine="true"
|
android:contentDescription="@string/setting"
|
||||||
android:text="@string/setting"
|
android:tooltipText="@string/setting"
|
||||||
android:textSize="12sp" />
|
android:maxHeight="24dp"
|
||||||
</LinearLayout>
|
app:icon="@drawable/ic_settings"
|
||||||
|
app:iconGravity="textStart"
|
||||||
<View
|
tools:ignore="NestedWeights" />
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:importantForAccessibility="no" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -88,6 +88,16 @@
|
|||||||
android:title="@string/replace_rule_title"
|
android:title="@string/replace_rule_title"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_setting_replace"
|
||||||
|
android:title="@string/replace_rule_title_setting"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_effective_replaces"
|
||||||
|
android:title="@string/effective_replaces"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_same_title_removed"
|
android:id="@+id/menu_same_title_removed"
|
||||||
android:checkable="true"
|
android:checkable="true"
|
||||||
@@ -137,11 +147,6 @@
|
|||||||
android:title="@string/update_toc"
|
android:title="@string/update_toc"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_effective_replaces"
|
|
||||||
android:title="@string/effective_replaces"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_log"
|
android:id="@+id/menu_log"
|
||||||
android:title="@string/log"
|
android:title="@string/log"
|
||||||
|
|||||||
@@ -229,7 +229,7 @@
|
|||||||
<string name="import_select_book">导入选择书籍</string>
|
<string name="import_select_book">导入选择书籍</string>
|
||||||
<string name="threads_num_title">更新和搜索线程数(太多会卡顿)</string>
|
<string name="threads_num_title">更新和搜索线程数(太多会卡顿)</string>
|
||||||
<string name="change_icon">切换图标</string>
|
<string name="change_icon">切换图标</string>
|
||||||
<string name="remove_from_bookshelf">删除书籍</string>
|
<string name="remove_from_bookshelf">已在书架</string>
|
||||||
<string name="start_read">开始阅读</string>
|
<string name="start_read">开始阅读</string>
|
||||||
<string name="data_loading">加载数据中…</string>
|
<string name="data_loading">加载数据中…</string>
|
||||||
<string name="load_error_retry">加载失败,点击重试</string>
|
<string name="load_error_retry">加载失败,点击重试</string>
|
||||||
@@ -589,7 +589,7 @@
|
|||||||
<string name="remove_group">移除分组</string>
|
<string name="remove_group">移除分组</string>
|
||||||
<string name="add_replace_rule">新建替换</string>
|
<string name="add_replace_rule">新建替换</string>
|
||||||
<string name="group">分组</string>
|
<string name="group">分组</string>
|
||||||
<string name="group_s">分组:%s</string>
|
<string name="group_s">%s</string>
|
||||||
<string name="toc_s">已读:%s</string>
|
<string name="toc_s">已读:%s</string>
|
||||||
<string name="enable_explore">启用发现</string>
|
<string name="enable_explore">启用发现</string>
|
||||||
<string name="disable_explore">禁用发现</string>
|
<string name="disable_explore">禁用发现</string>
|
||||||
|
|||||||
@@ -1221,4 +1221,6 @@
|
|||||||
<string name="ungroup">未分组</string>
|
<string name="ungroup">未分组</string>
|
||||||
<string name="dynamic_colors">动态取色</string>
|
<string name="dynamic_colors">动态取色</string>
|
||||||
<string name="change_icon_success">图标已修改</string>
|
<string name="change_icon_success">图标已修改</string>
|
||||||
|
<string name="replace_rule_title_setting">配置替换规则</string>
|
||||||
|
<string name="more_setting">更多设置</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<io.legato.kazusa.lib.prefs.ThemeModePreference
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/theme_mode"
|
||||||
|
android:entryValues="@array/theme_mode_v"
|
||||||
|
android:key="themeMode"
|
||||||
|
android:title="@string/theme_mode"
|
||||||
|
android:summary="切换浅色/深色/跟随系统" />
|
||||||
|
|
||||||
<io.legato.kazusa.lib.prefs.NameListPreference
|
<io.legato.kazusa.lib.prefs.NameListPreference
|
||||||
android:defaultValue="0"
|
android:defaultValue="0"
|
||||||
android:entries="@array/screen_direction_title"
|
android:entries="@array/screen_direction_title"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<io.legato.kazusa.lib.prefs.PreferenceCategory
|
<io.legato.kazusa.lib.prefs.PreferenceCategory
|
||||||
android:title="@string/setting"
|
android:title="@string/setting"
|
||||||
app:allowDividerAbove="true"
|
app:allowDividerAbove="false"
|
||||||
app:allowDividerBelow="false"
|
app:allowDividerBelow="false"
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
app:layout="@layout/view_preference_category">
|
app:layout="@layout/view_preference_category">
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
<io.legato.kazusa.lib.prefs.PreferenceCategory
|
<io.legato.kazusa.lib.prefs.PreferenceCategory
|
||||||
android:title="规则"
|
android:title="规则"
|
||||||
app:allowDividerAbove="true"
|
app:allowDividerAbove="false"
|
||||||
app:allowDividerBelow="false"
|
app:allowDividerBelow="false"
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
app:layout="@layout/view_preference_category">
|
app:layout="@layout/view_preference_category">
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
<io.legato.kazusa.lib.prefs.PreferenceCategory
|
<io.legato.kazusa.lib.prefs.PreferenceCategory
|
||||||
android:key="aboutCategory"
|
android:key="aboutCategory"
|
||||||
android:title="@string/other"
|
android:title="@string/other"
|
||||||
app:allowDividerAbove="true"
|
app:allowDividerAbove="false"
|
||||||
app:allowDividerBelow="false"
|
app:allowDividerBelow="false"
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
app:layout="@layout/view_preference_category">
|
app:layout="@layout/view_preference_category">
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ media = "1.7.0"
|
|||||||
media3 = "1.6.1"
|
media3 = "1.6.1"
|
||||||
nanoHttpd = "2.3.1"
|
nanoHttpd = "2.3.1"
|
||||||
okhttp = "4.12.0"
|
okhttp = "4.12.0"
|
||||||
|
palette = "1.0.0"
|
||||||
preference = "1.2.1"
|
preference = "1.2.1"
|
||||||
protobufJavalite = "4.26.1"
|
protobufJavalite = "4.26.1"
|
||||||
quickChineseTransfer = "0.2.16"
|
quickChineseTransfer = "0.2.16"
|
||||||
@@ -65,6 +66,7 @@ androidx-annotation = { group = "androidx.annotation", name = "annotation", vers
|
|||||||
|
|
||||||
androidx-collection = { module = "androidx.collection:collection", version.ref = "collection" }
|
androidx-collection = { module = "androidx.collection:collection", version.ref = "collection" }
|
||||||
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
|
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
|
||||||
|
androidx-palette = { module = "androidx.palette:palette", version.ref = "palette" }
|
||||||
appcompat-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
|
appcompat-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
|
||||||
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
|
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user