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.database.models.Manga
import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder 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.gone
import eu.kanade.tachiyomi.util.view.setVectorCompat
import java.util.Date import java.util.Date
import kotlinx.android.synthetic.main.chapters_item.chapter_date import kotlinx.android.synthetic.main.chapters_item.chapter_date
import kotlinx.android.synthetic.main.chapters_item.chapter_menu import kotlinx.android.synthetic.main.chapters_item.chapter_menu
@ -40,9 +38,6 @@ class ChapterHolder(
else -> chapter.name 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 // Set correct text color
chapter_title.setTextColor(if (chapter.read) adapter.readColor else adapter.unreadColor) chapter_title.setTextColor(if (chapter.read) adapter.readColor else adapter.unreadColor)
if (chapter.bookmark) chapter_title.setTextColor(adapter.bookmarkedColor) 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.data.glide.GlideApp
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.util.system.getResourceColor 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
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.chapter_title
import kotlinx.android.synthetic.main.recent_chapters_item.download_text import kotlinx.android.synthetic.main.recent_chapters_item.download_text
import kotlinx.android.synthetic.main.recent_chapters_item.manga_cover 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 // Set manga title
manga_title.text = item.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 // Set cover
GlideApp.with(itemView.context).clear(manga_cover) GlideApp.with(itemView.context).clear(manga_cover)
if (!item.manga.thumbnail_url.isNullOrEmpty()) { if (!item.manga.thumbnail_url.isNullOrEmpty()) {

View File

@ -57,19 +57,19 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
tools:text="Pages: 45" /> tools:text="Pages: 45" />
<ImageView <ImageButton
android:id="@+id/chapter_menu" android:id="@+id/chapter_menu"
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="8dp"
android:contentDescription="@string/description_cover" android:background="?selectableItemBackgroundBorderless"
android:paddingStart="24dp" android:contentDescription="@string/action_menu"
android:paddingTop="12dp" android:padding="8dp"
android:paddingEnd="16dp"
android:paddingBottom="24dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="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 <TextView
android:id="@+id/download_text" android:id="@+id/download_text"

View File

@ -59,22 +59,19 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
tools:text="Downloaded" /> tools:text="Downloaded" />
<FrameLayout <ImageButton
android:id="@+id/chapter_menu" android:id="@+id/chapter_menu"
android:layout_width="50dp" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="wrap_content"
android:paddingBottom="18dp" android:layout_gravity="center|end"
app:layout_constraintBottom_toBottomOf="parent" 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_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more_horiz_black_24dp"
<ImageView app:tint="?attr/icon_color" />
android:id="@+id/chapter_menu_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center|end"
android:layout_marginEnd="16dp" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

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