更新界面
This commit is contained in:
@@ -1,21 +1,19 @@
|
|||||||
package io.legato.kazusa.ui.book.changecover
|
package io.legato.kazusa.ui.book.changecover
|
||||||
|
|
||||||
|
//import io.legado.app.lib.theme.primaryColor
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
import androidx.lifecycle.Lifecycle.State.STARTED
|
import androidx.lifecycle.Lifecycle.State.STARTED
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.lifecycle.repeatOnLifecycle
|
import androidx.lifecycle.repeatOnLifecycle
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.BaseDialogFragment
|
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||||
import io.legato.kazusa.databinding.DialogChangeCoverBinding
|
import io.legato.kazusa.databinding.DialogChangeCoverBinding
|
||||||
//import io.legado.app.lib.theme.primaryColor
|
|
||||||
import io.legato.kazusa.utils.applyTint
|
|
||||||
import io.legato.kazusa.utils.setLayout
|
|
||||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.flow.conflate
|
import kotlinx.coroutines.flow.conflate
|
||||||
@@ -24,7 +22,7 @@ import kotlinx.coroutines.launch
|
|||||||
/**
|
/**
|
||||||
* 换封面
|
* 换封面
|
||||||
*/
|
*/
|
||||||
class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
|
class ChangeCoverDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_change_cover),
|
||||||
Toolbar.OnMenuItemClickListener,
|
Toolbar.OnMenuItemClickListener,
|
||||||
CoverAdapter.CallBack {
|
CoverAdapter.CallBack {
|
||||||
|
|
||||||
@@ -43,11 +41,6 @@ class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
|
|||||||
private val startStopMenuItem: MenuItem?
|
private val startStopMenuItem: MenuItem?
|
||||||
get() = binding.toolBar.menu.findItem(R.id.menu_start_stop)
|
get() = binding.toolBar.menu.findItem(R.id.menu_start_stop)
|
||||||
|
|
||||||
override fun onStart() {
|
|
||||||
super.onStart()
|
|
||||||
setLayout(1f, ViewGroup.LayoutParams.MATCH_PARENT)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.setTitle(R.string.change_cover_source)
|
binding.toolBar.setTitle(R.string.change_cover_source)
|
||||||
@@ -82,7 +75,7 @@ class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
|
|||||||
override fun observeLiveBus() {
|
override fun observeLiveBus() {
|
||||||
super.observeLiveBus()
|
super.observeLiveBus()
|
||||||
viewModel.searchStateData.observe(viewLifecycleOwner) {
|
viewModel.searchStateData.observe(viewLifecycleOwner) {
|
||||||
binding.refreshProgressBar.isAutoLoading = it
|
binding.refreshProgressBar.isVisible = it
|
||||||
if (it) {
|
if (it) {
|
||||||
startStopMenuItem?.let { item ->
|
startStopMenuItem?.let { item ->
|
||||||
item.setIcon(R.drawable.ic_stop_black_24dp)
|
item.setIcon(R.drawable.ic_stop_black_24dp)
|
||||||
|
|||||||
+13
-73
@@ -5,8 +5,6 @@ import android.os.Bundle
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import androidx.appcompat.widget.PopupMenu
|
||||||
import androidx.core.graphics.drawable.DrawableCompat
|
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.adapter.DiffRecyclerAdapter
|
import io.legato.kazusa.base.adapter.DiffRecyclerAdapter
|
||||||
@@ -15,12 +13,10 @@ import io.legato.kazusa.data.entities.SearchBook
|
|||||||
import io.legato.kazusa.databinding.ItemChangeSourceBinding
|
import io.legato.kazusa.databinding.ItemChangeSourceBinding
|
||||||
import io.legato.kazusa.help.config.AppConfig
|
import io.legato.kazusa.help.config.AppConfig
|
||||||
import io.legato.kazusa.lib.dialogs.alert
|
import io.legato.kazusa.lib.dialogs.alert
|
||||||
import io.legato.kazusa.utils.getCompatColor
|
|
||||||
import io.legato.kazusa.utils.gone
|
import io.legato.kazusa.utils.gone
|
||||||
import io.legato.kazusa.utils.invisible
|
import io.legato.kazusa.utils.invisible
|
||||||
import io.legato.kazusa.utils.themeColor
|
import io.legato.kazusa.utils.themeColor
|
||||||
import io.legato.kazusa.utils.visible
|
import io.legato.kazusa.utils.visible
|
||||||
import splitties.init.appCtx
|
|
||||||
import splitties.views.onLongClick
|
import splitties.views.onLongClick
|
||||||
|
|
||||||
|
|
||||||
@@ -88,38 +84,11 @@ class ChangeBookSourceAdapter(
|
|||||||
}
|
}
|
||||||
val score = callBack.getBookScore(item)
|
val score = callBack.getBookScore(item)
|
||||||
if (score > 0) {
|
if (score > 0) {
|
||||||
binding.ivBad.gone()
|
// 已置顶
|
||||||
binding.ivGood.visible()
|
binding.ivGood.setImageResource(R.drawable.ic_praise_filled)
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivGood.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_red_A200)
|
|
||||||
)
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_100)
|
|
||||||
)
|
|
||||||
} else if (score < 0) {
|
|
||||||
binding.ivGood.gone()
|
|
||||||
binding.ivBad.visible()
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivGood.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_red_100)
|
|
||||||
)
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_A200)
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
binding.ivGood.visible()
|
// 未置顶
|
||||||
binding.ivBad.visible()
|
binding.ivGood.setImageResource(R.drawable.ic_praise)
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivGood.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_red_100)
|
|
||||||
)
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_100)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppConfig.changeSourceLoadWordCount && !item.chapterWordCountText.isNullOrBlank()) {
|
if (AppConfig.changeSourceLoadWordCount && !item.chapterWordCountText.isNullOrBlank()) {
|
||||||
@@ -138,45 +107,16 @@ class ChangeBookSourceAdapter(
|
|||||||
|
|
||||||
override fun registerListener(holder: ItemViewHolder, binding: ItemChangeSourceBinding) {
|
override fun registerListener(holder: ItemViewHolder, binding: ItemChangeSourceBinding) {
|
||||||
binding.ivGood.setOnClickListener {
|
binding.ivGood.setOnClickListener {
|
||||||
if (binding.ivBad.isVisible) {
|
val item = getItem(holder.layoutPosition) ?: return@setOnClickListener
|
||||||
DrawableCompat.setTint(
|
val score = callBack.getBookScore(item)
|
||||||
binding.ivGood.drawable,
|
if (score > 0) {
|
||||||
appCtx.getCompatColor(R.color.md_red_A200)
|
// 已置顶 -> 取消置顶
|
||||||
)
|
binding.ivGood.setImageResource(R.drawable.ic_praise)
|
||||||
binding.ivBad.gone()
|
callBack.setBookScore(item, 0)
|
||||||
getItem(holder.layoutPosition)?.let {
|
|
||||||
callBack.setBookScore(it, 1)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
DrawableCompat.setTint(
|
// 未置顶 -> 设置置顶
|
||||||
binding.ivGood.drawable,
|
binding.ivGood.setImageResource(R.drawable.ic_praise_filled)
|
||||||
appCtx.getCompatColor(R.color.md_red_100)
|
callBack.setBookScore(item, 1)
|
||||||
)
|
|
||||||
binding.ivBad.visible()
|
|
||||||
getItem(holder.layoutPosition)?.let {
|
|
||||||
callBack.setBookScore(it, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.ivBad.setOnClickListener {
|
|
||||||
if (binding.ivGood.isVisible) {
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_A200)
|
|
||||||
)
|
|
||||||
binding.ivGood.gone()
|
|
||||||
getItem(holder.layoutPosition)?.let {
|
|
||||||
callBack.setBookScore(it, -1)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_100)
|
|
||||||
)
|
|
||||||
binding.ivGood.visible()
|
|
||||||
getItem(holder.layoutPosition)?.let {
|
|
||||||
callBack.setBookScore(it, 0)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
holder.itemView.setOnClickListener {
|
holder.itemView.setOnClickListener {
|
||||||
|
|||||||
+14
-55
@@ -5,8 +5,6 @@ import android.os.Bundle
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import androidx.appcompat.widget.PopupMenu
|
||||||
import androidx.core.graphics.drawable.DrawableCompat
|
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.adapter.DiffRecyclerAdapter
|
import io.legato.kazusa.base.adapter.DiffRecyclerAdapter
|
||||||
@@ -14,11 +12,9 @@ import io.legato.kazusa.base.adapter.ItemViewHolder
|
|||||||
import io.legato.kazusa.data.entities.SearchBook
|
import io.legato.kazusa.data.entities.SearchBook
|
||||||
import io.legato.kazusa.databinding.ItemChangeSourceBinding
|
import io.legato.kazusa.databinding.ItemChangeSourceBinding
|
||||||
import io.legato.kazusa.help.config.AppConfig
|
import io.legato.kazusa.help.config.AppConfig
|
||||||
import io.legato.kazusa.utils.getCompatColor
|
|
||||||
import io.legato.kazusa.utils.gone
|
import io.legato.kazusa.utils.gone
|
||||||
import io.legato.kazusa.utils.invisible
|
import io.legato.kazusa.utils.invisible
|
||||||
import io.legato.kazusa.utils.visible
|
import io.legato.kazusa.utils.visible
|
||||||
import splitties.init.appCtx
|
|
||||||
import splitties.views.onLongClick
|
import splitties.views.onLongClick
|
||||||
|
|
||||||
|
|
||||||
@@ -80,34 +76,14 @@ class ChangeChapterSourceAdapter(
|
|||||||
}
|
}
|
||||||
val score = callBack.getBookScore(item)
|
val score = callBack.getBookScore(item)
|
||||||
if (score > 0) {
|
if (score > 0) {
|
||||||
binding.ivBad.gone()
|
// 已置顶
|
||||||
binding.ivGood.visible()
|
binding.ivGood.setImageResource(R.drawable.ic_praise_filled)
|
||||||
DrawableCompat.setTint(binding.ivGood.drawable, appCtx.getCompatColor(R.color.md_red_A200))
|
|
||||||
DrawableCompat.setTint(binding.ivBad.drawable, appCtx.getCompatColor(R.color.md_blue_100))
|
|
||||||
} else if (score < 0) {
|
|
||||||
binding.ivGood.gone()
|
|
||||||
binding.ivBad.visible()
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivGood.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_red_100)
|
|
||||||
)
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_A200)
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
binding.ivGood.visible()
|
// 未置顶
|
||||||
binding.ivBad.visible()
|
binding.ivGood.setImageResource(R.drawable.ic_praise)
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivGood.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_red_100)
|
|
||||||
)
|
|
||||||
DrawableCompat.setTint(
|
|
||||||
binding.ivBad.drawable,
|
|
||||||
appCtx.getCompatColor(R.color.md_blue_100)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (AppConfig.changeSourceLoadWordCount && !item.chapterWordCountText.isNullOrBlank()) {
|
if (AppConfig.changeSourceLoadWordCount && !item.chapterWordCountText.isNullOrBlank()) {
|
||||||
tvCurrentChapterWordCount.visible()
|
tvCurrentChapterWordCount.visible()
|
||||||
} else {
|
} else {
|
||||||
@@ -124,33 +100,16 @@ class ChangeChapterSourceAdapter(
|
|||||||
|
|
||||||
override fun registerListener(holder: ItemViewHolder, binding: ItemChangeSourceBinding) {
|
override fun registerListener(holder: ItemViewHolder, binding: ItemChangeSourceBinding) {
|
||||||
binding.ivGood.setOnClickListener {
|
binding.ivGood.setOnClickListener {
|
||||||
if (binding.ivBad.isVisible) {
|
val item = getItem(holder.layoutPosition) ?: return@setOnClickListener
|
||||||
DrawableCompat.setTint(binding.ivGood.drawable, appCtx.getCompatColor(R.color.md_red_A200))
|
val score = callBack.getBookScore(item)
|
||||||
binding.ivBad.gone()
|
if (score > 0) {
|
||||||
getItem(holder.layoutPosition)?.let {
|
// 已置顶 -> 取消置顶
|
||||||
callBack.setBookScore(it, 1)
|
binding.ivGood.setImageResource(R.drawable.ic_praise)
|
||||||
}
|
callBack.setBookScore(item, 0)
|
||||||
} else {
|
} else {
|
||||||
DrawableCompat.setTint(binding.ivGood.drawable, appCtx.getCompatColor(R.color.md_red_100))
|
// 未置顶 -> 设置置顶
|
||||||
binding.ivBad.visible()
|
binding.ivGood.setImageResource(R.drawable.ic_praise_filled)
|
||||||
getItem(holder.layoutPosition)?.let {
|
callBack.setBookScore(item, 1)
|
||||||
callBack.setBookScore(it, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.ivBad.setOnClickListener {
|
|
||||||
if (binding.ivGood.isVisible) {
|
|
||||||
DrawableCompat.setTint(binding.ivBad.drawable, appCtx.getCompatColor(R.color.md_blue_A200))
|
|
||||||
binding.ivGood.gone()
|
|
||||||
getItem(holder.layoutPosition)?.let {
|
|
||||||
callBack.setBookScore(it, -1)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DrawableCompat.setTint(binding.ivBad.drawable, appCtx.getCompatColor(R.color.md_blue_100))
|
|
||||||
binding.ivGood.visible()
|
|
||||||
getItem(holder.layoutPosition)?.let {
|
|
||||||
callBack.setBookScore(it, 0)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
holder.itemView.setOnClickListener {
|
holder.itemView.setOnClickListener {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package io.legato.kazusa.ui.book.group
|
package io.legato.kazusa.ui.book.group
|
||||||
|
|
||||||
//import io.legado.app.lib.theme.primaryColor
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import android.widget.ArrayAdapter
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||||
@@ -69,6 +68,13 @@ class GroupEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_book_gro
|
|||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
bookGroup = arguments?.getParcelable("group")
|
bookGroup = arguments?.getParcelable("group")
|
||||||
|
|
||||||
|
val sortAdapter = ArrayAdapter(
|
||||||
|
requireContext(),
|
||||||
|
android.R.layout.simple_list_item_1,
|
||||||
|
sortOptions
|
||||||
|
)
|
||||||
|
binding.actvSortMenu.setAdapter(sortAdapter)
|
||||||
|
|
||||||
bookGroup?.let { group ->
|
bookGroup?.let { group ->
|
||||||
binding.btnDelete.isEnabled = (group.groupId > 0 || group.groupId == Long.MIN_VALUE)
|
binding.btnDelete.isEnabled = (group.groupId > 0 || group.groupId == Long.MIN_VALUE)
|
||||||
binding.tieGroupName.setText(group.groupName)
|
binding.tieGroupName.setText(group.groupName)
|
||||||
@@ -82,30 +88,20 @@ class GroupEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_book_gro
|
|||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
binding.chipSortMenu.text = sortOptions[selectedSortIndex]
|
binding.actvSortMenu.setText(sortOptions[selectedSortIndex], false)
|
||||||
|
|
||||||
} ?: run {
|
} ?: run {
|
||||||
binding.btnDelete.gone()
|
binding.btnDelete.gone()
|
||||||
binding.ivCover.load()
|
binding.ivCover.load()
|
||||||
selectedSortIndex = 0
|
selectedSortIndex = 0
|
||||||
binding.chipSortMenu.text = sortOptions[selectedSortIndex]
|
binding.actvSortMenu.setText(sortOptions[selectedSortIndex], false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.actvSortMenu.setOnItemClickListener { _, _, position, _ ->
|
||||||
|
selectedSortIndex = position
|
||||||
|
}
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
chipSortMenu.setOnClickListener { chip ->
|
|
||||||
PopupMenu(requireContext(), chip).apply {
|
|
||||||
sortOptions.forEachIndexed { index, title ->
|
|
||||||
menu.add(0, index, index, title)
|
|
||||||
}
|
|
||||||
setOnMenuItemClickListener { item ->
|
|
||||||
selectedSortIndex = item.itemId
|
|
||||||
chipSortMenu.text = sortOptions[selectedSortIndex]
|
|
||||||
true
|
|
||||||
}
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ivCover.onClick {
|
ivCover.onClick {
|
||||||
selectImage.launch()
|
selectImage.launch()
|
||||||
}
|
}
|
||||||
@@ -149,8 +145,8 @@ class GroupEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_book_gro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
btnDelete.onClick {
|
btnDelete.onClick {
|
||||||
deleteGroup {
|
deleteGroup {
|
||||||
bookGroup?.let {
|
bookGroup?.let {
|
||||||
@@ -163,6 +159,7 @@ class GroupEditDialog() : BaseBottomSheetDialogFragment(R.layout.dialog_book_gro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun deleteGroup(ok: () -> Unit) {
|
private fun deleteGroup(ok: () -> Unit) {
|
||||||
alert(R.string.delete, R.string.sure_del) {
|
alert(R.string.delete, R.string.sure_del) {
|
||||||
yesButton {
|
yesButton {
|
||||||
|
|||||||
@@ -584,23 +584,23 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangaBinding, ReadMangaViewMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
//点击滑动
|
//点击滑动
|
||||||
override fun onClickScrollDisabledChanged(enabled: Boolean) {
|
override fun onClickScrollDisabledChanged(disabled: Boolean) {
|
||||||
AppConfig.disableClickScroll = enabled
|
AppConfig.disableClickScroll = disabled
|
||||||
setDisableClickScroll(enabled)
|
setDisableClickScroll(disabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
//双击缩放
|
//双击缩放
|
||||||
override fun onMangaScaleDisabledChanged(enabled: Boolean) {
|
override fun onMangaScaleDisabledChanged(disabled: Boolean) {
|
||||||
AppConfig.disableMangaScale = enabled
|
AppConfig.disableMangaScale = disabled
|
||||||
setDisableMangaScale(enabled)
|
setDisableMangaScale(disabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
//侧边留白
|
//侧边留白
|
||||||
override fun upSidePadding(paddingDp: Int) {
|
override fun upSidePadding(padding: Int) {
|
||||||
viewModel.updateReadConfig {
|
viewModel.updateReadConfig {
|
||||||
webtoonSidePaddingDp = paddingDp
|
webtoonSidePaddingDp = padding
|
||||||
}
|
}
|
||||||
updateWebtoonSidePadding(paddingDp)
|
updateWebtoonSidePadding(padding)
|
||||||
}
|
}
|
||||||
|
|
||||||
//墨水屏
|
//墨水屏
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ import io.legato.kazusa.help.glide.ImageLoader
|
|||||||
import io.legato.kazusa.help.glide.OkHttpModelLoader
|
import io.legato.kazusa.help.glide.OkHttpModelLoader
|
||||||
//import io.legado.app.lib.theme.accentColor
|
//import io.legado.app.lib.theme.accentColor
|
||||||
import io.legato.kazusa.model.BookCover
|
import io.legato.kazusa.model.BookCover
|
||||||
|
import io.legato.kazusa.utils.spToPx
|
||||||
import io.legato.kazusa.utils.textHeight
|
import io.legato.kazusa.utils.textHeight
|
||||||
|
import io.legato.kazusa.utils.themeColor
|
||||||
import io.legato.kazusa.utils.toStringArray
|
import io.legato.kazusa.utils.toStringArray
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -117,49 +119,63 @@ class CoverImageView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun drawNameAuthor(canvas: Canvas) {
|
private fun drawNameAuthor(canvas: Canvas) {
|
||||||
if (!BookCover.drawBookName) return
|
if (BookCover.drawBookName) {
|
||||||
var startX = width * 0.2f
|
var startX = width * 0.2f
|
||||||
var startY = viewHeight * 0.2f
|
var startY = viewHeight * 0.2f
|
||||||
name?.toStringArray()?.let { name ->
|
|
||||||
namePaint.textSize = viewWidth / 6
|
name?.toStringArray()?.let { nameChars ->
|
||||||
namePaint.strokeWidth = namePaint.textSize / 5
|
val textSize = viewWidth / 8
|
||||||
name.forEachIndexed { index, char ->
|
namePaint.textSize = textSize
|
||||||
|
namePaint.strokeWidth = textSize / 8
|
||||||
|
|
||||||
|
nameChars.forEach { char ->
|
||||||
namePaint.color = Color.WHITE
|
namePaint.color = Color.WHITE
|
||||||
namePaint.style = Paint.Style.STROKE
|
namePaint.style = Paint.Style.STROKE
|
||||||
canvas.drawText(char, startX, startY, namePaint)
|
canvas.drawText(char, startX, startY, namePaint)
|
||||||
//namePaint.color = context.accentColor
|
|
||||||
|
namePaint.color = context.themeColor(androidx.appcompat.R.attr.colorPrimary)
|
||||||
namePaint.style = Paint.Style.FILL
|
namePaint.style = Paint.Style.FILL
|
||||||
canvas.drawText(char, startX, startY, namePaint)
|
canvas.drawText(char, startX, startY, namePaint)
|
||||||
|
|
||||||
startY += namePaint.textHeight
|
startY += namePaint.textHeight
|
||||||
if (startY > viewHeight * 0.8) {
|
|
||||||
startX += namePaint.textSize
|
if (startY > viewHeight * 0.8f) {
|
||||||
namePaint.textSize = viewWidth / 10
|
startX += textSize + 4.spToPx()
|
||||||
startY = (viewHeight - (name.size - index - 1) * namePaint.textHeight) / 2
|
startY = viewHeight * 0.2f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!BookCover.drawBookAuthor) return
|
}
|
||||||
author?.toStringArray()?.let { author ->
|
|
||||||
authorPaint.textSize = viewWidth / 10
|
if (BookCover.drawBookAuthor) {
|
||||||
authorPaint.strokeWidth = authorPaint.textSize / 5
|
author?.toStringArray()?.let { authorChars ->
|
||||||
startX = width * 0.8f
|
val textSize = viewWidth / 10
|
||||||
startY = viewHeight * 0.95f - author.size * authorPaint.textHeight
|
authorPaint.textSize = textSize
|
||||||
startY = maxOf(startY, viewHeight * 0.3f)
|
authorPaint.strokeWidth = textSize / 5
|
||||||
author.forEach {
|
|
||||||
|
var startX = width * 0.8f
|
||||||
|
var startY = viewHeight * 0.8f
|
||||||
|
|
||||||
|
authorChars.forEach { char ->
|
||||||
|
|
||||||
authorPaint.color = Color.WHITE
|
authorPaint.color = Color.WHITE
|
||||||
authorPaint.style = Paint.Style.STROKE
|
authorPaint.style = Paint.Style.STROKE
|
||||||
canvas.drawText(it, startX, startY, authorPaint)
|
canvas.drawText(char, startX, startY, authorPaint)
|
||||||
//authorPaint.color = context.accentColor
|
|
||||||
|
authorPaint.color =
|
||||||
|
context.themeColor(com.google.android.material.R.attr.colorSecondary)
|
||||||
authorPaint.style = Paint.Style.FILL
|
authorPaint.style = Paint.Style.FILL
|
||||||
canvas.drawText(it, startX, startY, authorPaint)
|
canvas.drawText(char, startX, startY, authorPaint)
|
||||||
|
|
||||||
startY += authorPaint.textHeight
|
startY += authorPaint.textHeight
|
||||||
if (startY > viewHeight * 0.95) {
|
|
||||||
return@let
|
if (startY > viewHeight * 0.95f) return@let
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun setHeight(height: Int) {
|
fun setHeight(height: Int) {
|
||||||
val width = height * 5 / 7
|
val width = height * 5 / 7
|
||||||
minimumWidth = width
|
minimumWidth = width
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960" android:tint="?attr/colorControlNormal">
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="960" android:viewportHeight="960" android:tint="?attr/colorControlNormal">
|
||||||
<path android:fillColor="@android:color/white" android:pathData="M720,840L280,840L280,320L560,40L610,90Q617,97 621.5,109Q626,121 626,132L626,146L582,320L840,320Q872,320 896,344Q920,368 920,400L920,480Q920,487 918,495Q916,503 914,510L794,792Q785,812 764,826Q743,840 720,840ZM360,760L720,760Q720,760 720,760Q720,760 720,760L840,480L840,400Q840,400 840,400Q840,400 840,400L480,400L534,180L360,354L360,760ZM360,354L360,354L360,400L360,400Q360,400 360,400Q360,400 360,400L360,480L360,760Q360,760 360,760Q360,760 360,760L360,760L360,354ZM280,320L280,400L160,400L160,760L280,760L280,840L80,840L80,320L280,320Z"/>
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M640,480L720,560L720,640L520,640L520,880L480,920L440,880L440,640L240,640L240,560L320,480L320,200L280,200L280,120L680,120L680,200L640,200L640,480ZM354,560L606,560L560,514L560,200L400,200L400,514L354,560ZM480,560L480,560L480,560L480,560L480,560L480,560Z" />
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:tint="?attr/colorControlNormal"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M640,480L720,560L720,640L520,640L520,880L480,920L440,880L440,640L240,640L240,560L320,480L320,200L280,200L280,120L680,120L680,200L640,200L640,480Z" />
|
||||||
|
</vector>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -103,6 +103,12 @@
|
|||||||
android:text="还没有源!" />
|
android:text="还没有源!" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -112,11 +118,11 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_bottom_bar"
|
android:id="@+id/ll_bottom_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="10dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingRight="10dp">
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_dur"
|
android:id="@+id/tv_dur"
|
||||||
@@ -125,32 +131,39 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:text="@string/text"
|
android:text="@string/text"
|
||||||
|
android:textStyle="bold"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/iv_top"
|
android:id="@+id/iv_top"
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
android:contentDescription="@string/go_to_top"
|
android:contentDescription="@string/go_to_top"
|
||||||
|
android:tooltipText="@string/go_to_top"
|
||||||
app:icon="@drawable/ic_arrow_drop_up"
|
app:icon="@drawable/ic_arrow_drop_up"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
android:tooltipText="@string/go_to_top"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/iv_bottom"
|
android:id="@+id/iv_bottom"
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
android:contentDescription="@string/go_to_bottom"
|
android:contentDescription="@string/go_to_bottom"
|
||||||
|
android:tooltipText="@string/go_to_bottom"
|
||||||
app:icon="@drawable/ic_arrow_drop_down"
|
app:icon="@drawable/ic_arrow_drop_down"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
android:tooltipText="@string/go_to_bottom"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
@@ -46,61 +46,61 @@
|
|||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:contentDescription="@string/img_cover"
|
android:contentDescription="@string/img_cover"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="?attr/colorSurfaceVariant"
|
android:src="@drawable/image_cover_default"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:ignore="ImageContrastCheck" />
|
tools:ignore="ImageContrastCheck" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_group_name"
|
android:id="@+id/til_group_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/group_name">
|
android:layout_marginStart="8dp"
|
||||||
|
android:hint="@string/group_name"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_cover"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_cover">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/tie_group_name"
|
android:id="@+id/tie_group_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="2"
|
android:ellipsize="end"
|
||||||
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
|
android:maxLines="1" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/til_sort_menu"
|
||||||
android:layout_height="wrap_content"
|
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginBottom="8dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_marginStart="8dp"
|
||||||
android:text="@string/sort" />
|
android:hint="@string/sort"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_cover">
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.textfield.MaterialAutoCompleteTextView
|
||||||
android:id="@+id/chip_sort_menu"
|
android:id="@+id/actv_sort_menu"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="true"
|
android:cursorVisible="false"
|
||||||
android:text="@string/sort_default"
|
android:ellipsize="end"
|
||||||
app:chipIcon="@drawable/ic_arrow_drop_down"
|
android:focusable="false"
|
||||||
app:chipIconVisible="true" />
|
android:inputType="none"
|
||||||
|
android:singleLine="true" />
|
||||||
</LinearLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
android:id="@+id/cb_enable_refresh"
|
android:id="@+id/cb_enable_refresh"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/allow_drop_down_refresh"
|
android:text="@string/allow_drop_down_refresh"
|
||||||
android:checked="true" />
|
android:checked="true"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_cover" />
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -109,42 +109,48 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_delete"
|
android:id="@+id/btn_delete"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
|
app:icon="@drawable/ic_clear_all" />
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
app:icon="@drawable/ic_clear_all"
|
|
||||||
tools:ignore="RtlHardcoded" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_reset"
|
android:id="@+id/btn_reset"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:icon="@drawable/ic_restore"
|
app:icon="@drawable/ic_restore" />
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined" />
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_cancel"
|
android:id="@+id/btn_cancel"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:text="@string/cancel" />
|
android:text="@string/cancel" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_ok"
|
android:id="@+id/btn_ok"
|
||||||
|
style="@style/Widget.Material3Expressive.Button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button"
|
android:text="@string/ok" />
|
||||||
android:text="@string/ok"
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
tools:ignore="RtlHardcoded" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -15,10 +15,12 @@
|
|||||||
app:displayHomeAsUp="false"
|
app:displayHomeAsUp="false"
|
||||||
app:fitStatusBar="false" />
|
app:fitStatusBar="false" />
|
||||||
|
|
||||||
<io.legato.kazusa.ui.widget.anima.RefreshProgressBar
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/refresh_progress_bar"
|
android:id="@+id/refresh_progress_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2dp" />
|
android:layout_height="wrap_content"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
|
|||||||
@@ -83,8 +83,9 @@
|
|||||||
android:id="@+id/tv_delete"
|
android:id="@+id/tv_delete"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
|
||||||
app:icon="@drawable/ic_clear_all"
|
app:icon="@drawable/ic_clear_all"
|
||||||
|
app:iconSize="16dp"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
app:layout_constraintTop_toTopOf="@id/tv_group_s"
|
app:layout_constraintTop_toTopOf="@id/tv_group_s"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/tv_group_s"
|
app:layout_constraintBottom_toBottomOf="@id/tv_group_s"
|
||||||
|
|||||||
@@ -7,40 +7,27 @@
|
|||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:foreground="?attr/selectableItemBackground"
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingVertical="8dp">
|
android:paddingVertical="12dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_good"
|
android:id="@+id/iv_good"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
|
android:padding="2dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:padding="4dp"
|
|
||||||
android:contentDescription="@string/like_source"
|
android:contentDescription="@string/like_source"
|
||||||
android:src="@drawable/ic_praise"
|
android:src="@drawable/ic_praise"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:tint="@color/md_red_A200" />
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:tint="?attr/colorPrimary" />
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_bad"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:rotationX="180"
|
|
||||||
android:contentDescription="@string/not_like_source"
|
|
||||||
android:src="@drawable/ic_praise"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_good"
|
|
||||||
app:tint="@color/md_blue_A200" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 最新章节 -->
|
<!-- 最新章节 -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_last"
|
android:id="@+id/tv_last"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="12dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="?attr/colorSecondary"
|
android:textColor="?attr/colorSecondary"
|
||||||
@@ -56,7 +43,7 @@
|
|||||||
android:id="@+id/tv_author"
|
android:id="@+id/tv_author"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:maxWidth="160dp"
|
android:maxWidth="160dp"
|
||||||
@@ -69,14 +56,14 @@
|
|||||||
android:id="@+id/tv_origin"
|
android:id="@+id/tv_origin"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/iv_bad"
|
app:layout_constraintStart_toEndOf="@id/iv_good"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_last"
|
||||||
app:layout_constraintEnd_toStartOf="@id/tv_author"
|
app:layout_constraintEnd_toStartOf="@id/tv_author"
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_bad"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_bad"
|
|
||||||
tools:text="bookSourceName" />
|
tools:text="bookSourceName" />
|
||||||
|
|
||||||
<!-- 字数 -->
|
<!-- 字数 -->
|
||||||
@@ -84,7 +71,7 @@
|
|||||||
android:id="@+id/tv_current_chapter_word_count"
|
android:id="@+id/tv_current_chapter_word_count"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintEnd_toStartOf="@id/tv_respond_time"
|
app:layout_constraintEnd_toStartOf="@id/tv_respond_time"
|
||||||
@@ -98,7 +85,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBaseline_toBaselineOf="@id/tv_current_chapter_word_count"
|
app:layout_constraintBaseline_toBaselineOf="@id/tv_current_chapter_word_count"
|
||||||
app:layout_constraintEnd_toStartOf="@id/iv_checked"
|
app:layout_constraintEnd_toStartOf="@id/iv_checked"
|
||||||
@@ -109,9 +96,9 @@
|
|||||||
<!-- 选中状态 -->
|
<!-- 选中状态 -->
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_checked"
|
android:id="@+id/iv_checked"
|
||||||
android:layout_width="32dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="24dp"
|
||||||
android:paddingVertical="8dp"
|
android:padding="2dp"
|
||||||
android:src="@drawable/ic_check"
|
android:src="@drawable/ic_check"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -17,29 +17,34 @@
|
|||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:text="@string/select_all" />
|
android:text="@string/select_all" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_revert_selection"
|
android:id="@+id/btn_revert_selection"
|
||||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:text="@string/revert_selection" />
|
android:text="@string/revert_selection" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_select_action_main"
|
android:id="@+id/btn_select_action_main"
|
||||||
|
style="@style/Widget.Material3Expressive.Button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_menu_more"
|
android:id="@+id/iv_menu_more"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/more_menu"
|
android:contentDescription="@string/more_menu"
|
||||||
|
|||||||
Reference in New Issue
Block a user