mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Extract some hardcoded strings (closes #1989)
This commit is contained in:
		@@ -341,19 +341,22 @@ open class BrowseCatalogueController(bundle: Bundle) :
 | 
			
		||||
        adapter.onLoadMoreComplete(null)
 | 
			
		||||
        hideProgressBar()
 | 
			
		||||
 | 
			
		||||
        val message = if (error is NoResultsException) "No results found" else (error.message ?: "")
 | 
			
		||||
 | 
			
		||||
        snack?.dismiss()
 | 
			
		||||
        snack = catalogue_view?.snack(message, Snackbar.LENGTH_INDEFINITE) {
 | 
			
		||||
            setAction(R.string.action_retry) {
 | 
			
		||||
                // If not the first page, show bottom progress bar.
 | 
			
		||||
                if (adapter.mainItemCount > 0) {
 | 
			
		||||
                    val item = progressItem ?: return@setAction
 | 
			
		||||
                    adapter.addScrollableFooterWithDelay(item, 0, true)
 | 
			
		||||
                } else {
 | 
			
		||||
                    showProgressBar()
 | 
			
		||||
 | 
			
		||||
        if (catalogue_view != null) {
 | 
			
		||||
            val message = if (error is NoResultsException) catalogue_view.context.getString(R.string.no_results_found) else (error.message ?: "")
 | 
			
		||||
 | 
			
		||||
            snack = catalogue_view.snack(message, Snackbar.LENGTH_INDEFINITE) {
 | 
			
		||||
                setAction(R.string.action_retry) {
 | 
			
		||||
                    // If not the first page, show bottom progress bar.
 | 
			
		||||
                    if (adapter.mainItemCount > 0) {
 | 
			
		||||
                        val item = progressItem ?: return@setAction
 | 
			
		||||
                        adapter.addScrollableFooterWithDelay(item, 0, true)
 | 
			
		||||
                    } else {
 | 
			
		||||
                        showProgressBar()
 | 
			
		||||
                    }
 | 
			
		||||
                    presenter.requestNext()
 | 
			
		||||
                }
 | 
			
		||||
                presenter.requestNext()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
 | 
			
		||||
import eu.davidea.flexibleadapter.items.AbstractHeaderItem
 | 
			
		||||
import eu.kanade.tachiyomi.R
 | 
			
		||||
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.
 | 
			
		||||
@@ -36,7 +36,7 @@ class SelectionHeader : AbstractHeaderItem<SelectionHeader.Holder>() {
 | 
			
		||||
 | 
			
		||||
    class Holder(view: View, adapter: FlexibleAdapter<*>) : BaseFlexibleViewHolder(view, adapter) {
 | 
			
		||||
        init {
 | 
			
		||||
            title.text = "Please select a source to migrate from"
 | 
			
		||||
            title.text = view.context.getString(R.string.migration_selection_prompt)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user