Initial commit of HermesControl Android app
This commit is contained in:
commit
d6ff3de594
92 files changed
+10004
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package com.m57.hermescontrol
|
||||
|
||||
import androidx.navigation3.runtime.NavBackStack
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
|
||||
object NavigationController {
|
||||
var backStack: NavBackStack<NavKey>? = null
|
||||
|
||||
fun navigateTo(key: NavKey) {
|
||||
val stack = backStack ?: return
|
||||
if (stack.lastOrNull() == key) return
|
||||
|
||||
if (key == ChatScreen || key == SkillsScreen || key == CronJobsScreen) {
|
||||
stack.clear()
|
||||
}
|
||||
stack.add(key)
|
||||
}
|
||||
|
||||
fun add(key: NavKey) {
|
||||
backStack?.add(key)
|
||||
}
|
||||
|
||||
fun goBack() {
|
||||
backStack?.removeLastOrNull()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user