mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-18 08:43:56 +00:00
feat: implement navigation
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user