Increase amount of home sections from 7 to 10
Some checks failed
App / Build / Build (push) Failing after 0s
App / Lint / Lint (push) Failing after 0s
App / Test / Test (push) Failing after 0s
Gradle / Validate wrapper / Validate (push) Failing after 0s
Repo / Label merge conflict / Triage (push) Failing after 0s

This commit is contained in:
Niels van Velzen 2024-09-21 15:19:14 +02:00 committed by Niels van Velzen
parent fe66a61ce0
commit 7b61de171d
3 changed files with 20 additions and 12 deletions

View File

@ -24,10 +24,26 @@ class UserSettingPreferences(
val homesection4 = enumPreference("homesection4", HomeSectionType.LIVE_TV)
val homesection5 = enumPreference("homesection5", HomeSectionType.NEXT_UP)
val homesection6 = enumPreference("homesection6", HomeSectionType.LATEST_MEDIA)
val homesection7 = enumPreference("homesection7", HomeSectionType.NONE)
val homesection8 = enumPreference("homesection8", HomeSectionType.NONE)
val homesection9 = enumPreference("homesection9", HomeSectionType.NONE)
}
val homesections
get() = listOf(homesection0, homesection1, homesection2, homesection3, homesection4, homesection5, homesection6)
val homesections = listOf(
homesection0,
homesection1,
homesection2,
homesection3,
homesection4,
homesection5,
homesection6,
homesection7,
homesection8,
homesection9,
)
val activeHomesections
get() = homesections
.map(::get)
.filterNot { it == HomeSectionType.NONE }
}

View File

@ -94,7 +94,7 @@ class HomeRowsFragment : RowsSupportFragment(), AudioEventListener, View.OnKeyLi
}
// Start out with default sections
val homesections = userSettingPreferences.homesections
val homesections = userSettingPreferences.activeHomesections
var includeLiveTvRows = false
// Check for live TV support

View File

@ -21,15 +21,7 @@ class HomePreferencesScreen : OptionsFragment() {
category {
setTitle(R.string.home_sections)
arrayOf(
UserSettingPreferences.homesection0,
UserSettingPreferences.homesection1,
UserSettingPreferences.homesection2,
UserSettingPreferences.homesection3,
UserSettingPreferences.homesection4,
UserSettingPreferences.homesection5,
UserSettingPreferences.homesection6,
).forEachIndexed { index, section ->
userSettingPreferences.homesections.forEachIndexed { index, section ->
enum<HomeSectionType> {
title = getString(R.string.home_section_i, index + 1)
bind(userSettingPreferences, section)