Add source categories removing the source in the language as a option
This commit is contained in:
parent
604b4ec01e
commit
4bd88fa194
@ -283,6 +283,8 @@ object PreferenceKeys {
|
|||||||
|
|
||||||
const val sources_tab_categories = "sources_tab_categories"
|
const val sources_tab_categories = "sources_tab_categories"
|
||||||
|
|
||||||
|
const val sources_tab_categories_filter = "sources_tab_categories_filter"
|
||||||
|
|
||||||
const val sources_tab_source_categories = "sources_tab_source_categories"
|
const val sources_tab_source_categories = "sources_tab_source_categories"
|
||||||
|
|
||||||
const val sourcesSort = "sources_sort"
|
const val sourcesSort = "sources_sort"
|
||||||
|
@ -403,6 +403,8 @@ class PreferencesHelper(val context: Context) {
|
|||||||
|
|
||||||
fun sourcesTabCategories() = flowPrefs.getStringSet(Keys.sources_tab_categories, mutableSetOf())
|
fun sourcesTabCategories() = flowPrefs.getStringSet(Keys.sources_tab_categories, mutableSetOf())
|
||||||
|
|
||||||
|
fun sourcesTabCategoriesFilter() = flowPrefs.getBoolean(Keys.sources_tab_categories_filter, false)
|
||||||
|
|
||||||
fun sourcesTabSourcesInCategories() = flowPrefs.getStringSet(Keys.sources_tab_source_categories, mutableSetOf())
|
fun sourcesTabSourcesInCategories() = flowPrefs.getStringSet(Keys.sources_tab_source_categories, mutableSetOf())
|
||||||
|
|
||||||
fun sourceSorting() = flowPrefs.getInt(Keys.sourcesSort, 0)
|
fun sourceSorting() = flowPrefs.getInt(Keys.sourcesSort, 0)
|
||||||
|
@ -73,7 +73,7 @@ class SourcePresenter(
|
|||||||
val sourcesAndCategoriesCombined = preferences.sourcesTabSourcesInCategories().get()
|
val sourcesAndCategoriesCombined = preferences.sourcesTabSourcesInCategories().get()
|
||||||
val sourcesAndCategories = if (sourcesAndCategoriesCombined.isNotEmpty()) sourcesAndCategoriesCombined.map {
|
val sourcesAndCategories = if (sourcesAndCategoriesCombined.isNotEmpty()) sourcesAndCategoriesCombined.map {
|
||||||
val temp = it.split("|")
|
val temp = it.split("|")
|
||||||
Pair(temp[0], temp[1])
|
temp[0] to temp[1]
|
||||||
} else null
|
} else null
|
||||||
|
|
||||||
val sourcesInCategories = sourcesAndCategories?.map { it.first }
|
val sourcesInCategories = sourcesAndCategories?.map { it.first }
|
||||||
@ -126,6 +126,10 @@ class SourcePresenter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (preferences.sourcesTabCategoriesFilter().get()) {
|
||||||
|
sourcesInCategories?.let { sourcesIds -> sourceItems = sourceItems.filterNot { it.source.id.toString() in sourcesIds } }
|
||||||
|
}
|
||||||
|
|
||||||
// SY -->
|
// SY -->
|
||||||
categories.forEach {
|
categories.forEach {
|
||||||
sourceItems = it.sources.sortedBy { sourceItem -> sourceItem.source.name.toLowerCase() } + sourceItems
|
sourceItems = it.sources.sortedBy { sourceItem -> sourceItem.source.name.toLowerCase() } + sourceItems
|
||||||
|
@ -35,6 +35,12 @@ class SettingsBrowseController : SettingsController() {
|
|||||||
router.pushController(SourceCategoryController().withFadeTransaction())
|
router.pushController(SourceCategoryController().withFadeTransaction())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
switchPreference {
|
||||||
|
key = Keys.sources_tab_categories_filter
|
||||||
|
titleRes = R.string.pref_source_source_filtering
|
||||||
|
summaryRes = R.string.pref_source_source_filtering_summery
|
||||||
|
defaultValue = false
|
||||||
|
}
|
||||||
switchPreference {
|
switchPreference {
|
||||||
key = Keys.useNewSourceNavigation
|
key = Keys.useNewSourceNavigation
|
||||||
titleRes = R.string.pref_source_navigation
|
titleRes = R.string.pref_source_navigation
|
||||||
|
@ -179,6 +179,8 @@
|
|||||||
<string name="pref_latest_tab_language_code">Display language code next to name</string>
|
<string name="pref_latest_tab_language_code">Display language code next to name</string>
|
||||||
<string name="pref_latest_position">Latest tab position</string>
|
<string name="pref_latest_position">Latest tab position</string>
|
||||||
<string name="pref_latest_position_summery">Do you want the latest tab to be the first tab in browse? This will make it the default tab when opening browse, not recommended if your on data or a metered network</string>
|
<string name="pref_latest_position_summery">Do you want the latest tab to be the first tab in browse? This will make it the default tab when opening browse, not recommended if your on data or a metered network</string>
|
||||||
|
<string name="pref_source_source_filtering">Filter sources in categories</string>
|
||||||
|
<string name="pref_source_source_filtering_summery">Filter the sources that are in categories, making the sources not get put under the language if they are in a category</string>
|
||||||
<string name="pref_source_navigation">Replace latest button</string>
|
<string name="pref_source_navigation">Replace latest button</string>
|
||||||
<string name="pref_source_navigation_summery">Replace latest button with a custom browse view that includes both latest and browse</string>
|
<string name="pref_source_navigation_summery">Replace latest button with a custom browse view that includes both latest and browse</string>
|
||||||
<string name="pref_local_source_hidden_folders">Local source hidden folders</string>
|
<string name="pref_local_source_hidden_folders">Local source hidden folders</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user