[新增] 添加书籍的类型的标识 #414
This commit is contained in:
@@ -226,4 +226,6 @@ object PreferKey {
|
|||||||
const val exploreLayoutState = "exploreLayoutState"
|
const val exploreLayoutState = "exploreLayoutState"
|
||||||
|
|
||||||
const val defaultSourceChangeAll = "defaultSourceChangeAll"
|
const val defaultSourceChangeAll = "defaultSourceChangeAll"
|
||||||
|
|
||||||
|
const val showTip = "showTip"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,22 @@ val Book.archiveName: String
|
|||||||
return origin.substringAfter("::").substringAfterLast("/")
|
return origin.substringAfter("::").substringAfterLast("/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Book.getBookTypeName(): String {
|
||||||
|
return when {
|
||||||
|
isLocalTxt -> "TXT"
|
||||||
|
isEpub -> "EPUB"
|
||||||
|
isUmd -> "UMD"
|
||||||
|
isPdf -> "PDF"
|
||||||
|
isMobi -> "MOBI"
|
||||||
|
isAudio -> "有声书"
|
||||||
|
isImage -> "漫画"
|
||||||
|
isOnLineTxt -> "小说"
|
||||||
|
isWebFile -> "网页文件"
|
||||||
|
else -> "未知类型"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun Book.contains(word: String?): Boolean {
|
fun Book.contains(word: String?): Boolean {
|
||||||
if (word.isNullOrEmpty()) {
|
if (word.isNullOrEmpty()) {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -157,6 +157,12 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
appCtx.putPrefBoolean(PreferKey.showUnread, value)
|
appCtx.putPrefBoolean(PreferKey.showUnread, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var showTip: Boolean
|
||||||
|
get() = appCtx.getPrefBoolean(PreferKey.showTip, false)
|
||||||
|
set(value) {
|
||||||
|
appCtx.putPrefBoolean(PreferKey.showTip, value)
|
||||||
|
}
|
||||||
|
|
||||||
var showUnreadNew: Boolean
|
var showUnreadNew: Boolean
|
||||||
get() = appCtx.getPrefBoolean(PreferKey.showUnreadNew, true)
|
get() = appCtx.getPrefBoolean(PreferKey.showUnreadNew, true)
|
||||||
set(value) {
|
set(value) {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ class BookshelfConfigBottomSheet : BaseBottomSheetDialogFragment(R.layout.dialog
|
|||||||
|
|
||||||
swShowUnread.isChecked = AppConfig.showUnread
|
swShowUnread.isChecked = AppConfig.showUnread
|
||||||
swShowUnreadNew.isChecked = AppConfig.showUnreadNew
|
swShowUnreadNew.isChecked = AppConfig.showUnreadNew
|
||||||
|
swShowTip.isChecked = AppConfig.showTip
|
||||||
swShowLastUpdateTime.isChecked = AppConfig.showLastUpdateTime
|
swShowLastUpdateTime.isChecked = AppConfig.showLastUpdateTime
|
||||||
swShowWaitUpBooks.isChecked = AppConfig.showWaitUpCount
|
swShowWaitUpBooks.isChecked = AppConfig.showWaitUpCount
|
||||||
swShowBookshelfFastScroller.isChecked = AppConfig.showBookshelfFastScroller
|
swShowBookshelfFastScroller.isChecked = AppConfig.showBookshelfFastScroller
|
||||||
@@ -124,6 +125,10 @@ class BookshelfConfigBottomSheet : BaseBottomSheetDialogFragment(R.layout.dialog
|
|||||||
AppConfig.showUnreadNew = swShowUnreadNew.isChecked
|
AppConfig.showUnreadNew = swShowUnreadNew.isChecked
|
||||||
postEvent(EventBus.BOOKSHELF_REFRESH, "")
|
postEvent(EventBus.BOOKSHELF_REFRESH, "")
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip != swShowTip.isChecked) {
|
||||||
|
AppConfig.showTip = swShowTip.isChecked
|
||||||
|
postEvent(EventBus.BOOKSHELF_REFRESH, "")
|
||||||
|
}
|
||||||
if (AppConfig.showLastUpdateTime != swShowLastUpdateTime.isChecked) {
|
if (AppConfig.showLastUpdateTime != swShowLastUpdateTime.isChecked) {
|
||||||
AppConfig.showLastUpdateTime = swShowLastUpdateTime.isChecked
|
AppConfig.showLastUpdateTime = swShowLastUpdateTime.isChecked
|
||||||
postEvent(EventBus.BOOKSHELF_REFRESH, "")
|
postEvent(EventBus.BOOKSHELF_REFRESH, "")
|
||||||
|
|||||||
+8
@@ -7,6 +7,7 @@ import androidx.core.view.isVisible
|
|||||||
import io.legado.app.base.adapter.ItemViewHolder
|
import io.legado.app.base.adapter.ItemViewHolder
|
||||||
import io.legado.app.data.entities.Book
|
import io.legado.app.data.entities.Book
|
||||||
import io.legado.app.databinding.ItemBookshelfGridBinding
|
import io.legado.app.databinding.ItemBookshelfGridBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
@@ -46,6 +47,7 @@ class BooksAdapterGrid(context: Context, private val callBack: CallBack) :
|
|||||||
private fun upRefresh(binding: ItemBookshelfGridBinding, item: Book) {
|
private fun upRefresh(binding: ItemBookshelfGridBinding, item: Book) {
|
||||||
if (!item.isLocal && callBack.isUpdate(item.bookUrl)) {
|
if (!item.isLocal && callBack.isUpdate(item.bookUrl)) {
|
||||||
binding.cdUnread.gone()
|
binding.cdUnread.gone()
|
||||||
|
binding.cdTip.visible()
|
||||||
binding.rlLoading.visible()
|
binding.rlLoading.visible()
|
||||||
} else {
|
} else {
|
||||||
binding.rlLoading.gone()
|
binding.rlLoading.gone()
|
||||||
@@ -63,6 +65,12 @@ class BooksAdapterGrid(context: Context, private val callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.gone()
|
binding.cdUnread.gone()
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
@@ -8,9 +8,11 @@ import androidx.core.view.isVisible
|
|||||||
import io.legado.app.base.adapter.ItemViewHolder
|
import io.legado.app.base.adapter.ItemViewHolder
|
||||||
import io.legado.app.data.entities.Book
|
import io.legado.app.data.entities.Book
|
||||||
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
|
import io.legado.app.utils.visible
|
||||||
|
|
||||||
class BooksAdapterGridCompact(context: Context, private val callBack: CallBack) :
|
class BooksAdapterGridCompact(context: Context, private val callBack: CallBack) :
|
||||||
BaseBooksAdapter<ItemBookshelfGridCompactBinding>(context) {
|
BaseBooksAdapter<ItemBookshelfGridCompactBinding>(context) {
|
||||||
@@ -70,6 +72,12 @@ class BooksAdapterGridCompact(context: Context, private val callBack: CallBack)
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.visibility = View.GONE
|
binding.cdUnread.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
@@ -8,9 +8,11 @@ import androidx.core.view.isVisible
|
|||||||
import io.legado.app.base.adapter.ItemViewHolder
|
import io.legado.app.base.adapter.ItemViewHolder
|
||||||
import io.legado.app.data.entities.Book
|
import io.legado.app.data.entities.Book
|
||||||
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
|
import io.legado.app.utils.visible
|
||||||
|
|
||||||
class BooksAdapterGridCover(context: Context, private val callBack: CallBack) :
|
class BooksAdapterGridCover(context: Context, private val callBack: CallBack) :
|
||||||
BaseBooksAdapter<ItemBookshelfGridCompactBinding>(context) {
|
BaseBooksAdapter<ItemBookshelfGridCompactBinding>(context) {
|
||||||
@@ -70,6 +72,12 @@ class BooksAdapterGridCover(context: Context, private val callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.visibility = View.GONE
|
binding.cdUnread.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
@@ -9,6 +9,7 @@ import androidx.lifecycle.Lifecycle
|
|||||||
import io.legado.app.base.adapter.ItemViewHolder
|
import io.legado.app.base.adapter.ItemViewHolder
|
||||||
import io.legado.app.data.entities.Book
|
import io.legado.app.data.entities.Book
|
||||||
import io.legado.app.databinding.ItemBookshelfListBinding
|
import io.legado.app.databinding.ItemBookshelfListBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
@@ -88,6 +89,12 @@ class BooksAdapterList(
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.gone()
|
binding.cdUnread.gone()
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
@@ -10,6 +10,7 @@ import io.legado.app.R
|
|||||||
import io.legado.app.base.adapter.ItemViewHolder
|
import io.legado.app.base.adapter.ItemViewHolder
|
||||||
import io.legado.app.data.entities.Book
|
import io.legado.app.data.entities.Book
|
||||||
import io.legado.app.databinding.ItemBookshelfListCompactBinding
|
import io.legado.app.databinding.ItemBookshelfListCompactBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
@@ -92,6 +93,12 @@ class BooksAdapterListCompact(
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.gone()
|
binding.cdUnread.gone()
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookGroup
|
import io.legado.app.data.entities.BookGroup
|
||||||
import io.legado.app.databinding.ItemBookshelfGridBinding
|
import io.legado.app.databinding.ItemBookshelfGridBinding
|
||||||
import io.legado.app.databinding.ItemBookshelfGridGroupBinding
|
import io.legado.app.databinding.ItemBookshelfGridGroupBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
|
import io.legado.app.utils.visible
|
||||||
import splitties.views.onLongClick
|
import splitties.views.onLongClick
|
||||||
|
|
||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
@@ -119,6 +121,12 @@ class BooksAdapterGrid(context: Context, callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.visibility = View.GONE
|
binding.cdUnread.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
@@ -12,9 +12,11 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookGroup
|
import io.legado.app.data.entities.BookGroup
|
||||||
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
||||||
import io.legado.app.databinding.ItemBookshelfGridCompactGroupBinding
|
import io.legado.app.databinding.ItemBookshelfGridCompactGroupBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
|
import io.legado.app.utils.visible
|
||||||
import splitties.views.onLongClick
|
import splitties.views.onLongClick
|
||||||
|
|
||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
@@ -126,6 +128,12 @@ class BooksAdapterGridCompact(context: Context, callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.visibility = View.GONE
|
binding.cdUnread.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
@@ -12,9 +12,11 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookGroup
|
import io.legado.app.data.entities.BookGroup
|
||||||
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
import io.legado.app.databinding.ItemBookshelfGridCompactBinding
|
||||||
import io.legado.app.databinding.ItemBookshelfGridCompactGroupBinding
|
import io.legado.app.databinding.ItemBookshelfGridCompactGroupBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
|
import io.legado.app.utils.visible
|
||||||
import splitties.views.onLongClick
|
import splitties.views.onLongClick
|
||||||
|
|
||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
@@ -126,6 +128,12 @@ class BooksAdapterGridCover(context: Context, callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.visibility = View.GONE
|
binding.cdUnread.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookGroup
|
import io.legado.app.data.entities.BookGroup
|
||||||
import io.legado.app.databinding.ItemBookshelfListBinding
|
import io.legado.app.databinding.ItemBookshelfListBinding
|
||||||
import io.legado.app.databinding.ItemBookshelfListGroupBinding
|
import io.legado.app.databinding.ItemBookshelfListGroupBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
@@ -140,6 +141,12 @@ class BooksAdapterList(context: Context, callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.gone()
|
binding.cdUnread.gone()
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
@@ -11,6 +11,7 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookGroup
|
import io.legado.app.data.entities.BookGroup
|
||||||
import io.legado.app.databinding.ItemBookshelfListCompactBinding
|
import io.legado.app.databinding.ItemBookshelfListCompactBinding
|
||||||
import io.legado.app.databinding.ItemBookshelfListCompactGroupBinding
|
import io.legado.app.databinding.ItemBookshelfListCompactGroupBinding
|
||||||
|
import io.legado.app.help.book.getBookTypeName
|
||||||
import io.legado.app.help.book.isLocal
|
import io.legado.app.help.book.isLocal
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
@@ -138,6 +139,12 @@ class BooksAdapterListCompact(context: Context, callBack: CallBack) :
|
|||||||
} else {
|
} else {
|
||||||
binding.cdUnread.gone()
|
binding.cdUnread.gone()
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showTip){
|
||||||
|
binding.cdTip.visible()
|
||||||
|
binding.tvTip.text = item.getBookTypeName()
|
||||||
|
} else {
|
||||||
|
binding.cdTip.gone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,12 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/show_unread_new" />
|
android:text="@string/show_unread_new" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/sw_show_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/show_tip" />
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
android:id="@+id/sw_show_last_update_time"
|
android:id="@+id/sw_show_last_update_time"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -95,6 +95,32 @@
|
|||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/cd_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:strokeWidth="0dp"
|
||||||
|
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/colorOnSecondary"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
tools:text="5"
|
||||||
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|||||||
@@ -7,23 +7,22 @@
|
|||||||
app:cardBackgroundColor="@android:color/transparent"
|
app:cardBackgroundColor="@android:color/transparent"
|
||||||
app:strokeWidth="0dp">
|
app:strokeWidth="0dp">
|
||||||
|
|
||||||
<FrameLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/cv_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingHorizontal="8dp"
|
android:clickable="true"
|
||||||
android:paddingTop="2dp"
|
android:focusable="true"
|
||||||
android:paddingBottom="12dp">
|
android:layout_marginHorizontal="8dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
app:cardBackgroundColor="@android:color/transparent"
|
||||||
|
app:cardCornerRadius="6dp"
|
||||||
|
app:strokeWidth="0dp">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cv_content"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
app:cardBackgroundColor="@android:color/transparent"
|
|
||||||
app:cardCornerRadius="6dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:strokeWidth="0dp">
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.image.CoverImageView
|
<io.legado.app.ui.widget.image.CoverImageView
|
||||||
android:id="@+id/iv_cover"
|
android:id="@+id/iv_cover"
|
||||||
@@ -32,31 +31,36 @@
|
|||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/image_cover_default"
|
android:src="@drawable/image_cover_default"
|
||||||
android:transitionName="img_cover"
|
android:transitionName="img_cover"
|
||||||
tools:ignore="ImageContrastCheck" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/rl_loading"
|
android:id="@+id/rl_loading"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="top"
|
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginVertical="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/cd_unread"
|
android:id="@+id/cd_unread"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
android:visibility="visible"
|
|
||||||
app:cardCornerRadius="4dp"
|
app:cardCornerRadius="4dp"
|
||||||
app:strokeWidth="0dp"
|
|
||||||
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||||
android:layout_gravity="end|top">
|
app:strokeWidth="0dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@@ -65,8 +69,8 @@
|
|||||||
android:id="@+id/new_chapter"
|
android:id="@+id/new_chapter"
|
||||||
android:layout_width="6dp"
|
android:layout_width="6dp"
|
||||||
android:layout_height="6dp"
|
android:layout_height="6dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
|
android:visibility="gone"
|
||||||
app:strokeWidth="0dp"
|
app:strokeWidth="0dp"
|
||||||
app:cardBackgroundColor="?attr/colorSecondaryContainer" />
|
app:cardBackgroundColor="?attr/colorSecondaryContainer" />
|
||||||
|
|
||||||
@@ -74,9 +78,9 @@
|
|||||||
android:id="@+id/tv_unread"
|
android:id="@+id/tv_unread"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="4dp"
|
||||||
android:textColor="?attr/colorOnSecondary"
|
android:textColor="?attr/colorOnSecondary"
|
||||||
android:textSize="9sp"
|
android:textSize="9sp"
|
||||||
android:padding="4dp"
|
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
tools:text="5"
|
tools:text="5"
|
||||||
@@ -85,25 +89,52 @@
|
|||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/cd_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:strokeWidth="0dp"
|
||||||
|
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_name">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/colorOnSecondary"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
tools:text="5"
|
||||||
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@drawable/bg_gradient_black"
|
android:background="@drawable/bg_gradient_black"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="bottom|start"
|
android:gravity="bottom|start"
|
||||||
android:lines="2"
|
android:maxLines="2"
|
||||||
android:paddingHorizontal="6dp"
|
android:paddingHorizontal="6dp"
|
||||||
android:paddingVertical="6dp"
|
android:paddingBottom="6dp"
|
||||||
android:text="@string/book_name"
|
android:text="@string/book_name"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:ignore="RtlHardcoded" />
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
</com.google.android.material.card.MaterialCardView>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
</FrameLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,32 @@
|
|||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/cd_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:strokeWidth="0dp"
|
||||||
|
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/colorOnSecondary"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
tools:text="5"
|
||||||
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,32 @@
|
|||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/cd_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:strokeWidth="0dp"
|
||||||
|
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/colorOnSecondary"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
tools:text="5"
|
||||||
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|||||||
@@ -1350,4 +1350,5 @@
|
|||||||
<string name="show_unread_new">显示新章节更新标志</string>
|
<string name="show_unread_new">显示新章节更新标志</string>
|
||||||
<string name="read_change_all">换源按钮默认弹出整书换源</string>
|
<string name="read_change_all">换源按钮默认弹出整书换源</string>
|
||||||
<string name="read_change_all_s">反之则默认弹出单章换源</string>
|
<string name="read_change_all_s">反之则默认弹出单章换源</string>
|
||||||
|
<string name="show_tip">显示书籍类型</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1353,4 +1353,5 @@
|
|||||||
<string name="show_unread_new">显示新章节更新标志</string>
|
<string name="show_unread_new">显示新章节更新标志</string>
|
||||||
<string name="read_change_all">换源按钮默认弹出整书换源</string>
|
<string name="read_change_all">换源按钮默认弹出整书换源</string>
|
||||||
<string name="read_change_all_s">反之则默认弹出单章换源</string>
|
<string name="read_change_all_s">反之则默认弹出单章换源</string>
|
||||||
|
<string name="show_tip">显示书籍类型</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user