更新与修复界面
修复一些设备的导航栏着色 增加删除单个书籍缓存功能 增加阅读记录封面显示 恢复一些默认动效
This commit is contained in:
@@ -13,6 +13,7 @@ import android.view.View
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.color.DynamicColors
|
||||
@@ -27,6 +28,8 @@ import io.legato.kazusa.utils.disableAutoFill
|
||||
import io.legato.kazusa.utils.getPrefString
|
||||
import io.legato.kazusa.utils.hideSoftInput
|
||||
import io.legato.kazusa.utils.observeEvent
|
||||
import io.legato.kazusa.utils.setNavigationBarColorAuto
|
||||
import io.legato.kazusa.utils.themeColor
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import io.legato.kazusa.utils.windowSize
|
||||
|
||||
@@ -69,7 +72,9 @@ abstract class BaseActivity<VB : ViewBinding>(
|
||||
window.decorView.disableAutoFill()
|
||||
AppContextWrapper.applyLocaleAndFont(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
enableEdgeToEdge()
|
||||
window.setNavigationBarColorAuto(themeColor(com.google.android.material.R.attr.colorSurface))
|
||||
//setupSystemBar()
|
||||
setContentView(binding.root)
|
||||
upBackgroundImage()
|
||||
@@ -152,15 +157,6 @@ abstract class BaseActivity<VB : ViewBinding>(
|
||||
}
|
||||
}
|
||||
|
||||
open fun upNavigationBarColor() {
|
||||
// if (AppConfig.immNavigationBar) {
|
||||
// setNavigationBarColorAuto(ThemeStore.navigationBarColor(this))
|
||||
// } else {
|
||||
// val nbColor = ColorUtils.darkenColor(ThemeStore.navigationBarColor(this))
|
||||
// setNavigationBarColorAuto(nbColor)
|
||||
// }
|
||||
}
|
||||
|
||||
open fun observeLiveBus() {
|
||||
observeEvent<String>(EventBus.RECREATE) {
|
||||
recreate()
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import io.legato.kazusa.constant.AppLog
|
||||
import io.legato.kazusa.help.coroutine.Coroutine
|
||||
import io.legato.kazusa.utils.setNavigationBarColorAuto
|
||||
import io.legato.kazusa.utils.themeColor
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
@@ -28,6 +30,7 @@ abstract class BaseBottomSheetDialogFragment(
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.setNavigationBarColorAuto(requireContext().themeColor(com.google.android.material.R.attr.colorSurfaceContainer))
|
||||
if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
val screenHeight = resources.displayMetrics.heightPixels
|
||||
(dialog as? BottomSheetDialog)?.behavior?.apply {
|
||||
@@ -38,7 +41,6 @@ abstract class BaseBottomSheetDialogFragment(
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
onFragmentCreated(view, savedInstanceState)
|
||||
observeLiveBus()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package io.legato.kazusa.data.dao
|
||||
|
||||
import androidx.room.*
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import io.legato.kazusa.data.entities.ReadRecord
|
||||
import io.legato.kazusa.data.entities.ReadRecordShow
|
||||
|
||||
@@ -38,6 +43,7 @@ interface ReadRecordDao {
|
||||
@Query("select readTime from readRecord where deviceId = :androidId and bookName = :bookName")
|
||||
fun getReadTime(androidId: String, bookName: String): Long?
|
||||
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insert(vararg readRecord: ReadRecord)
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import io.legato.kazusa.databinding.ItemReadRecordBinding
|
||||
import io.legato.kazusa.help.config.AppConfig
|
||||
import io.legato.kazusa.help.config.LocalConfig
|
||||
import io.legato.kazusa.lib.dialogs.alert
|
||||
import io.legato.kazusa.model.BookCover
|
||||
//import io.legado.app.lib.theme.primaryTextColor
|
||||
import io.legato.kazusa.ui.book.search.SearchActivity
|
||||
import io.legato.kazusa.utils.applyNavigationBarPadding
|
||||
@@ -157,7 +158,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
|
||||
inner class RecordAdapter(context: Context) :
|
||||
RecyclerAdapter<ReadRecordShow, ItemReadRecordBinding>(context) {
|
||||
|
||||
private val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
private val dateFormat = SimpleDateFormat("yyyy年MM月dd日", Locale.getDefault())
|
||||
|
||||
override fun getViewBinding(parent: ViewGroup): ItemReadRecordBinding {
|
||||
return ItemReadRecordBinding.inflate(inflater, parent, false)
|
||||
@@ -175,7 +176,17 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
|
||||
if (item.lastRead > 0) {
|
||||
tvLastReadTime.text = dateFormat.format(item.lastRead)
|
||||
} else {
|
||||
tvLastReadTime.text = ""
|
||||
tvLastReadTime.text = "时间未知"
|
||||
}
|
||||
|
||||
lifecycleScope.launch {
|
||||
val book = withContext(IO) {
|
||||
appDb.bookDao.findByName(item.bookName).firstOrNull()
|
||||
}
|
||||
if (book != null) {
|
||||
BookCover.load(root.context, book.getDisplayCover(), false, book.origin)
|
||||
.into(ivCover)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ import io.legato.kazusa.ui.about.AppLogDialog
|
||||
import io.legato.kazusa.ui.file.HandleFileContract
|
||||
import io.legato.kazusa.utils.ACache
|
||||
import io.legato.kazusa.utils.FileDoc
|
||||
import io.legato.kazusa.utils.applyNavigationBarPadding
|
||||
import io.legato.kazusa.utils.applyOpenTint
|
||||
import io.legato.kazusa.utils.applyTint
|
||||
import io.legato.kazusa.utils.checkWrite
|
||||
@@ -233,7 +232,6 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
|
||||
private fun initRecyclerView() {
|
||||
binding.recyclerView.layoutManager = layoutManager
|
||||
binding.recyclerView.adapter = adapter
|
||||
binding.recyclerView.applyNavigationBarPadding()
|
||||
}
|
||||
|
||||
private fun initBookData() {
|
||||
@@ -345,6 +343,11 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
|
||||
}
|
||||
}
|
||||
|
||||
override fun deleteDownload(book: Book) {
|
||||
viewModel.clearCacheForBook(book)
|
||||
notifyItemChanged(book.bookUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置自定义导出对话框
|
||||
*
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.legato.kazusa.ui.book.cache
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
@@ -47,8 +49,10 @@ class CacheAdapter(context: Context, private val callBack: CallBack) :
|
||||
if (payloads.isEmpty()) {
|
||||
tvName.text = item.name
|
||||
tvAuthor.text = context.getString(R.string.author_show, item.getRealAuthor())
|
||||
|
||||
if (item.isLocal) {
|
||||
tvDownload.setText(R.string.local_book)
|
||||
progressDownload.gone()
|
||||
} else {
|
||||
val cs = callBack.cacheChapters[item.bookUrl]
|
||||
if (cs == null) {
|
||||
@@ -67,8 +71,22 @@ class CacheAdapter(context: Context, private val callBack: CallBack) :
|
||||
tvDownload.setText(R.string.local_book)
|
||||
} else {
|
||||
val cacheSize = callBack.cacheChapters[item.bookUrl]?.size ?: 0
|
||||
val cacheTask = CacheBook.cacheBookMap[item.bookUrl]
|
||||
tvDownload.text =
|
||||
context.getString(R.string.download_count, cacheSize, item.totalChapterNum)
|
||||
|
||||
if (cacheTask != null && !cacheTask.isStop()) {
|
||||
val progress = if (item.totalChapterNum > 0) {
|
||||
(cacheSize * 100 / item.totalChapterNum)
|
||||
} else {
|
||||
0
|
||||
}
|
||||
tvMsg.gone()
|
||||
progressDownload.progress = progress
|
||||
progressDownload.visible()
|
||||
} else {
|
||||
progressDownload.gone()
|
||||
}
|
||||
}
|
||||
}
|
||||
upDownloadIv(ivDownload, item)
|
||||
@@ -94,6 +112,23 @@ class CacheAdapter(context: Context, private val callBack: CallBack) :
|
||||
tvExport.setOnClickListener {
|
||||
callBack.export(holder.layoutPosition)
|
||||
}
|
||||
ivDelete.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let { book ->
|
||||
CacheBook.cacheBookMap[book.bookUrl]?.let {
|
||||
if (!it.isStop()) {
|
||||
CacheBook.remove(context, book.bookUrl)
|
||||
Handler(Looper.getMainLooper()).postDelayed({
|
||||
callBack.deleteDownload(book)
|
||||
}, 500)
|
||||
} else {
|
||||
callBack.deleteDownload(book)
|
||||
}
|
||||
} ?: run {
|
||||
callBack.deleteDownload(book)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,5 +173,7 @@ class CacheAdapter(context: Context, private val callBack: CallBack) :
|
||||
fun export(position: Int)
|
||||
fun exportProgress(bookUrl: String): Int?
|
||||
fun exportMsg(bookUrl: String): String?
|
||||
fun deleteDownload(book: Book)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import io.legato.kazusa.help.book.isLocal
|
||||
import io.legato.kazusa.help.coroutine.Coroutine
|
||||
import io.legato.kazusa.utils.sendValue
|
||||
import kotlinx.coroutines.ensureActive
|
||||
import kotlin.collections.set
|
||||
|
||||
|
||||
class CacheViewModel(application: Application) : BaseViewModel(application) {
|
||||
@@ -43,4 +42,10 @@ class CacheViewModel(application: Application) : BaseViewModel(application) {
|
||||
}
|
||||
}
|
||||
|
||||
fun clearCacheForBook(book: Book) {
|
||||
BookHelp.clearCache(book)
|
||||
cacheChapters[book.bookUrl] = hashSetOf()
|
||||
upAdapterLiveData.sendValue(book.bookUrl)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,26 +64,33 @@ class GroupEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_book_gro
|
||||
}
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||
sortOptions = resources.getStringArray(R.array.book_sort).toList()
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
bookGroup = arguments?.getParcelable("group")
|
||||
bookGroup?.let {
|
||||
binding.btnDelete.isEnabled = (it.groupId > 0 || it.groupId == Long.MIN_VALUE)
|
||||
binding.tieGroupName.setText(it.groupName)
|
||||
if (bookGroup?.cover != null)
|
||||
binding.ivCover.load(it.cover)
|
||||
binding.cbEnableRefresh.isChecked = it.enableRefresh
|
||||
if (it.bookSort in sortOptions.indices) {
|
||||
selectedSortIndex = it.bookSort
|
||||
binding.chipSortMenu.text = sortOptions[selectedSortIndex]
|
||||
|
||||
bookGroup?.let { group ->
|
||||
binding.btnDelete.isEnabled = (group.groupId > 0 || group.groupId == Long.MIN_VALUE)
|
||||
binding.tieGroupName.setText(group.groupName)
|
||||
if (group.cover != null) {
|
||||
binding.ivCover.load(group.cover)
|
||||
}
|
||||
} ?: let {
|
||||
binding.cbEnableRefresh.isChecked = group.enableRefresh
|
||||
|
||||
selectedSortIndex = if (group.bookSort in sortOptions.indices) {
|
||||
group.bookSort
|
||||
} else {
|
||||
0
|
||||
}
|
||||
binding.chipSortMenu.text = sortOptions[selectedSortIndex]
|
||||
} ?: run {
|
||||
binding.btnDelete.gone()
|
||||
binding.ivCover.load()
|
||||
selectedSortIndex = 0
|
||||
binding.chipSortMenu.text = sortOptions[selectedSortIndex]
|
||||
}
|
||||
|
||||
|
||||
binding.run {
|
||||
chipSortMenu.setOnClickListener { chip ->
|
||||
PopupMenu(requireContext(), chip).apply {
|
||||
|
||||
@@ -2,11 +2,8 @@ package io.legato.kazusa.ui.book.info
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.RenderEffect
|
||||
import android.graphics.Shader
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
@@ -18,7 +15,6 @@ import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.activity.viewModels
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.palette.graphics.Palette
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.VMBaseActivity
|
||||
import io.legato.kazusa.constant.BookType
|
||||
@@ -64,6 +60,7 @@ import io.legato.kazusa.utils.ConvertUtils
|
||||
import io.legato.kazusa.utils.FileDoc
|
||||
import io.legato.kazusa.utils.GSON
|
||||
import io.legato.kazusa.utils.StartActivityContract
|
||||
import io.legato.kazusa.utils.applyNavigationBarMargin
|
||||
import io.legato.kazusa.utils.dpToPx
|
||||
import io.legato.kazusa.utils.gone
|
||||
import io.legato.kazusa.utils.longToastOnUi
|
||||
@@ -75,7 +72,6 @@ import io.legato.kazusa.utils.startActivity
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
import io.legato.kazusa.utils.visible
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
@@ -158,7 +154,7 @@ class BookInfoActivity :
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setSupportActionBar(binding.topBar)
|
||||
|
||||
binding.llRead?.applyNavigationBarMargin()
|
||||
// binding.refreshLayout?.setColorSchemeColors(accentColor)
|
||||
// binding.llInfo.setBackgroundColor(backgroundColor)
|
||||
// binding.flAction.setBackgroundColor(bottomBackground)
|
||||
@@ -786,16 +782,4 @@ 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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,6 +44,7 @@ import io.legato.kazusa.utils.setLightStatusBar
|
||||
import io.legato.kazusa.utils.setNavigationBarColorAuto
|
||||
import io.legato.kazusa.utils.setOnApplyWindowInsetsListenerCompat
|
||||
import io.legato.kazusa.utils.showDialogFragment
|
||||
import io.legato.kazusa.utils.themeColor
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
import java.time.LocalDate
|
||||
import java.time.format.DateTimeFormatter
|
||||
@@ -211,14 +212,14 @@ abstract class BaseReadBookActivity :
|
||||
window.decorView.systemUiVisibility = flag
|
||||
}
|
||||
|
||||
override fun upNavigationBarColor() {
|
||||
fun upNavigationBarColor() {
|
||||
upNavigationBar()
|
||||
when {
|
||||
binding.readMenu.isVisible -> super.upNavigationBarColor()
|
||||
binding.searchMenu.bottomMenuVisible -> super.upNavigationBarColor()
|
||||
bottomDialog > 0 -> super.upNavigationBarColor()
|
||||
binding.readMenu.isVisible -> window.setNavigationBarColorAuto(themeColor(com.google.android.material.R.attr.colorSurfaceContainer))
|
||||
binding.searchMenu.bottomMenuVisible -> window.setNavigationBarColorAuto(themeColor(com.google.android.material.R.attr.colorSurface))
|
||||
bottomDialog > 0 -> window.setNavigationBarColorAuto(themeColor(com.google.android.material.R.attr.colorSurface))
|
||||
//!AppConfig.immNavigationBar -> super.upNavigationBarColor()
|
||||
else -> setNavigationBarColorAuto(ReadBookConfig.bgMeanColor)
|
||||
else -> window.setNavigationBarColorAuto(ReadBookConfig.bgMeanColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
package io.legato.kazusa.ui.book.read.config
|
||||
|
||||
//import io.legado.app.lib.theme.bottomBackground
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.DialogInterface
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewConfiguration
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BasePrefDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.constant.EventBus
|
||||
import io.legato.kazusa.constant.PreferKey
|
||||
import io.legato.kazusa.help.config.AppConfig
|
||||
import io.legato.kazusa.help.config.ReadBookConfig
|
||||
import io.legato.kazusa.lib.prefs.fragment.PreferenceFragment
|
||||
//import io.legado.app.lib.theme.bottomBackground
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import io.legato.kazusa.model.ReadBook
|
||||
import io.legato.kazusa.ui.book.read.ReadBookActivity
|
||||
import io.legato.kazusa.ui.book.read.page.provider.ChapterProvider
|
||||
@@ -29,31 +25,23 @@ import io.legato.kazusa.utils.getPrefBoolean
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
import io.legato.kazusa.utils.removePref
|
||||
|
||||
class MoreConfigDialog : BasePrefDialogFragment() {
|
||||
class MoreConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_more_config) {
|
||||
private val readPreferTag = "readPreferenceFragment"
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
(activity as ReadBookActivity).bottomDialog++
|
||||
val view = LinearLayout(context)
|
||||
//view.setBackgroundColor(requireContext().bottomBackground)
|
||||
view.id = R.id.tag1
|
||||
container?.addView(view)
|
||||
return view
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
(activity as? ReadBookActivity)?.bottomDialog++
|
||||
var preferenceFragment = childFragmentManager.findFragmentByTag(readPreferTag)
|
||||
if (preferenceFragment == null) preferenceFragment = ReadPreferenceFragment()
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(view.id, preferenceFragment, readPreferTag)
|
||||
.replace(R.id.containerPreferences, preferenceFragment, readPreferTag)
|
||||
.commit()
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
(activity as ReadBookActivity).bottomDialog--
|
||||
}
|
||||
|
||||
class ReadPreferenceFragment : PreferenceFragmentCompat(),
|
||||
SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
@@ -69,11 +57,6 @@ class MoreConfigDialog : BasePrefDialogFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
//listView.setEdgeEffectColor(primaryColor)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
preferenceManager
|
||||
|
||||
@@ -15,17 +15,6 @@ class PaddingConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_p
|
||||
|
||||
private val binding by viewBinding(DialogReadPaddingBinding::bind)
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
// dialog?.window?.let {
|
||||
// it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
|
||||
// val attr = it.attributes
|
||||
// attr.dimAmount = 0.0f
|
||||
// it.attributes = attr
|
||||
// }
|
||||
// setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
initData()
|
||||
initView()
|
||||
|
||||
@@ -22,9 +22,9 @@ import io.legato.kazusa.model.ReadBook
|
||||
import io.legato.kazusa.ui.book.read.ReadBookActivity
|
||||
import io.legato.kazusa.ui.font.FontSelectDialog
|
||||
import io.legato.kazusa.utils.ChineseUtils
|
||||
import io.legato.kazusa.utils.dpToPx
|
||||
import io.legato.kazusa.utils.postEvent
|
||||
import io.legato.kazusa.utils.showDialogFragment
|
||||
import io.legato.kazusa.utils.themeColor
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
|
||||
class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_style),
|
||||
@@ -48,13 +48,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
}
|
||||
|
||||
private fun initView() = binding.run {
|
||||
//val bg = requireContext().bottomBackground
|
||||
//val isLight = ColorUtils.isColorLight(bg)
|
||||
//val textColor = requireContext().getPrimaryTextColor(isLight)
|
||||
// rootView.setBackgroundColor(bg)
|
||||
// tvPageAnim.setTextColor(textColor)
|
||||
// tvBgTs.setTextColor(textColor)
|
||||
// tvShareLayout.setTextColor(textColor)
|
||||
if (AppConfig.isNightTheme) {
|
||||
tvDayNight.setIconResource(R.drawable.ic_daytime)
|
||||
} else {
|
||||
@@ -72,10 +65,6 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
rvStyle.adapter = styleAdapter
|
||||
styleAdapter.addFooterView {
|
||||
ItemReadStyleBinding.inflate(layoutInflater, it, false).apply {
|
||||
// ivStyle.setPadding(6.dpToPx(), 6.dpToPx(), 6.dpToPx(), 6.dpToPx())
|
||||
// ivStyle.setText(null)
|
||||
// ivStyle.setColorFilter(textColor)
|
||||
// ivStyle.borderColor = textColor
|
||||
ivStyle.setImageResource(R.drawable.ic_add)
|
||||
root.setOnClickListener {
|
||||
ReadBookConfig.configList.add(ReadBookConfig.Config())
|
||||
@@ -235,11 +224,15 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
ivStyle.setImageDrawable(item.curBgDrawable(100, 150))
|
||||
if (ReadBookConfig.styleSelect == holder.layoutPosition) {
|
||||
llStyle.gravity = Gravity.TOP
|
||||
cdStyle.strokeColor =
|
||||
context.themeColor(com.google.android.material.R.attr.colorTertiary)
|
||||
rvStyle.setCardBackgroundColor(context.themeColor(com.google.android.material.R.attr.colorTertiary))
|
||||
cdStyle.cardElevation = 1f.dpToPx()
|
||||
cdStyle.radius = 16f.dpToPx()
|
||||
cdStyle.strokeWidth = 2
|
||||
cdStyle.strokeColor = item.curTextColor()
|
||||
//tvStyle.setTextBold(true)
|
||||
} else {
|
||||
cdStyle.cardElevation = 2f.dpToPx()
|
||||
cdStyle.radius = 32f.dpToPx()
|
||||
cdStyle.strokeWidth = 0
|
||||
cdStyle.strokeColor = item.curTextColor()
|
||||
//tvStyle.setTextBold(false)
|
||||
}
|
||||
|
||||
@@ -13,8 +13,13 @@ class HistoryKeyAdapter(activity: SearchActivity, val callBack: CallBack) :
|
||||
|
||||
private val explosionField = ExplosionField.attach2Window(activity)
|
||||
|
||||
init {
|
||||
setHasStableIds(true)
|
||||
}
|
||||
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
return position.toLong()
|
||||
return getItem(position)!!.lastUseTime
|
||||
}
|
||||
|
||||
override fun getViewBinding(parent: ViewGroup): ItemSearchHistoryBinding {
|
||||
@@ -33,6 +38,7 @@ class HistoryKeyAdapter(activity: SearchActivity, val callBack: CallBack) :
|
||||
}
|
||||
|
||||
override fun registerListener(holder: ItemViewHolder, binding: ItemSearchHistoryBinding) {
|
||||
|
||||
holder.itemView.apply {
|
||||
setOnClickListener {
|
||||
getItemByLayoutPosition(holder.layoutPosition)?.let {
|
||||
|
||||
@@ -12,9 +12,11 @@ import androidx.core.os.bundleOf
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.widget.doAfterTextChanged
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.search.SearchBar
|
||||
import com.google.android.material.search.SearchView
|
||||
import io.legato.kazusa.R
|
||||
@@ -30,7 +32,6 @@ import io.legato.kazusa.ui.about.AppLogDialog
|
||||
import io.legato.kazusa.ui.book.info.BookInfoActivity
|
||||
import io.legato.kazusa.ui.book.source.manage.BookSourceActivity
|
||||
import io.legato.kazusa.utils.applyNavigationBarMargin
|
||||
import io.legato.kazusa.utils.applyNavigationBarPadding
|
||||
import io.legato.kazusa.utils.applyStatusBarPadding
|
||||
import io.legato.kazusa.utils.getPrefBoolean
|
||||
import io.legato.kazusa.utils.gone
|
||||
@@ -84,6 +85,8 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
setSupportActionBar(binding.searchBar)
|
||||
initRecyclerView()
|
||||
initMaterialSearch()
|
||||
@@ -177,6 +180,26 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
|
||||
binding.appBar.applyStatusBarPadding()
|
||||
|
||||
binding.appBar.post {
|
||||
val maxPaddingTop = binding.appBar.paddingTop
|
||||
binding.appBar.addOnOffsetChangedListener(
|
||||
AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset ->
|
||||
val totalScrollRange = appBarLayout.totalScrollRange
|
||||
val scrollRatio =
|
||||
(1f - (abs(verticalOffset).toFloat() / totalScrollRange)).coerceIn(0f, 1f)
|
||||
|
||||
appBarLayout.alpha = scrollRatio
|
||||
appBarLayout.setPadding(
|
||||
appBarLayout.paddingLeft,
|
||||
(maxPaddingTop * scrollRatio).toInt(),
|
||||
appBarLayout.paddingRight,
|
||||
appBarLayout.paddingBottom
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
searchBar.setOnMenuItemClickListener { item ->
|
||||
onCompatOptionsItemSelected(item)
|
||||
}
|
||||
@@ -215,7 +238,6 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
|
||||
searchView.addTransitionListener { _, _, newState ->
|
||||
if (newState == SearchView.TransitionState.HIDDEN) {
|
||||
// 当 SearchView 关闭时,将搜索文本设置回 SearchBar
|
||||
searchBar.setText(searchView.text)
|
||||
}
|
||||
}
|
||||
@@ -232,14 +254,16 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
private fun initRecyclerView() {
|
||||
binding.rvBookshelfSearch.layoutManager = FlexboxLayoutManager(this)
|
||||
binding.rvBookshelfSearch.adapter = bookAdapter
|
||||
binding.rvBookshelfSearch.applyNavigationBarMargin()
|
||||
binding.rvBookshelfSearch.itemAnimator = DefaultItemAnimator()
|
||||
|
||||
binding.rvHistoryKey.layoutManager = FlexboxLayoutManager(this)
|
||||
binding.rvHistoryKey.adapter = historyKeyAdapter
|
||||
binding.rvHistoryKey.applyNavigationBarMargin()
|
||||
binding.rvHistoryKey.itemAnimator = DefaultItemAnimator()
|
||||
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
binding.recyclerView.adapter = adapter
|
||||
binding.recyclerView.itemAnimator = null
|
||||
binding.recyclerView.applyNavigationBarPadding()
|
||||
binding.recyclerView.itemAnimator = DefaultItemAnimator()
|
||||
|
||||
adapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
|
||||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||
super.onItemRangeInserted(positionStart, itemCount)
|
||||
@@ -279,6 +303,7 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
}
|
||||
|
||||
private fun initOtherView() {
|
||||
binding.llStop.applyNavigationBarMargin()
|
||||
binding.fbStartStop.setOnClickListener {
|
||||
if (viewModel.isSearchLiveData.value == true) {
|
||||
isManualStopSearch = true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.legato.kazusa.ui.book.search
|
||||
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
@@ -8,7 +9,7 @@ import androidx.appcompat.widget.SearchView
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.base.adapter.ItemViewHolder
|
||||
import io.legato.kazusa.constant.AppLog
|
||||
import io.legato.kazusa.data.AppDatabase
|
||||
@@ -17,10 +18,7 @@ import io.legato.kazusa.data.entities.BookSourcePart
|
||||
import io.legato.kazusa.databinding.DialogSearchScopeBinding
|
||||
import io.legato.kazusa.databinding.ItemCheckBoxBinding
|
||||
import io.legato.kazusa.databinding.ItemRadioButtonBinding
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import io.legato.kazusa.utils.applyTint
|
||||
import io.legato.kazusa.utils.flowWithLifecycleAndDatabaseChange
|
||||
import io.legato.kazusa.utils.setLayout
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -31,7 +29,7 @@ import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
class SearchScopeDialog : BaseBottomSheetDialogFragment(R.layout.dialog_search_scope) {
|
||||
|
||||
private val binding by viewBinding(DialogSearchScopeBinding::bind)
|
||||
private var sourceFlowJob: Job? = null
|
||||
@@ -44,13 +42,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
RecyclerAdapter()
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
setLayout(0.9f, 0.8f)
|
||||
}
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||
binding.recyclerView.adapter = adapter
|
||||
initMenu()
|
||||
initSearchView()
|
||||
@@ -60,7 +52,6 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
|
||||
private fun initMenu() {
|
||||
binding.toolBar.inflateMenu(R.menu.book_search_scope)
|
||||
//binding.toolBar.menu.applyTint(requireContext())
|
||||
}
|
||||
|
||||
private fun initSearchView() {
|
||||
@@ -80,17 +71,24 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
}
|
||||
|
||||
private fun initOtherView() {
|
||||
binding.rgScope.setOnCheckedChangeListener { _, checkedId ->
|
||||
binding.toolBar.menu.findItem(R.id.menu_screen)?.isVisible = checkedId == R.id.rb_source
|
||||
upData()
|
||||
|
||||
binding.rgScope.addOnButtonCheckedListener { group, checkedId, isChecked ->
|
||||
if (isChecked) {
|
||||
binding.toolBar.menu.findItem(R.id.menu_screen)?.isVisible =
|
||||
checkedId == R.id.rb_source
|
||||
upData()
|
||||
}
|
||||
}
|
||||
|
||||
binding.tvCancel.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.tvAllSource.setOnClickListener {
|
||||
callback.onSearchScopeOk(SearchScope(""))
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.tvOk.setOnClickListener {
|
||||
if (binding.rbGroup.isChecked) {
|
||||
callback.onSearchScopeOk(SearchScope(adapter.selectGroups))
|
||||
@@ -104,6 +102,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package io.legato.kazusa.ui.login
|
||||
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.text.InputType
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.setPadding
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.script.rhino.runScriptWithContext
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.base.BaseDialogFragment
|
||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||
import io.legato.kazusa.constant.AppLog
|
||||
import io.legato.kazusa.data.entities.BaseSource
|
||||
import io.legato.kazusa.data.entities.rule.RowUi
|
||||
@@ -18,16 +17,13 @@ import io.legato.kazusa.databinding.DialogLoginBinding
|
||||
import io.legato.kazusa.databinding.ItemFilletTextBinding
|
||||
import io.legato.kazusa.databinding.ItemSourceEditBinding
|
||||
import io.legato.kazusa.lib.dialogs.alert
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import io.legato.kazusa.ui.about.AppLogDialog
|
||||
import io.legato.kazusa.utils.GSON
|
||||
import io.legato.kazusa.utils.applyTint
|
||||
import io.legato.kazusa.utils.dpToPx
|
||||
import io.legato.kazusa.utils.isAbsUrl
|
||||
import io.legato.kazusa.utils.openUrl
|
||||
import io.legato.kazusa.utils.printOnDebug
|
||||
import io.legato.kazusa.utils.sendToClip
|
||||
import io.legato.kazusa.utils.setLayout
|
||||
import io.legato.kazusa.utils.showDialogFragment
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
@@ -40,16 +36,11 @@ import splitties.init.appCtx
|
||||
import splitties.views.onClick
|
||||
|
||||
|
||||
class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login, true) {
|
||||
class SourceLoginDialog : BaseBottomSheetDialogFragment(R.layout.dialog_login) {
|
||||
|
||||
private val binding by viewBinding(DialogLoginBinding::bind)
|
||||
private val viewModel by activityViewModels<SourceLoginViewModel>()
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
|
||||
}
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
val source = viewModel.source ?: return
|
||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||
@@ -91,7 +82,7 @@ class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login, true) {
|
||||
rowUi.style().apply(it.root)
|
||||
it.root.id = index + 1000
|
||||
it.textView.text = rowUi.name
|
||||
it.textView.setPadding(16.dpToPx())
|
||||
|
||||
it.root.onClick {
|
||||
handleButtonClick(source, rowUi, loginUi)
|
||||
}
|
||||
|
||||
@@ -48,8 +48,10 @@ import io.legato.kazusa.utils.gone
|
||||
import io.legato.kazusa.utils.hideSoftInput
|
||||
import io.legato.kazusa.utils.isCreated
|
||||
import io.legato.kazusa.utils.observeEvent
|
||||
import io.legato.kazusa.utils.setNavigationBarColorAuto
|
||||
import io.legato.kazusa.utils.shouldHideSoftInput
|
||||
import io.legato.kazusa.utils.showDialogFragment
|
||||
import io.legato.kazusa.utils.themeColor
|
||||
import io.legato.kazusa.utils.toastOnUi
|
||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||
import io.legato.kazusa.utils.visible
|
||||
@@ -203,23 +205,16 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
|
||||
}
|
||||
|
||||
private fun initView() = binding.run {
|
||||
//viewPagerMain.setEdgeEffectColor(primaryColor)
|
||||
viewPagerMain.offscreenPageLimit = 3
|
||||
viewPagerMain.adapter = adapter
|
||||
viewPagerMain.addOnPageChangeListener(PageChangeCallback())
|
||||
//bottomNavigationView.elevation = elevation
|
||||
getNavigationBarView().apply {
|
||||
setOnItemSelectedListener { onNavigationItemSelected(it) }
|
||||
setOnItemReselectedListener { onNavigationItemReselected(it) }
|
||||
}
|
||||
|
||||
//getNavigationBarView().applyNavigationBarPadding()
|
||||
|
||||
// bottomNavigationView.setOnApplyWindowInsetsListenerCompat { view, windowInsets ->
|
||||
// val height = windowInsets.navigationBarHeight
|
||||
// view.bottomPadding = height
|
||||
// windowInsets.inset(0, 0, 0, height)
|
||||
// }
|
||||
window.setNavigationBarColorAuto(themeColor(com.google.android.material.R.attr.colorSurfaceContainer))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.legato.kazusa.ui.widget.text
|
||||
|
||||
//import io.legado.app.lib.theme.accentColor
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
@@ -9,11 +10,10 @@ import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.textfield.MaterialAutoCompleteTextView
|
||||
import io.legato.kazusa.R
|
||||
//import io.legado.app.lib.theme.accentColor
|
||||
import io.legato.kazusa.utils.gone
|
||||
import io.legato.kazusa.utils.visible
|
||||
|
||||
@@ -63,7 +63,7 @@ class AutoCompleteTextView @JvmOverloads constructor(
|
||||
.inflate(R.layout.item_1line_text_and_del, parent, false)
|
||||
val textView = view.findViewById<TextView>(R.id.text_view)
|
||||
textView.text = getItem(position)
|
||||
val ivDelete = view.findViewById<ImageView>(R.id.iv_delete)
|
||||
val ivDelete = view.findViewById<MaterialButton>(R.id.iv_delete)
|
||||
if (delCallBack != null) ivDelete.visible() else ivDelete.gone()
|
||||
ivDelete.setOnClickListener {
|
||||
getItem(position)?.let {
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.util.DisplayMetrics
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowInsets
|
||||
import android.view.WindowInsetsController
|
||||
import android.view.WindowManager
|
||||
@@ -144,11 +145,12 @@ fun Activity.setLightStatusBar(isLightBar: Boolean) {
|
||||
* 设置导航栏颜色
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
fun Activity.setNavigationBarColorAuto(@ColorInt color: Int) {
|
||||
fun Window.setNavigationBarColorAuto(@ColorInt color: Int) {
|
||||
val isLightBor = ColorUtils.isColorLight(color)
|
||||
window.navigationBarColor = color
|
||||
navigationBarColor = color
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.insetsController?.let {
|
||||
insetsController?.let {
|
||||
if (isLightBor) {
|
||||
it.setSystemBarsAppearance(
|
||||
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS,
|
||||
@@ -162,9 +164,9 @@ fun Activity.setNavigationBarColorAuto(@ColorInt color: Int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val decorView = window.decorView
|
||||
if (Build.VERSION.SDK_INT in Build.VERSION_CODES.O..Build.VERSION_CODES.Q) {
|
||||
var systemUiVisibility = decorView.systemUiVisibility
|
||||
systemUiVisibility = if (isLightBor) {
|
||||
systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
||||
@@ -175,6 +177,7 @@ fun Activity.setNavigationBarColorAuto(@ColorInt color: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun Activity.keepScreenOn(on: Boolean) {
|
||||
val isScreenOn =
|
||||
(window.attributes.flags and WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0
|
||||
|
||||
@@ -302,7 +302,7 @@ fun View.canScroll(direction: Int): Boolean {
|
||||
return canScrollVertically(direction) || canScrollHorizontally(direction)
|
||||
}
|
||||
|
||||
private val requestLayoutBroken = Build.VERSION.SDK_INT <= Build.VERSION_CODES.M
|
||||
private val requestLayoutBroken = false
|
||||
|| Build.VERSION.SDK_INT in Build.VERSION_CODES.O..Build.VERSION_CODES.Q
|
||||
|
||||
fun View.setOnApplyWindowInsetsListenerCompat(listener: (View, WindowInsetsCompat) -> WindowInsetsCompat) {
|
||||
|
||||
@@ -363,7 +363,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:minWidth="0dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="@string/reading"
|
||||
android:textColor="?attr/colorOnPrimary"
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_pre"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_next"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
@@ -204,7 +204,7 @@
|
||||
android:id="@+id/fabSearch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/search_content"
|
||||
android:tooltipText="@string/search_content"
|
||||
app:icon="@drawable/ic_search"
|
||||
@@ -214,7 +214,7 @@
|
||||
android:id="@+id/iv_read_aloud"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/read_aloud"
|
||||
android:maxHeight="24dp"
|
||||
app:icon="@drawable/ic_read_aloud"
|
||||
@@ -225,7 +225,7 @@
|
||||
android:id="@+id/iv_catalog"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/chapter_list"
|
||||
android:tooltipText="@string/chapter_list"
|
||||
android:maxHeight="24dp"
|
||||
@@ -237,7 +237,7 @@
|
||||
android:id="@+id/fabAutoPage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/auto_next_page"
|
||||
android:tooltipText="@string/auto_next_page"
|
||||
app:icon="@drawable/ic_auto_page"
|
||||
@@ -248,7 +248,7 @@
|
||||
android:id="@+id/iv_setting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/setting"
|
||||
android:tooltipText="@string/setting"
|
||||
android:maxHeight="24dp"
|
||||
|
||||
@@ -338,19 +338,27 @@
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/btn_read"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_read"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="56dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="@string/reading"
|
||||
android:textColor="?attr/colorOnPrimary"
|
||||
android:contentDescription="@string/reading"
|
||||
app:icon="@drawable/ic_bottom_books"
|
||||
app:backgroundTint="?attr/colorTertiary"
|
||||
app:iconTint="?attr/colorOnPrimary" />
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/btn_read"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="@string/reading"
|
||||
android:minWidth="56dp"
|
||||
android:text="@string/reading"
|
||||
android:textColor="?attr/colorOnPrimary"
|
||||
app:backgroundTint="?attr/colorTertiary"
|
||||
app:icon="@drawable/ic_bottom_books"
|
||||
app:iconTint="?attr/colorOnPrimary" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -1,80 +1,110 @@
|
||||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.book.search.SearchActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="?attr/colorSurface"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.search.SearchBar
|
||||
android:id="@+id/search_bar"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/search_book_key"
|
||||
app:menu="@menu/book_search"
|
||||
app:navigationIconTint="?attr/colorOnSurface" />
|
||||
android:backgroundTint="?attr/colorSurface"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/refresh_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar">
|
||||
<com.google.android.material.search.SearchBar
|
||||
android:id="@+id/search_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/search_book_key"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:menu="@menu/book_search"
|
||||
app:navigationIcon="@drawable/ic_arrow_back"
|
||||
app:navigationIconTint="?attr/colorOnSurface" />
|
||||
|
||||
</com.google.android.material.progressindicator.LinearProgressIndicator>
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/refresh_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone">
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</com.google.android.material.progressindicator.LinearProgressIndicator>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tv_empty_msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:id="@+id/tv_empty_msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(๑`^´๑)"
|
||||
android:textSize="30sp" />
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/search_empty" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(๑`^´๑)"
|
||||
android:textSize="32sp" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.dynamiclayout.DynamicFrameLayout
|
||||
android:id="@+id/content_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/search_empty" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
<io.legato.kazusa.ui.widget.dynamiclayout.DynamicFrameLayout
|
||||
android:id="@+id/content_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
tools:listitem="@layout/item_search" />
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
</io.legato.kazusa.ui.widget.dynamiclayout.DynamicFrameLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
tools:listitem="@layout/item_search" />
|
||||
|
||||
</io.legato.kazusa.ui.widget.dynamiclayout.DynamicFrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_stop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fb_start_stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="@string/stop"
|
||||
android:src="@drawable/ic_stop_black_24dp"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
<com.google.android.material.search.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_input_help"
|
||||
@@ -107,7 +137,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="4dp">
|
||||
android:paddingTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history"
|
||||
@@ -125,10 +155,14 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_clear_history"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
|
||||
style="@style/Widget.Material3Expressive.Button"
|
||||
android:text="@string/delete_all"
|
||||
app:backgroundTint="?attr/colorTertiary"
|
||||
app:iconTint="?attr/colorSurface"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
app:strokeColor="?attr/colorTertiary"
|
||||
app:iconGravity="textStart" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -141,15 +175,5 @@
|
||||
</LinearLayout>
|
||||
</com.google.android.material.search.SearchView>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fb_start_stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="@string/stop"
|
||||
android:src="@drawable/ic_stop_black_24dp"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="bottom|end" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:clipToPadding="false"
|
||||
tools:listitem="@layout/item_source_edit" />
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
android:id="@+id/tv_retry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:icon="@drawable/ic_refresh"
|
||||
android:layout_margin="16dp"
|
||||
app:iconPadding="4dp"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<TextView
|
||||
@@ -35,10 +35,12 @@
|
||||
android:id="@+id/tv_reading_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/ChapterNameText"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tv_remove"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_book_name"
|
||||
tools:text="readingTime" />
|
||||
|
||||
@@ -46,12 +48,12 @@
|
||||
android:id="@+id/tv_remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
android:text="清除所有"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_reading_time" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
android:id="@+id/iv_search_content_top"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/go_to_top"
|
||||
app:icon="@drawable/ic_arrow_drop_up"
|
||||
app:iconGravity="textStart"
|
||||
@@ -67,7 +67,7 @@
|
||||
android:id="@+id/iv_search_content_bottom"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/go_to_bottom"
|
||||
app:icon="@drawable/ic_arrow_drop_down"
|
||||
app:iconGravity="textStart"
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_catalog"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
app:icon="@drawable/ic_toc"
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_main_menu"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
app:icon="@drawable/ic_menu"
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_auto_page_stop"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
app:icon="@drawable/ic_auto_page_stop"
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_setting"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
app:icon="@drawable/ic_settings"
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
android:id="@+id/iv_top"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/go_to_top"
|
||||
app:icon="@drawable/ic_arrow_drop_up"
|
||||
app:iconGravity="textStart"
|
||||
@@ -73,7 +73,7 @@
|
||||
android:id="@+id/iv_bottom"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:contentDescription="@string/go_to_bottom"
|
||||
app:icon="@drawable/ic_arrow_drop_down"
|
||||
app:iconGravity="textStart"
|
||||
|
||||
@@ -69,18 +69,24 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/sort" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chip_sort_menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:text="排序方式"
|
||||
android:text="@string/sort_default"
|
||||
app:chipIcon="@drawable/ic_arrow_drop_down"
|
||||
app:chipIconVisible="true" />
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/vw_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/shape_card_view"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
android:id="@+id/tool_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="5dp"
|
||||
android:theme="?attr/actionBarStyle"
|
||||
app:title="@string/login"
|
||||
app:displayHomeAsUp="false"
|
||||
app:fitStatusBar="false"
|
||||
@@ -35,13 +33,11 @@
|
||||
android:id="@+id/flexbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:clipToPadding="false"
|
||||
android:padding="3dp"
|
||||
app:dividerDrawable="@drawable/shape_space_divider"
|
||||
app:flexDirection="row"
|
||||
app:flexWrap="wrap"
|
||||
app:showDivider="middle" />
|
||||
app:flexWrap="wrap" />
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/more_setting"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/containerPreferences"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_tts_speech_reduce"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:contentDescription="@string/tts_speech_reduce"
|
||||
@@ -235,7 +235,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_tts_speech_add"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:contentDescription="@string/tts_speech_add"
|
||||
|
||||
@@ -3,55 +3,52 @@
|
||||
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">
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="560dp">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/tool_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="5dp"
|
||||
android:theme="?attr/actionBarStyle"
|
||||
app:displayHomeAsUp="false"
|
||||
app:fitStatusBar="false"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:title="@string/search_scope"
|
||||
app:titleTextAppearance="@style/ToolbarTitle" />
|
||||
|
||||
<RadioGroup
|
||||
<com.google.android.material.button.MaterialButtonToggleGroup
|
||||
android:id="@+id/rg_scope"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="11dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:checkedButton="@id/rb_group"
|
||||
app:selectionRequired="true"
|
||||
app:singleSelection="true"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tool_bar">
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeRadioNoButton
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/rb_group"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
style="@style/Widget.Material3Expressive.Button"
|
||||
android:layout_weight="1"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
android:singleLine="true"
|
||||
android:checked="true"
|
||||
android:text="@string/group" />
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeRadioNoButton
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/rb_source"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
style="@style/Widget.Material3Expressive.Button"
|
||||
android:layout_weight="1"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/book_source" />
|
||||
|
||||
</RadioGroup>
|
||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||
|
||||
<io.legato.kazusa.ui.widget.recycler.scroller.FastScrollRecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
@@ -67,16 +64,17 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.AccentTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_all_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:layout_marginRight="16dp"
|
||||
android:padding="12dp"
|
||||
android:minWidth="0dp"
|
||||
android:text="@string/all_source"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
@@ -85,24 +83,23 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_cancel"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:padding="12dp"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="@color/secondaryText"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
android:layout_marginEnd="8dp"
|
||||
android:minWidth="0dp"
|
||||
android:text="@string/cancel" />
|
||||
|
||||
<io.legato.kazusa.ui.widget.text.AccentTextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:padding="12dp"
|
||||
android:text="@string/ok"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
style="@style/Widget.Material3Expressive.Button"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:minWidth="0dp"
|
||||
android:text="@string/ok" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -26,18 +26,12 @@
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:text="检测到更新!"
|
||||
android:textSize="18sp"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
@@ -50,7 +44,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_download"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"/>
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?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"
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
@@ -36,7 +35,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_chapter_top"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
app:icon="@drawable/ic_arrow_drop_up"
|
||||
@@ -46,7 +45,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_chapter_bottom"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
app:icon="@drawable/ic_arrow_drop_down"
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(っ˘ω˘ς )"
|
||||
android:textSize="30sp"/>
|
||||
android:textSize="32sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<LinearLayout 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:background="?attr/selectableItemBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="6dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<TextView
|
||||
@@ -14,16 +16,19 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
android:maxLines="2" />
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_delete"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:visibility="visible"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
app:iconGravity="textStart"
|
||||
app:iconSize="20dp"
|
||||
android:contentDescription="@string/delete"
|
||||
android:src="@drawable/ic_clear_all"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:iconTint="?attr/colorOnSurface" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -3,9 +3,11 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingVertical="8dp">
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
@@ -22,7 +24,7 @@
|
||||
android:paddingBottom="2dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/book_name"
|
||||
android:textSize="20sp"
|
||||
style="@style/ChapterNameText"
|
||||
app:layout_constraintStart_toEndOf="@id/checkbox"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/checkbox"
|
||||
@@ -38,7 +40,7 @@
|
||||
android:textSize="12sp"
|
||||
tools:ignore="RtlHardcoded"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_name"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_name"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_group"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name" />
|
||||
|
||||
<TextView
|
||||
@@ -53,22 +55,24 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_group_s"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ungroup"
|
||||
android:layout_marginStart="8dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_origin"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_group"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/tv_origin" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_group"
|
||||
android:layout_width="48dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:minWidth="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/group"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_group_s"
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
android:id="@+id/tv_host_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-12dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:scrollbars="none"
|
||||
android:singleLine="true"
|
||||
android:textSize="16sp"
|
||||
@@ -37,7 +35,7 @@
|
||||
android:id="@+id/cb_book_source"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:scrollbars="none"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_debug_text"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="4dp"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeSwitch
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
@@ -11,9 +12,11 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textSize="18sp"
|
||||
style="@style/ChapterNameText"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintEnd_toStartOf="@id/cd_download"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/iv_download"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/name" />
|
||||
|
||||
@@ -21,59 +24,95 @@
|
||||
android:id="@+id/tv_author"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="2dp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/iv_download"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
tools:text="@string/author" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_download"
|
||||
android:layout_width="0dp"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/iv_download"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_author"
|
||||
tools:text="@string/action_download" />
|
||||
android:layout_marginEnd="2dp"
|
||||
app:cardBackgroundColor="?attr/colorSecondaryContainer"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_name"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:layout_marginVertical="2dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/colorPrimaryVariant"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="@string/action_download" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_download"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:id="@+id/iv_delete"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:contentDescription="@string/start"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
app:iconGravity="textStart"
|
||||
app:iconSize="20dp"
|
||||
app:layout_constraintRight_toLeftOf="@+id/iv_download"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_author" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_download"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:contentDescription="@string/start"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:icon="@drawable/ic_play_24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_download"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tv_export"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_name" />
|
||||
app:layout_constraintTop_toTopOf="@id/tv_author" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/tv_export"
|
||||
android:layout_width="48dp"
|
||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
android:textSize="12sp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/export"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_download"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_name" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_author" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_msg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_download" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_author" />
|
||||
|
||||
<io.legato.kazusa.lib.theme.view.ThemeProgressBar
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_download"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_download" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_export"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_download" />
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_download" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,8 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_margin="2dp"
|
||||
app:cardBackgroundColor="?attr/colorSecondary"
|
||||
app:strokeColor="?attr/colorSecondary"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
<TextView
|
||||
@@ -18,7 +21,7 @@
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textColor="?attr/colorSurface"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/iv_status"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
app:icon="@drawable/ic_arrow_right"/>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
android:id="@+id/tv_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:icon="@drawable/ic_edit" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -21,7 +21,7 @@
|
||||
android:id="@+id/tv_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:icon="@drawable/ic_edit" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -38,7 +38,7 @@
|
||||
android:id="@+id/iv_edit"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/edit"
|
||||
app:icon="@drawable/ic_edit"
|
||||
@@ -51,7 +51,7 @@
|
||||
android:id="@+id/iv_menu_delete"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -5,19 +5,37 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_cover"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainer"
|
||||
app:cardCornerRadius="6dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="80dp" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_book_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
style="@style/ChapterNameText"
|
||||
android:layout_marginStart="8dp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_remove"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tv_remove"
|
||||
app:layout_constraintStart_toEndOf="@id/cd_cover"
|
||||
tools:text="name"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
@@ -25,40 +43,32 @@
|
||||
android:id="@+id/tv_reading_time_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/reading_time_tag"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/cd_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_book_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reading_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tv_reading_time_tag"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_book_name"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tv_remove"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_reading_time_tag"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_remove"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_reading_time_tag"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_reading_time_tag"
|
||||
tools:text="readingTime" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_last_read_time_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/last_read_time_tag"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_reading_time_tag" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_last_read_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="4dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tv_last_read_time_tag"
|
||||
app:layout_constraintLeft_toRightOf="@+id/cd_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_reading_time_tag"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tv_remove"
|
||||
tools:text="readingTime" />
|
||||
@@ -67,10 +77,9 @@
|
||||
android:id="@+id/tv_remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:icon="@drawable/ic_clear_all"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_book_name" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,43 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/rv_style"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:strokeWidth="0dp">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/ll_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_style"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="4dp"
|
||||
android:foreground="?android:attr/selectableItemBackground">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_style"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:foreground="?android:attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:id="@+id/iv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:autoSizeMaxTextSize="12sp"
|
||||
android:autoSizeMinTextSize="6sp"
|
||||
android:autoSizeStepGranularity="1sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="@string/text" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<TextView
|
||||
android:id="@+id/tv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:autoSizeMaxTextSize="12sp"
|
||||
android:autoSizeMinTextSize="6sp"
|
||||
android:autoSizeStepGranularity="1sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="@string/text" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
android:id="@+id/cb_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:scrollbars="none"
|
||||
android:maxLines="2"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
android:id="@+id/textInputLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<io.legato.kazusa.ui.widget.code.CodeView
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
android:id="@+id/cb_source"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="4dp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/title_example"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -65,7 +65,7 @@
|
||||
android:id="@+id/title_example"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -6,5 +6,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:paddingHorizontal="12dp"
|
||||
android:paddingVertical="8dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
android:id="@+id/iv_search_content_up"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:iconGravity="textStart"
|
||||
android:contentDescription="@string/go_to_top"
|
||||
app:icon="@drawable/ic_arrow_drop_up"
|
||||
@@ -93,7 +93,7 @@
|
||||
android:id="@+id/iv_search_content_down"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
app:iconGravity="textStart"
|
||||
android:contentDescription="@string/go_to_bottom"
|
||||
app:icon="@drawable/ic_arrow_drop_down"
|
||||
@@ -201,7 +201,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="退出"
|
||||
android:contentDescription="@string/exit"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="7dp">
|
||||
@@ -212,7 +212,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="退出"
|
||||
android:contentDescription="@string/exit"
|
||||
android:maxHeight="20dp"
|
||||
android:src="@drawable/ic_auto_page_stop"
|
||||
tools:ignore="NestedWeights" />
|
||||
@@ -224,7 +224,7 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="3dp"
|
||||
android:maxLines="1"
|
||||
android:text="退出"
|
||||
android:text="@string/exit"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/select_all" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
android:id="@+id/iv_seek_reduce"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:elevation="2dp"
|
||||
app:backgroundTint="?attr/colorSurfaceContainer"
|
||||
android:contentDescription="@string/reduce"
|
||||
@@ -58,7 +58,7 @@
|
||||
android:id="@+id/iv_seek_plus"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||
android:elevation="2dp"
|
||||
app:backgroundTint="?attr/colorSurfaceContainer"
|
||||
android:contentDescription="@string/plus"
|
||||
|
||||
@@ -11,20 +11,6 @@
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="摘要"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_system"
|
||||
style="@style/Widget.Material3Expressive.Button"
|
||||
|
||||
@@ -979,7 +979,7 @@
|
||||
<string name="custom_welcome_summary">是否使用自定义欢迎页</string>
|
||||
<string name="show_icon">显示图标</string>
|
||||
<string name="show_default_book_icon">显示默认书籍图标</string>
|
||||
<string name="cache_export">缓存/导出</string>
|
||||
<string name="cache_export">已缓存书籍</string>
|
||||
<string name="assists_key_config">辅助按键配置</string>
|
||||
<string name="url_option">Url参数</string>
|
||||
<string name="only_wifi">仅WIFI</string>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<item name="tabStyle">@style/Widget.App.TabLayout</item>
|
||||
<item name="popupMenuBackground">@drawable/popup_background</item>
|
||||
<item name="alertDialogTheme">@style/AppTheme.AlertDialog</item>
|
||||
<item name="chipStyle">@style/Widget.Material3.Chip.Filter</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -225,7 +225,7 @@
|
||||
<string name="download_start">开始下载</string>
|
||||
<string name="download_cancel">取消下载</string>
|
||||
<string name="no_download">暂无任务</string>
|
||||
<string name="download_count">已下载 %1$d/%2$d</string>
|
||||
<string name="download_count">%1$d/%2$d</string>
|
||||
<string name="import_select_book">导入选择书籍</string>
|
||||
<string name="threads_num_title">更新和搜索线程数(太多会卡顿)</string>
|
||||
<string name="change_icon">切换图标</string>
|
||||
@@ -979,7 +979,7 @@
|
||||
<string name="custom_welcome_summary">是否使用自定义欢迎页</string>
|
||||
<string name="show_icon">显示图标</string>
|
||||
<string name="show_default_book_icon">显示默认书籍图标</string>
|
||||
<string name="cache_export">缓存/导出</string>
|
||||
<string name="cache_export">书籍缓存</string>
|
||||
<string name="assists_key_config">辅助按键配置</string>
|
||||
<string name="url_option">URL 参数</string>
|
||||
<string name="only_wifi">仅 WiFi</string>
|
||||
|
||||
@@ -40,12 +40,16 @@
|
||||
<style name="ChapterNameText">
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:paddingBottom">4dp</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
</style>
|
||||
|
||||
//**********System Style******************//
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Circle" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">50%</item>
|
||||
</style>
|
||||
|
||||
<style name="Style.NavigationView" parent="android:Widget">
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user