Add ripple to menu icons

Supersedes https://github.com/inorichi/tachiyomi/pull/2612
This commit is contained in:
arkon 2020-02-27 18:58:36 -05:00
parent d3a4126e27
commit ac3823e10a
5 changed files with 20 additions and 32 deletions

View File

@ -6,9 +6,7 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.view.setVectorCompat
import java.util.Date
import kotlinx.android.synthetic.main.chapters_item.chapter_date
import kotlinx.android.synthetic.main.chapters_item.chapter_menu
@ -40,9 +38,6 @@ class ChapterHolder(
else -> chapter.name
}
// Set the correct drawable for dropdown and update the tint to match theme.
chapter_menu.setVectorCompat(R.drawable.ic_more_vert_black_24dp, view.context.getResourceColor(R.attr.icon_color))
// Set correct text color
chapter_title.setTextColor(if (chapter.read) adapter.readColor else adapter.unreadColor)
if (chapter.bookmark) chapter_title.setTextColor(adapter.bookmarkedColor)

View File

@ -8,9 +8,7 @@ import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.data.glide.GlideApp
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.view.setVectorCompat
import kotlinx.android.synthetic.main.recent_chapters_item.chapter_menu
import kotlinx.android.synthetic.main.recent_chapters_item.chapter_menu_icon
import kotlinx.android.synthetic.main.recent_chapters_item.chapter_title
import kotlinx.android.synthetic.main.recent_chapters_item.download_text
import kotlinx.android.synthetic.main.recent_chapters_item.manga_cover
@ -68,9 +66,6 @@ class RecentChapterHolder(private val view: View, private val adapter: RecentCha
// Set manga title
manga_title.text = item.manga.title
// Set the correct drawable for dropdown and update the tint to match theme.
chapter_menu_icon.setVectorCompat(R.drawable.ic_more_horiz_black_24dp, view.context.getResourceColor(R.attr.icon_color))
// Set cover
GlideApp.with(itemView.context).clear(manga_cover)
if (!item.manga.thumbnail_url.isNullOrEmpty()) {

View File

@ -57,19 +57,19 @@
app:layout_constraintStart_toStartOf="parent"
tools:text="Pages: 45" />
<ImageView
<ImageButton
android:id="@+id/chapter_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:contentDescription="@string/description_cover"
android:paddingStart="24dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="24dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/action_menu"
android:padding="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more_vert_black_24dp" />
app:layout_constraintBottom_toTopOf="@+id/download_text"
app:srcCompat="@drawable/ic_more_vert_black_24dp"
app:tint="?attr/icon_color" />
<TextView
android:id="@+id/download_text"

View File

@ -59,22 +59,19 @@
app:layout_constraintEnd_toEndOf="parent"
tools:text="Downloaded" />
<FrameLayout
<ImageButton
android:id="@+id/chapter_menu"
android:layout_width="50dp"
android:layout_height="0dp"
android:paddingBottom="18dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/chapter_menu_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:layout_marginEnd="16dp" />
</FrameLayout>
android:layout_marginEnd="8dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/action_menu"
android:padding="8dp"
app:layout_constraintBottom_toTopOf="@+id/download_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more_horiz_black_24dp"
app:tint="?attr/icon_color" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -29,6 +29,7 @@
<!-- Actions -->
<string name="action_settings">Settings</string>
<string name="action_menu">Menu</string>
<string name="action_filter">Filter</string>
<string name="action_filter_downloaded">Downloaded</string>
<string name="action_filter_bookmarked">Bookmarked</string>