mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 08:01:20 +02:00
Fix backdrop not clearing between tabs (#500)
## Description Follow up to #476 to clear the backdrop when switching tabs ### Related issues Fixes #499
This commit is contained in:
parent
8b40e89b8a
commit
644bf51aff
7 changed files with 8 additions and 9 deletions
|
|
@ -31,6 +31,7 @@ import com.github.damontecres.wholphin.data.ServerRepository
|
||||||
import com.github.damontecres.wholphin.data.model.BaseItem
|
import com.github.damontecres.wholphin.data.model.BaseItem
|
||||||
import com.github.damontecres.wholphin.data.model.GetItemsFilter
|
import com.github.damontecres.wholphin.data.model.GetItemsFilter
|
||||||
import com.github.damontecres.wholphin.preferences.UserPreferences
|
import com.github.damontecres.wholphin.preferences.UserPreferences
|
||||||
|
import com.github.damontecres.wholphin.services.BackdropService
|
||||||
import com.github.damontecres.wholphin.services.NavigationManager
|
import com.github.damontecres.wholphin.services.NavigationManager
|
||||||
import com.github.damontecres.wholphin.ui.components.CollectionFolderGrid
|
import com.github.damontecres.wholphin.ui.components.CollectionFolderGrid
|
||||||
import com.github.damontecres.wholphin.ui.components.ErrorMessage
|
import com.github.damontecres.wholphin.ui.components.ErrorMessage
|
||||||
|
|
@ -59,6 +60,7 @@ class LiveTvCollectionViewModel
|
||||||
val serverRepository: ServerRepository,
|
val serverRepository: ServerRepository,
|
||||||
val navigationManager: NavigationManager,
|
val navigationManager: NavigationManager,
|
||||||
val rememberTabManager: RememberTabManager,
|
val rememberTabManager: RememberTabManager,
|
||||||
|
val backdropService: BackdropService,
|
||||||
) : ViewModel(),
|
) : ViewModel(),
|
||||||
RememberTabManager by rememberTabManager {
|
RememberTabManager by rememberTabManager {
|
||||||
val recordingFolders = MutableLiveData<List<TabId>>()
|
val recordingFolders = MutableLiveData<List<TabId>>()
|
||||||
|
|
@ -106,6 +108,7 @@ fun CollectionFolderLiveTv(
|
||||||
LaunchedEffect(selectedTabIndex) {
|
LaunchedEffect(selectedTabIndex) {
|
||||||
logTab("livetv", selectedTabIndex)
|
logTab("livetv", selectedTabIndex)
|
||||||
viewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
viewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
||||||
|
viewModel.backdropService.clearBackdrop()
|
||||||
}
|
}
|
||||||
val onClickItem = { position: Int, item: BaseItem ->
|
val onClickItem = { position: Int, item: BaseItem ->
|
||||||
viewModel.navigationManager.navigateTo(item.destination())
|
viewModel.navigationManager.navigateTo(item.destination())
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ fun CollectionFolderMovie(
|
||||||
LaunchedEffect(selectedTabIndex) {
|
LaunchedEffect(selectedTabIndex) {
|
||||||
logTab("movie", selectedTabIndex)
|
logTab("movie", selectedTabIndex)
|
||||||
preferencesViewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
preferencesViewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
||||||
|
preferencesViewModel.backdropService.clearBackdrop()
|
||||||
}
|
}
|
||||||
|
|
||||||
var showHeader by rememberSaveable { mutableStateOf(true) }
|
var showHeader by rememberSaveable { mutableStateOf(true) }
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ fun CollectionFolderTv(
|
||||||
LaunchedEffect(selectedTabIndex) {
|
LaunchedEffect(selectedTabIndex) {
|
||||||
logTab("tv", selectedTabIndex)
|
logTab("tv", selectedTabIndex)
|
||||||
preferencesViewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
preferencesViewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
||||||
|
preferencesViewModel.backdropService.clearBackdrop()
|
||||||
}
|
}
|
||||||
|
|
||||||
val onClickItem = { item: BaseItem ->
|
val onClickItem = { item: BaseItem ->
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ fun FavoritesPage(
|
||||||
NavDrawerItem.Favorites.id,
|
NavDrawerItem.Favorites.id,
|
||||||
selectedTabIndex,
|
selectedTabIndex,
|
||||||
)
|
)
|
||||||
|
preferencesViewModel.backdropService.clearBackdrop()
|
||||||
}
|
}
|
||||||
var showHeader by rememberSaveable { mutableStateOf(true) }
|
var showHeader by rememberSaveable { mutableStateOf(true) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ import com.github.damontecres.wholphin.util.LoadingState
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.UseSerializers
|
import kotlinx.serialization.UseSerializers
|
||||||
import org.jellyfin.sdk.model.api.BaseItemKind
|
import org.jellyfin.sdk.model.api.BaseItemKind
|
||||||
import org.jellyfin.sdk.model.api.ImageType
|
|
||||||
import org.jellyfin.sdk.model.api.MediaType
|
import org.jellyfin.sdk.model.api.MediaType
|
||||||
import org.jellyfin.sdk.model.api.PersonKind
|
import org.jellyfin.sdk.model.api.PersonKind
|
||||||
import org.jellyfin.sdk.model.extensions.ticks
|
import org.jellyfin.sdk.model.extensions.ticks
|
||||||
|
|
@ -298,13 +297,6 @@ fun SeriesOverview(
|
||||||
chosenStreams = chosenStreams,
|
chosenStreams = chosenStreams,
|
||||||
peopleInEpisode = peopleInEpisode,
|
peopleInEpisode = peopleInEpisode,
|
||||||
position = position,
|
position = position,
|
||||||
backdropImageUrl =
|
|
||||||
remember {
|
|
||||||
viewModel.imageUrl(
|
|
||||||
series.id,
|
|
||||||
ImageType.BACKDROP,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
firstItemFocusRequester = firstItemFocusRequester,
|
firstItemFocusRequester = firstItemFocusRequester,
|
||||||
episodeRowFocusRequester = episodeRowFocusRequester,
|
episodeRowFocusRequester = episodeRowFocusRequester,
|
||||||
castCrewRowFocusRequester = castCrewRowFocusRequester,
|
castCrewRowFocusRequester = castCrewRowFocusRequester,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ fun SeriesOverviewContent(
|
||||||
chosenStreams: ChosenStreams?,
|
chosenStreams: ChosenStreams?,
|
||||||
peopleInEpisode: List<Person>,
|
peopleInEpisode: List<Person>,
|
||||||
position: SeriesOverviewPosition,
|
position: SeriesOverviewPosition,
|
||||||
backdropImageUrl: String?,
|
|
||||||
firstItemFocusRequester: FocusRequester,
|
firstItemFocusRequester: FocusRequester,
|
||||||
episodeRowFocusRequester: FocusRequester,
|
episodeRowFocusRequester: FocusRequester,
|
||||||
castCrewRowFocusRequester: FocusRequester,
|
castCrewRowFocusRequester: FocusRequester,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import com.github.damontecres.wholphin.data.model.NavPinType
|
||||||
import com.github.damontecres.wholphin.preferences.AppPreferences
|
import com.github.damontecres.wholphin.preferences.AppPreferences
|
||||||
import com.github.damontecres.wholphin.preferences.resetSubtitles
|
import com.github.damontecres.wholphin.preferences.resetSubtitles
|
||||||
import com.github.damontecres.wholphin.preferences.updateSubtitlePreferences
|
import com.github.damontecres.wholphin.preferences.updateSubtitlePreferences
|
||||||
|
import com.github.damontecres.wholphin.services.BackdropService
|
||||||
import com.github.damontecres.wholphin.services.NavigationManager
|
import com.github.damontecres.wholphin.services.NavigationManager
|
||||||
import com.github.damontecres.wholphin.ui.detail.DebugViewModel.Companion.sendAppLogs
|
import com.github.damontecres.wholphin.ui.detail.DebugViewModel.Companion.sendAppLogs
|
||||||
import com.github.damontecres.wholphin.ui.launchIO
|
import com.github.damontecres.wholphin.ui.launchIO
|
||||||
|
|
@ -37,6 +38,7 @@ class PreferencesViewModel
|
||||||
private val api: ApiClient,
|
private val api: ApiClient,
|
||||||
val preferenceDataStore: DataStore<AppPreferences>,
|
val preferenceDataStore: DataStore<AppPreferences>,
|
||||||
val navigationManager: NavigationManager,
|
val navigationManager: NavigationManager,
|
||||||
|
val backdropService: BackdropService,
|
||||||
private val rememberTabManager: RememberTabManager,
|
private val rememberTabManager: RememberTabManager,
|
||||||
private val serverRepository: ServerRepository,
|
private val serverRepository: ServerRepository,
|
||||||
private val navDrawerItemRepository: NavDrawerItemRepository,
|
private val navDrawerItemRepository: NavDrawerItemRepository,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue