Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ class TemplatePreviewerPage : Fragment(R.layout.template_previewer_container) {
lifecycleScope.launch {
val cardsWithEmptyFronts = viewModel.cardsWithEmptyFronts?.await()
for ((index, templateName) in viewModel.getTemplateNames().withIndex()) {
val newTab = tabLayout.newTab().setText(templateName)
if (cardsWithEmptyFronts?.get(index) == true) {
val badge = newTab.getOrCreateBadge()
badge.horizontalOffset = -4
}
val tabTitle =
if (cardsWithEmptyFronts?.get(index) == true) {
getString(R.string.card_previewer_empty_front_indicator, templateName)
} else {
templateName
}
val newTab = tabLayout.newTab().setText(tabTitle)
tabLayout.addTab(newTab)
}
tabLayout.selectTab(tabLayout.getTabAt(viewModel.getCurrentTabIndex()))
Expand Down
1 change: 1 addition & 0 deletions AnkiDroid/src/main/res/values/02-strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<string name="field_remapping">%1$s (from “%2$s”)</string>
<string name="confirm_map_cards_to_nothing">Any cards mapped to nothing will be deleted. If a note has no remaining cards, it will be lost. Are you sure you want to continue?</string>
<string name="missing_note_type">No note type found</string>
<string name="card_previewer_empty_front_indicator" comment="Extra text appended onto a tab title in the card previewer so that the user can see at a glance whether a card has no front.">%1$s (empty)</string>

<!-- Timebox -->
<string name="timebox_reached_title">Timebox reached</string>
Expand Down