Skip to content

Commit

Permalink
feat(film): migrate to compose: home (#914)
Browse files Browse the repository at this point in the history
* feat: add film module with home viewmodel

* refactor: copy dummy items to core module

* feat: initial home screen layout

* feat(home): add loading indicator

* feat(home): animate home items and make items in view non nullable

* feat(home): add item cards

* feat(home): add placeholder for item poster and add spacer between title and items

* feat(home): add back icon on expanded search bar

* feat(home): replace loading indicator with user icon and add clear button in expanded view

* feat(home): adjust title and subtitle style of item card

* refactor: remove old home code

* feat(home): add error card

* feat(error_card): add icon button to show stacktrace and replace retry text button with icon

* fix(home): add safe drawing padding to search bar and error card

* feat: add error dialog

* refactor(tv): align home screen with phone version

* refactor(tv): use dummy items from core

* lint: run ktlintFormat

* refactor: move strings to film module
  • Loading branch information
jarnedemeulemeester authored Dec 25, 2024
1 parent ba23bdc commit f730c08
Show file tree
Hide file tree
Showing 106 changed files with 1,481 additions and 911 deletions.
1 change: 1 addition & 0 deletions app/phone/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ dependencies {
implementation(projects.player.core)
implementation(projects.player.video)
implementation(projects.setup)
implementation(projects.modes.film)
implementation(libs.aboutlibraries.core)
implementation(libs.aboutlibraries)
implementation(libs.androidx.activity)
Expand Down
26 changes: 24 additions & 2 deletions app/phone/src/main/java/dev/jdtech/jellyfin/NavigationRoot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import androidx.navigation.NavOptionsBuilder
import androidx.navigation.Navigator
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import dev.jdtech.jellyfin.presentation.film.HomeScreen
import dev.jdtech.jellyfin.presentation.setup.addserver.AddServerScreen
import dev.jdtech.jellyfin.presentation.setup.login.LoginScreen
import dev.jdtech.jellyfin.presentation.setup.servers.ServersScreen
Expand All @@ -33,6 +35,12 @@ data object UsersRoute
@Serializable
data object LoginRoute

@Serializable
data object FilmGraphRoute

@Serializable
data object HomeRoute

@Composable
fun NavigationRoot(
navController: NavHostController,
Expand All @@ -41,7 +49,7 @@ fun NavigationRoot(
hasCurrentUser: Boolean,
) {
val startDestination = when {
hasServers && hasCurrentServer && hasCurrentUser -> UsersRoute // TODO: change to MainRoute
hasServers && hasCurrentServer && hasCurrentUser -> FilmGraphRoute
hasServers && hasCurrentServer -> UsersRoute
hasServers -> ServersRoute
else -> WelcomeRoute
Expand Down Expand Up @@ -112,7 +120,14 @@ fun NavigationRoot(
}
composable<LoginRoute> {
LoginScreen(
onSuccess = {},
onSuccess = {
navController.safeNavigate(FilmGraphRoute) {
popUpTo(FilmGraphRoute) {
inclusive = false
}
launchSingleTop = true
}
},
onChangeServerClick = {
navController.safeNavigate(ServersRoute) {
popUpTo(ServersRoute) {
Expand All @@ -126,6 +141,13 @@ fun NavigationRoot(
},
)
}
navigation<FilmGraphRoute>(
startDestination = HomeRoute,
) {
composable<HomeRoute> {
HomeScreen()
}
}
}
}

Expand Down

This file was deleted.

Loading

0 comments on commit f730c08

Please sign in to comment.