Extract some hardcoded strings (closes #1989)

This commit is contained in:
Eugene 2019-12-22 15:48:36 -05:00
parent 3a7cdfcaa4
commit 0416a2ff15
No known key found for this signature in database
GPG Key ID: E1FD745328866B0A
3 changed files with 18 additions and 13 deletions

View File

@ -341,19 +341,22 @@ open class BrowseCatalogueController(bundle: Bundle) :
adapter.onLoadMoreComplete(null) adapter.onLoadMoreComplete(null)
hideProgressBar() hideProgressBar()
val message = if (error is NoResultsException) "No results found" else (error.message ?: "")
snack?.dismiss() snack?.dismiss()
snack = catalogue_view?.snack(message, Snackbar.LENGTH_INDEFINITE) {
setAction(R.string.action_retry) { if (catalogue_view != null) {
// If not the first page, show bottom progress bar. val message = if (error is NoResultsException) catalogue_view.context.getString(R.string.no_results_found) else (error.message ?: "")
if (adapter.mainItemCount > 0) {
val item = progressItem ?: return@setAction snack = catalogue_view.snack(message, Snackbar.LENGTH_INDEFINITE) {
adapter.addScrollableFooterWithDelay(item, 0, true) setAction(R.string.action_retry) {
} else { // If not the first page, show bottom progress bar.
showProgressBar() if (adapter.mainItemCount > 0) {
val item = progressItem ?: return@setAction
adapter.addScrollableFooterWithDelay(item, 0, true)
} else {
showProgressBar()
}
presenter.requestNext()
} }
presenter.requestNext()
} }
} }
} }

View File

@ -5,7 +5,7 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.AbstractHeaderItem import eu.davidea.flexibleadapter.items.AbstractHeaderItem
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import kotlinx.android.synthetic.main.catalogue_main_controller_card.* import kotlinx.android.synthetic.main.catalogue_main_controller_card.title
/** /**
* Item that contains the selection header. * Item that contains the selection header.
@ -36,7 +36,7 @@ class SelectionHeader : AbstractHeaderItem<SelectionHeader.Holder>() {
class Holder(view: View, adapter: FlexibleAdapter<*>) : BaseFlexibleViewHolder(view, adapter) { class Holder(view: View, adapter: FlexibleAdapter<*>) : BaseFlexibleViewHolder(view, adapter) {
init { init {
title.text = "Please select a source to migrate from" title.text = view.context.getString(R.string.migration_selection_prompt)
} }
} }

View File

@ -323,6 +323,7 @@
<string name="select_source">Select a source</string> <string name="select_source">Select a source</string>
<string name="no_valid_sources">Please enable at least one valid source</string> <string name="no_valid_sources">Please enable at least one valid source</string>
<string name="no_more_results">No more results</string> <string name="no_more_results">No more results</string>
<string name="no_results_found">No results found</string>
<string name="local_source">Local manga</string> <string name="local_source">Local manga</string>
<string name="other_source">Other</string> <string name="other_source">Other</string>
<string name="invalid_combination">Default can\'t be selected with other categories</string> <string name="invalid_combination">Default can\'t be selected with other categories</string>
@ -455,6 +456,7 @@
<!-- Source migration screen --> <!-- Source migration screen -->
<string name="migration_info">Tap to select the source to migrate from</string> <string name="migration_info">Tap to select the source to migrate from</string>
<string name="migration_dialog_what_to_include">Select data to include</string> <string name="migration_dialog_what_to_include">Select data to include</string>
<string name="migration_selection_prompt">Select a source to migrate from</string>
<string name="select">Select</string> <string name="select">Select</string>
<string name="migrate">Migrate</string> <string name="migrate">Migrate</string>
<string name="copy">Copy</string> <string name="copy">Copy</string>