mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
refactor: reorganize package structure and rename TvHomeScreen to TvHomeContent for clarity
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package hu.bbara.purefin.tv.home
|
||||
package hu.bbara.purefin.tv
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
@@ -22,7 +22,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.LifecycleResumeEffect
|
||||
import hu.bbara.purefin.feature.shared.home.AppViewModel
|
||||
import hu.bbara.purefin.feature.shared.library.LibraryViewModel
|
||||
import hu.bbara.purefin.tv.home.ui.TvHomeScreen
|
||||
import hu.bbara.purefin.tv.home.TvHomeScreen
|
||||
import hu.bbara.purefin.tv.home.ui.TvHomeTabDestination
|
||||
import hu.bbara.purefin.tv.home.ui.TvHomeTabItem
|
||||
import hu.bbara.purefin.tv.home.ui.TvHomeTopBar
|
||||
@@ -0,0 +1,35 @@
|
||||
package hu.bbara.purefin.tv.home
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import hu.bbara.purefin.feature.shared.home.ContinueWatchingItem
|
||||
import hu.bbara.purefin.feature.shared.home.LibraryItem
|
||||
import hu.bbara.purefin.feature.shared.home.NextUpItem
|
||||
import hu.bbara.purefin.feature.shared.home.PosterItem
|
||||
import hu.bbara.purefin.tv.home.ui.TvHomeContent
|
||||
import org.jellyfin.sdk.model.UUID
|
||||
|
||||
@SuppressLint("RememberInComposition")
|
||||
@Composable
|
||||
fun TvHomeScreen(
|
||||
libraries: List<LibraryItem>,
|
||||
libraryContent: Map<UUID, List<PosterItem>>,
|
||||
continueWatching: List<ContinueWatchingItem>,
|
||||
nextUp: List<NextUpItem>,
|
||||
onMovieSelected: (UUID) -> Unit,
|
||||
onSeriesSelected: (UUID) -> Unit,
|
||||
onEpisodeSelected: (UUID, UUID, UUID) -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
TvHomeContent(
|
||||
libraries = libraries,
|
||||
libraryContent = libraryContent,
|
||||
continueWatching = continueWatching,
|
||||
nextUp = nextUp,
|
||||
onMovieSelected = onMovieSelected,
|
||||
onSeriesSelected = onSeriesSelected,
|
||||
onEpisodeSelected = onEpisodeSelected,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package hu.bbara.purefin.tv.home.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
@@ -23,9 +22,8 @@ import hu.bbara.purefin.feature.shared.home.NextUpItem
|
||||
import hu.bbara.purefin.feature.shared.home.PosterItem
|
||||
import org.jellyfin.sdk.model.UUID
|
||||
|
||||
@SuppressLint("RememberInComposition")
|
||||
@Composable
|
||||
fun TvHomeScreen(
|
||||
fun TvHomeContent(
|
||||
libraries: List<LibraryItem>,
|
||||
libraryContent: Map<UUID, List<PosterItem>>,
|
||||
continueWatching: List<ContinueWatchingItem>,
|
||||
@@ -44,7 +42,6 @@ fun TvHomeScreen(
|
||||
libraryContent.keys.associateWith { FocusRequester() }
|
||||
}
|
||||
|
||||
|
||||
LazyColumn(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
@@ -59,7 +56,7 @@ fun TvHomeScreen(
|
||||
onMovieSelected = onMovieSelected,
|
||||
onEpisodeSelected = onEpisodeSelected,
|
||||
modifier = Modifier.focusRequester(continueWatchingRef)
|
||||
.focusProperties{
|
||||
.focusProperties {
|
||||
down = nextUpRef
|
||||
}
|
||||
)
|
||||
@@ -72,7 +69,7 @@ fun TvHomeScreen(
|
||||
items = nextUp,
|
||||
onEpisodeSelected = onEpisodeSelected,
|
||||
modifier = Modifier.focusRequester(nextUpRef)
|
||||
.focusProperties{
|
||||
.focusProperties {
|
||||
up = continueWatchingRef
|
||||
libraryRefs.values.firstOrNull()?.let { down = it }
|
||||
}
|
||||
@@ -96,10 +93,11 @@ fun TvHomeScreen(
|
||||
modifier = if (ref != null) Modifier.focusRequester(ref) else Modifier
|
||||
.focusProperties {
|
||||
up = nextUpRef
|
||||
libraryRefs.values.dropWhile { it != ref }.drop(1).firstOrNull()?.let { down = it }
|
||||
libraryRefs.values.dropWhile { it != ref }.drop(1).firstOrNull()
|
||||
?.let { down = it }
|
||||
}
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import hu.bbara.purefin.app.content.series.SeriesScreen
|
||||
import hu.bbara.purefin.core.data.navigation.LocalNavigationManager
|
||||
import hu.bbara.purefin.core.data.navigation.Route
|
||||
import hu.bbara.purefin.login.ui.LoginScreen
|
||||
import hu.bbara.purefin.tv.home.TvAppScreen
|
||||
import hu.bbara.purefin.tv.TvAppScreen
|
||||
import hu.bbara.purefin.tv.library.ui.TvLibraryScreen
|
||||
import hu.bbara.purefin.tv.player.TvPlayerScreen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user