@momo-kits/native-kits 0.153.1-beta.3 → 0.153.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package vn.momo.kits.navigation
|
|
2
|
+
|
|
3
|
+
import kotlinx.coroutines.flow.MutableStateFlow
|
|
4
|
+
import kotlinx.coroutines.flow.asStateFlow
|
|
5
|
+
|
|
6
|
+
// Support swipe back on iOS
|
|
7
|
+
object ComposeNavigatorManager {
|
|
8
|
+
private val _managers = MutableStateFlow<List<Navigator>>(emptyList())
|
|
9
|
+
val managers = _managers.asStateFlow()
|
|
10
|
+
|
|
11
|
+
fun push(manager: Navigator) {
|
|
12
|
+
_managers.value = _managers.value + manager
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
fun removeLast() {
|
|
16
|
+
_managers.value = _managers.value.dropLast(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
fun checkCanPop(): Boolean = _managers.value.isNotEmpty()
|
|
20
|
+
|
|
21
|
+
fun pop() {
|
|
22
|
+
top()?.pop()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private fun top(): Navigator? = _managers.value.lastOrNull()
|
|
26
|
+
}
|
package/local.properties
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Thu Jan 09 10:43:10 ICT 2025
|
|
8
|
+
sdk.dir=/Users/sophia/Library/Android/sdk
|