书架动画与性能优化 #291
This commit is contained in:
@@ -127,9 +127,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
||||
}
|
||||
|
||||
private fun initRecyclerView() {
|
||||
//binding.rvBookshelf.setEdgeEffectColor(primaryColor)
|
||||
upFastScrollerBar()
|
||||
//binding.refreshLayout.setColorSchemeColors(accentColor)
|
||||
binding.refreshLayout.setOnRefreshListener {
|
||||
val books = booksAdapter.getItems()
|
||||
val refreshList = if (AppConfig.bookshelfRefreshingLimit > 0) {
|
||||
@@ -289,8 +287,6 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
||||
/**
|
||||
* 将 RecyclerView 中的视图全部回收到 RecycledViewPool 中
|
||||
*/
|
||||
upLastUpdateTimeJob?.cancel()
|
||||
booksFlowJob?.cancel()
|
||||
binding.rvBookshelf.setItemViewCacheSize(0)
|
||||
binding.rvBookshelf.adapter = null
|
||||
}
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ abstract class BaseBooksAdapter<VB : ViewBinding>(context: Context) :
|
||||
fun notification(bookUrl: String) {
|
||||
getItems().forEachIndexed { i, it ->
|
||||
if (it.bookUrl == bookUrl) {
|
||||
notifyItemChanged(i, bundleOf("refresh" to true, "lastUpdateTime" to true))
|
||||
notifyItemChanged(i, bundleOf(Pair("refresh", null), Pair("lastUpdateTime", null)))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
+8
-7
@@ -9,6 +9,7 @@ import io.legado.app.databinding.ItemBookshelfGridBinding
|
||||
import io.legado.app.help.book.isLocal
|
||||
import io.legado.app.help.config.AppConfig
|
||||
import io.legado.app.utils.gone
|
||||
import io.legado.app.utils.invisible
|
||||
import io.legado.app.utils.visible
|
||||
|
||||
class BooksAdapterGrid(context: Context, private val callBack: CallBack) :
|
||||
@@ -44,7 +45,7 @@ class BooksAdapterGrid(context: Context, private val callBack: CallBack) :
|
||||
|
||||
private fun upRefresh(binding: ItemBookshelfGridBinding, item: Book) {
|
||||
if (!item.isLocal && callBack.isUpdate(item.bookUrl)) {
|
||||
binding.cdUnread.gone()
|
||||
binding.cdUnread.invisible()
|
||||
binding.rlLoading.visible()
|
||||
} else {
|
||||
binding.rlLoading.gone()
|
||||
@@ -54,25 +55,25 @@ class BooksAdapterGrid(context: Context, private val callBack: CallBack) :
|
||||
binding.cdUnread.visible()
|
||||
binding.tvUnread.text = unreadCount.toString()
|
||||
} else {
|
||||
binding.cdUnread.gone()
|
||||
binding.cdUnread.invisible()
|
||||
}
|
||||
} else {
|
||||
binding.cdUnread.gone()
|
||||
binding.cdUnread.invisible()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerListener(holder: ItemViewHolder, binding: ItemBookshelfGridBinding) {
|
||||
|
||||
binding.cvContent.setOnClickListener {
|
||||
holder.itemView.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.open(it, binding.cdCover)
|
||||
callBack.open(it, binding.root)
|
||||
}
|
||||
}
|
||||
|
||||
binding.cvContent.setOnLongClickListener {
|
||||
holder.itemView.setOnLongClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.openBookInfo(it, binding.cdCover)
|
||||
callBack.openBookInfo(it, binding.root)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
+4
-4
@@ -73,15 +73,15 @@ class BooksAdapterGridCompact(context: Context, private val callBack: CallBack)
|
||||
binding: ItemBookshelfGridCompactBinding
|
||||
) {
|
||||
|
||||
binding.cvContent.setOnClickListener {
|
||||
holder.itemView.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.open(it, binding.cvContent)
|
||||
callBack.open(it, binding.root)
|
||||
}
|
||||
}
|
||||
|
||||
binding.cvContent.setOnLongClickListener {
|
||||
holder.itemView.setOnLongClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.openBookInfo(it, binding.cvContent)
|
||||
callBack.openBookInfo(it, binding.root)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
+4
-4
@@ -74,15 +74,15 @@ class BooksAdapterGridCover(context: Context, private val callBack: CallBack) :
|
||||
binding: ItemBookshelfGridCompactBinding
|
||||
) {
|
||||
|
||||
binding.cvContent.setOnClickListener {
|
||||
holder.itemView.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.open(it, binding.cvContent)
|
||||
callBack.open(it, binding.root)
|
||||
}
|
||||
}
|
||||
|
||||
binding.cvContent.setOnLongClickListener {
|
||||
holder.itemView.setOnLongClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.openBookInfo(it, binding.cvContent)
|
||||
callBack.openBookInfo(it, binding.root)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
+2
-2
@@ -104,13 +104,13 @@ class BooksAdapterList(
|
||||
holder.itemView.apply {
|
||||
binding.cvContent.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.open(it, binding.cdCover)
|
||||
callBack.open(it, binding.cvContent)
|
||||
}
|
||||
}
|
||||
|
||||
binding.cvContent.onLongClick {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.openBookInfo(it, binding.cdCover)
|
||||
callBack.openBookInfo(it, binding.cvContent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -108,13 +108,13 @@ class BooksAdapterListCompact(
|
||||
holder.itemView.apply {
|
||||
binding.cvContent.setOnClickListener {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.open(it, binding.cdCover)
|
||||
callBack.open(it, binding.cvContent)
|
||||
}
|
||||
}
|
||||
|
||||
binding.cvContent.onLongClick {
|
||||
getItem(holder.layoutPosition)?.let {
|
||||
callBack.openBookInfo(it, binding.cdCover)
|
||||
callBack.openBookInfo(it, binding.cvContent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -113,10 +113,10 @@ class BooksAdapterList(context: Context, callBack: CallBack) :
|
||||
|
||||
fun registerListener(item: Any) {
|
||||
binding.cvContent.setOnClickListener {
|
||||
callBack.onItemClick(item, binding.cdCover)
|
||||
callBack.onItemClick(item, binding.cvContent)
|
||||
}
|
||||
binding.cvContent.onLongClick {
|
||||
callBack.onItemLongClick(item, binding.cdCover)
|
||||
callBack.onItemLongClick(item, binding.cvContent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -111,10 +111,10 @@ class BooksAdapterListCompact(context: Context, callBack: CallBack) :
|
||||
|
||||
fun registerListener(item: Any) {
|
||||
binding.cvContent.setOnClickListener {
|
||||
callBack.onItemClick(item, binding.cdCover)
|
||||
callBack.onItemClick(item, binding.cvContent)
|
||||
}
|
||||
binding.cvContent.onLongClick {
|
||||
callBack.onItemLongClick(item, binding.cdCover)
|
||||
callBack.onItemLongClick(item, binding.cvContent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/page_anim"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp" />
|
||||
@@ -268,7 +269,6 @@
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
android:checkable="true"
|
||||
android:clickable="true"
|
||||
android:layout_marginVertical="2dp"
|
||||
app:icon="@drawable/ic_share_layout"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp"
|
||||
@@ -293,7 +293,7 @@
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="44dp"
|
||||
app:layout_constraintStart_toEndOf="@id/cb_share_layout"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -1,106 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView 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="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
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_height="wrap_content"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:strokeWidth="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_margin="8dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<LinearLayout
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="6dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:transitionName="img_cover"
|
||||
app:strokeWidth="0dp">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
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_constraintEnd_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
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_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="10sp"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
tools:text="5"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 书名 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left"
|
||||
android:lines="2"
|
||||
android:text="@string/book_name"
|
||||
android:textSize="12sp"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="10sp"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:includeFontPadding="false"
|
||||
tools:text="5"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 书名 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="2"
|
||||
android:text="@string/book_name"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="RtlHardcoded"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_cover"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
@@ -4,89 +4,84 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:strokeWidth="0dp">
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
android:layout_margin="8dp">
|
||||
|
||||
<FrameLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="12dp">
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cv_content"
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
app:cardCornerRadius="6dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeWidth="0dp">
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover" />
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
android:transitionName="img_cover"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_margin="4dp"
|
||||
android:visibility="visible"
|
||||
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:padding="4dp"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="5" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
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_constraintEnd_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/bg_gradient_black"
|
||||
android:ellipsize="end"
|
||||
android:gravity="bottom|start"
|
||||
android:lines="2"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:paddingVertical="6dp"
|
||||
android:text="@string/book_name"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="10sp"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
android:includeFontPadding="false"
|
||||
tools:text="5"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</FrameLayout>
|
||||
<!-- 书名 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/bg_gradient_black"
|
||||
android:ellipsize="end"
|
||||
android:gravity="bottom|start"
|
||||
android:lines="2"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:paddingVertical="6dp"
|
||||
android:text="@string/book_name"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="RtlHardcoded"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_cover"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
@@ -15,73 +15,55 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="98dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_margin="8dp"
|
||||
android:src="@drawable/image_cover_default"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_cover"
|
||||
android:id="@+id/cd_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="6dp"
|
||||
android:layout_margin="4dp"
|
||||
android:visibility="visible"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:strokeWidth="0dp"
|
||||
android:layout_margin="8dp"
|
||||
android:transitionName="img_cover"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_cover"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="98dp">
|
||||
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover">
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
<TextView
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="10sp"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
tools:text="5"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
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_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="10sp"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
tools:text="5"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
@@ -92,7 +74,7 @@
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/cd_cover"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -15,75 +15,58 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="77dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_margin="8dp"
|
||||
android:src="@drawable/image_cover_default"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_cover"
|
||||
android:id="@+id/cd_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="6dp"
|
||||
android:layout_margin="4dp"
|
||||
android:visibility="visible"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:strokeWidth="0dp"
|
||||
android:layout_margin="8dp"
|
||||
android:transitionName="img_cover"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_cover"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="77dp">
|
||||
app:cardBackgroundColor="?attr/colorSecondaryVariant"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover">
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/image_cover_default"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
<TextView
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="9sp"
|
||||
android:padding="3dp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
tools:text="5"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/rl_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
android:layout_gravity="top"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cd_unread"
|
||||
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_constraintTop_toTopOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_cover">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSecondary"
|
||||
android:textSize="9sp"
|
||||
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>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -92,7 +75,7 @@
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/cd_cover"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
app:cardCornerRadius="8dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="2dp"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:foreground="?android:attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
|
||||
Reference in New Issue
Block a user