mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 03:39:19 +01:00
use a badge instead of in library text for list view since it can get cut off (#868)
This commit is contained in:
parent
6194423d17
commit
97c4f6979b
@ -34,11 +34,8 @@ class BrowseSourceListHolder(private val view: View, adapter: FlexibleAdapter<IF
|
||||
*/
|
||||
override fun onSetValues(manga: Manga) {
|
||||
binding.title.text = manga.title
|
||||
with(binding.subtitle) {
|
||||
visibility = if (manga.favorite) View.VISIBLE else View.GONE
|
||||
text = view.resources.getString(R.string.in_library)
|
||||
setTextColor(view.context.getResourceColor(android.R.attr.colorAccent))
|
||||
}
|
||||
binding.inLibraryBadge.inLibraryBadge.visibility = if (manga.favorite) View.VISIBLE else View.GONE
|
||||
|
||||
|
||||
setImage(manga)
|
||||
}
|
||||
|
12
app/src/main/res/layout/in_library_badge.xml
Normal file
12
app/src/main/res/layout/in_library_badge.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/badge"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardBackgroundColor="?attr/colorAccent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
@ -8,6 +8,16 @@
|
||||
android:id="@+id/constraint_layout"
|
||||
android:background="@drawable/list_item_selector">
|
||||
|
||||
<include
|
||||
layout="@layout/in_library_badge"
|
||||
android:id="@+id/in_library_badge"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="2dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card"
|
||||
android:layout_width="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user