From ed41604f5667cc63778282c69d90d71d070422fb Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 12 Oct 2020 17:35:08 -0400 Subject: [PATCH] Show locale in sources list items --- .../tachiyomi/ui/browse/source/SourceHolder.kt | 5 ++++- .../source_main_controller_card_item.xml | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt index df5833b537..2252f46ed2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt @@ -6,11 +6,13 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.icon import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder +import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.view.setVectorCompat import kotlinx.android.synthetic.main.source_main_controller_card_item.image import kotlinx.android.synthetic.main.source_main_controller_card_item.pin import kotlinx.android.synthetic.main.source_main_controller_card_item.source_latest +import kotlinx.android.synthetic.main.source_main_controller_card_item.subtitle import kotlinx.android.synthetic.main.source_main_controller_card_item.title class SourceHolder(private val view: View, val adapter: SourceAdapter) : @@ -29,8 +31,9 @@ class SourceHolder(private val view: View, val adapter: SourceAdapter) : fun bind(item: SourceItem) { val source = item.source - // Set source name title.text = source.name + subtitle.isVisible = true + subtitle.text = LocaleHelper.getDisplayName(source.lang) // Set source icon itemView.post { diff --git a/app/src/main/res/layout/source_main_controller_card_item.xml b/app/src/main/res/layout/source_main_controller_card_item.xml index 2b6448a699..22cbb430a9 100644 --- a/app/src/main/res/layout/source_main_controller_card_item.xml +++ b/app/src/main/res/layout/source_main_controller_card_item.xml @@ -28,12 +28,28 @@ android:paddingStart="0dp" android:paddingEnd="8dp" android:textAppearance="@style/TextAppearance.Regular.SubHeading" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toTopOf="@id/subtitle" app:layout_constraintEnd_toStartOf="@+id/source_latest" app:layout_constraintStart_toEndOf="@+id/image" app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" tools:text="Source title" /> + +