From a746d4cc3a66cfd6bddaebc5ff91c865c2b7d83b Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 24 Jan 2020 12:18:55 -0500 Subject: [PATCH] Tweak initial tracker card appearance --- .../tachiyomi/ui/manga/track/TrackHolder.kt | 14 +- app/src/main/res/layout/track_item.xml | 229 +++++++++--------- app/src/main/res/values/styles.xml | 6 - 3 files changed, 121 insertions(+), 128 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt index c8c9da6887..1e72cf7fa4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt @@ -4,17 +4,21 @@ import android.annotation.SuppressLint import android.view.View import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.holder.BaseViewHolder +import eu.kanade.tachiyomi.util.visibleIf import kotlinx.android.synthetic.main.track_item.* class TrackHolder(view: View, adapter: TrackAdapter) : BaseViewHolder(view) { init { val listener = adapter.rowClickListener + logo_container.setOnClickListener { listener.onLogoClick(adapterPosition) } title_container.setOnClickListener { listener.onTitleClick(adapterPosition) } status_container.setOnClickListener { listener.onStatusClick(adapterPosition) } chapters_container.setOnClickListener { listener.onChaptersClick(adapterPosition) } score_container.setOnClickListener { listener.onScoreClick(adapterPosition) } + + track_set.setOnClickListener { listener.onTitleClick(adapterPosition) } } @SuppressLint("SetTextI18n") @@ -23,6 +27,10 @@ class TrackHolder(view: View, adapter: TrackAdapter) : BaseViewHolder(view) { val track = item.track track_logo.setImageResource(item.service.getLogo()) logo_container.setBackgroundColor(item.service.getLogoColor()) + + track_details.visibleIf { track != null } + track_set.visibleIf { track == null } + if (track != null) { track_title.setTextAppearance(itemView.context, R.style.TextAppearance_Regular_Body1_Secondary) track_title.isAllCaps = false @@ -31,12 +39,6 @@ class TrackHolder(view: View, adapter: TrackAdapter) : BaseViewHolder(view) { if (track.total_chapters > 0) track.total_chapters else "-" track_status.text = item.service.getStatus(track.status) track_score.text = if (track.score == 0f) "-" else item.service.displayScore(track) - } else { - track_title.setTextAppearance(itemView.context, R.style.TextAppearance_Medium_Button) - track_title.setText(R.string.action_edit) - track_chapters.text = "" - track_score.text = "" - track_status.text = "" } } } diff --git a/app/src/main/res/layout/track_item.xml b/app/src/main/res/layout/track_item.xml index 029ca35fd3..07a93fbdea 100644 --- a/app/src/main/res/layout/track_item.xml +++ b/app/src/main/res/layout/track_item.xml @@ -14,10 +14,10 @@ android:id="@+id/logo_container" android:layout_width="48dp" android:layout_height="0dp" + android:clickable="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - android:clickable="true" tools:background="#2E51A2"> - + + - - - + android:background="?attr/selectable_list_drawable" + android:clickable="true" + android:padding="16dp"> - + - + - + - + - + android:background="?attr/selectable_list_drawable" + android:clickable="true" + android:padding="16dp"> - + - + - + - + - + android:background="?attr/selectable_list_drawable" + android:clickable="true" + android:padding="16dp"> - + - + - + - + - + android:background="?attr/selectable_list_drawable" + android:clickable="true" + android:padding="16dp"> + + + + + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ce16d514ad..0adfb1b256 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -129,12 +129,6 @@ ?android:attr/textColorHint - -