mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +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.GetItemsFilter
|
||||
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.ui.components.CollectionFolderGrid
|
||||
import com.github.damontecres.wholphin.ui.components.ErrorMessage
|
||||
|
|
@ -59,6 +60,7 @@ class LiveTvCollectionViewModel
|
|||
val serverRepository: ServerRepository,
|
||||
val navigationManager: NavigationManager,
|
||||
val rememberTabManager: RememberTabManager,
|
||||
val backdropService: BackdropService,
|
||||
) : ViewModel(),
|
||||
RememberTabManager by rememberTabManager {
|
||||
val recordingFolders = MutableLiveData<List<TabId>>()
|
||||
|
|
@ -106,6 +108,7 @@ fun CollectionFolderLiveTv(
|
|||
LaunchedEffect(selectedTabIndex) {
|
||||
logTab("livetv", selectedTabIndex)
|
||||
viewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
||||
viewModel.backdropService.clearBackdrop()
|
||||
}
|
||||
val onClickItem = { position: Int, item: BaseItem ->
|
||||
viewModel.navigationManager.navigateTo(item.destination())
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ fun CollectionFolderMovie(
|
|||
LaunchedEffect(selectedTabIndex) {
|
||||
logTab("movie", selectedTabIndex)
|
||||
preferencesViewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
||||
preferencesViewModel.backdropService.clearBackdrop()
|
||||
}
|
||||
|
||||
var showHeader by rememberSaveable { mutableStateOf(true) }
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ fun CollectionFolderTv(
|
|||
LaunchedEffect(selectedTabIndex) {
|
||||
logTab("tv", selectedTabIndex)
|
||||
preferencesViewModel.saveRememberedTab(preferences, destination.itemId, selectedTabIndex)
|
||||
preferencesViewModel.backdropService.clearBackdrop()
|
||||
}
|
||||
|
||||
val onClickItem = { item: BaseItem ->
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ fun FavoritesPage(
|
|||
NavDrawerItem.Favorites.id,
|
||||
selectedTabIndex,
|
||||
)
|
||||
preferencesViewModel.backdropService.clearBackdrop()
|
||||
}
|
||||
var showHeader by rememberSaveable { mutableStateOf(true) }
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ import com.github.damontecres.wholphin.util.LoadingState
|
|||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.UseSerializers
|
||||
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.PersonKind
|
||||
import org.jellyfin.sdk.model.extensions.ticks
|
||||
|
|
@ -298,13 +297,6 @@ fun SeriesOverview(
|
|||
chosenStreams = chosenStreams,
|
||||
peopleInEpisode = peopleInEpisode,
|
||||
position = position,
|
||||
backdropImageUrl =
|
||||
remember {
|
||||
viewModel.imageUrl(
|
||||
series.id,
|
||||
ImageType.BACKDROP,
|
||||
)
|
||||
},
|
||||
firstItemFocusRequester = firstItemFocusRequester,
|
||||
episodeRowFocusRequester = episodeRowFocusRequester,
|
||||
castCrewRowFocusRequester = castCrewRowFocusRequester,
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ fun SeriesOverviewContent(
|
|||
chosenStreams: ChosenStreams?,
|
||||
peopleInEpisode: List<Person>,
|
||||
position: SeriesOverviewPosition,
|
||||
backdropImageUrl: String?,
|
||||
firstItemFocusRequester: FocusRequester,
|
||||
episodeRowFocusRequester: 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.resetSubtitles
|
||||
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.ui.detail.DebugViewModel.Companion.sendAppLogs
|
||||
import com.github.damontecres.wholphin.ui.launchIO
|
||||
|
|
@ -37,6 +38,7 @@ class PreferencesViewModel
|
|||
private val api: ApiClient,
|
||||
val preferenceDataStore: DataStore<AppPreferences>,
|
||||
val navigationManager: NavigationManager,
|
||||
val backdropService: BackdropService,
|
||||
private val rememberTabManager: RememberTabManager,
|
||||
private val serverRepository: ServerRepository,
|
||||
private val navDrawerItemRepository: NavDrawerItemRepository,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue