diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4514b39e..c8e4a576 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") + id("kotlin-parcelize") } repositories { @@ -61,4 +62,6 @@ dependencies { implementation("io.insert-koin:koin-android:3.3.2") implementation("io.insert-koin:koin-androidx-compose:3.4.1") + // Compose Navigation + implementation("dev.olshevski.navigation:reimagined:1.3.1") } \ No newline at end of file diff --git a/app/src/main/java/app/revanced/manager/compose/MainActivity.kt b/app/src/main/java/app/revanced/manager/compose/MainActivity.kt index 2e8e74d9..1f2a6543 100644 --- a/app/src/main/java/app/revanced/manager/compose/MainActivity.kt +++ b/app/src/main/java/app/revanced/manager/compose/MainActivity.kt @@ -3,14 +3,34 @@ package app.revanced.manager.compose import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.compose.animation.ExperimentalAnimationApi +import app.revanced.manager.compose.destination.Destination import app.revanced.manager.compose.ui.theme.ReVancedManagerTheme +import dev.olshevski.navigation.reimagined.AnimatedNavHost +import dev.olshevski.navigation.reimagined.NavBackHandler +import dev.olshevski.navigation.reimagined.rememberNavController class MainActivity : ComponentActivity() { + + @ExperimentalAnimationApi override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { - ReVancedManagerTheme { - // TBA + ReVancedManagerTheme( + darkTheme = true, // TODO: Implement preferences + dynamicColor = false + ) { + val navController = rememberNavController(startDestination = Destination.Home) + + NavBackHandler(navController) + + AnimatedNavHost( + controller = navController, + ) { destination -> + when (destination) { + Destination.Home -> {} // TODO: Add screens + } + } } } } diff --git a/app/src/main/java/app/revanced/manager/compose/destination/AppDestination.kt b/app/src/main/java/app/revanced/manager/compose/destination/AppDestination.kt new file mode 100644 index 00000000..192e92e3 --- /dev/null +++ b/app/src/main/java/app/revanced/manager/compose/destination/AppDestination.kt @@ -0,0 +1,11 @@ +package app.revanced.manager.compose.destination + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +sealed interface Destination: Parcelable { + + @Parcelize + object Home: Destination + +} // TODO: Add screens \ No newline at end of file