mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix language info extensions (#1341)
This commit is contained in:
parent
bffdd2c959
commit
fe53f158c6
3 changed files with 4 additions and 6 deletions
|
@ -26,10 +26,7 @@ class SourceHolder(view: View, val adapter: SourceAdapter) :
|
|||
val source = item.source
|
||||
|
||||
// Set source name
|
||||
val sourceName =
|
||||
if (adapter.isMultiLanguage) source.toString() else source.name.replaceFirstChar {
|
||||
it.titlecase(Locale.getDefault())
|
||||
} + " (${item.numberOfItems})"
|
||||
val sourceName = source.name.replaceFirstChar { it.titlecase(Locale.getDefault()) } + " (${item.numberOfItems})"
|
||||
binding.title.text = sourceName
|
||||
binding.lang.text = when {
|
||||
item.isUninstalled -> itemView.context.getString(R.string.source_not_installed)
|
||||
|
|
|
@ -30,10 +30,11 @@ class SourceHolder(view: View, val adapter: SourceAdapter) :
|
|||
// setCardEdges(item)
|
||||
|
||||
val underPinnedSection = item.header?.code?.equals(SourcePresenter.PINNED_KEY) ?: false
|
||||
val underLastUsedSection = item.header?.code?.equals(SourcePresenter.LAST_USED_KEY) ?: false
|
||||
val isPinned = item.isPinned ?: underPinnedSection
|
||||
// Set source name
|
||||
val sourceName =
|
||||
if (adapter.isMultiLanguage && underPinnedSection) source.toString() else source.name
|
||||
if (adapter.isMultiLanguage && (underPinnedSection || underLastUsedSection)) source.toString() else source.name
|
||||
binding.title.text = sourceName
|
||||
|
||||
binding.sourcePin.apply {
|
||||
|
|
|
@ -109,7 +109,7 @@ class SourcePresenter(
|
|||
val pinnedCatalogues = preferences.pinnedCatalogues().get()
|
||||
val isPinned = source.id.toString() in pinnedCatalogues
|
||||
if (isPinned) null
|
||||
else SourceItem(source, null, isPinned)
|
||||
else SourceItem(source, LangItem(LAST_USED_KEY), isPinned)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue