mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: implement navigation
This commit is contained in:
parent
57e2632f38
commit
9536cdcae1
@ -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")
|
||||
}
|
@ -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<Destination>(startDestination = Destination.Home)
|
||||
|
||||
NavBackHandler(navController)
|
||||
|
||||
AnimatedNavHost(
|
||||
controller = navController,
|
||||
) { destination ->
|
||||
when (destination) {
|
||||
Destination.Home -> {} // TODO: Add screens
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user