@momo-kits/native-kits 0.163.1-beta.1-debug → 0.163.1-beta.2-debug
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.
- package/compose/build.gradle.kts +11 -8
- package/compose/build.gradle.kts.backup +10 -7
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +2 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +11 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +6 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +4 -19
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +1 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +6 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +6 -101
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +3 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +8 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +22 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +27 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +3 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +27 -30
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +3 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +3 -18
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +84 -59
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +13 -71
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +10 -51
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +4 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +15 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +5 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +16 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +2 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +4 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +3 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +8 -47
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +4 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +2 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +1 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +1 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +50 -111
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +7 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +4 -96
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +5 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +2 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +9 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +9 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +8 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +24 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +94 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +3 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +5 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +50 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +48 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +58 -57
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +3 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +12 -32
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +6 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +11 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +2 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +9 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +3 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +3 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +1 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +2 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +3 -3
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +2 -3
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -2
- package/gradle.properties +1 -1
- package/ios/Application/ApplicationEnvironment.swift +1 -0
- package/ios/Application/Components.swift +1 -0
- package/ios/Application/FloatingButton.swift +1 -0
- package/ios/Application/FontScaleStore.swift +59 -0
- package/ios/Badge/Badge.swift +1 -0
- package/ios/Badge/BadgeRibbon.swift +2 -0
- package/ios/Button/Button.swift +1 -1
- package/ios/Checkbox/Checkbox.swift +1 -0
- package/ios/Information/Information.swift +151 -0
- package/ios/Input/Input.swift +1 -0
- package/ios/Input/InputPhoneNumber.swift +1 -0
- package/ios/Input/InputSearch.swift +3 -0
- package/ios/Input/InputTextArea.swift +1 -0
- package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +6 -0
- package/ios/Popup/PopupInput.swift +2 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
- package/ios/Typography/Text.swift +13 -7
- package/ios/Typography/Typography.swift +22 -8
- package/package.json +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
package/compose/build.gradle.kts
CHANGED
|
@@ -12,14 +12,14 @@ plugins {
|
|
|
12
12
|
kotlin("plugin.serialization")
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
val gitlabName: String
|
|
16
|
-
val gitlabRepo: String
|
|
17
|
-
val gitlabUrl: String
|
|
18
|
-
val gitlabGroup: String
|
|
15
|
+
val gitlabName: String = findProperty("name") as String? ?: ""
|
|
16
|
+
val gitlabRepo: String = findProperty("repo") as String? ?: ""
|
|
17
|
+
val gitlabUrl: String = findProperty("url") as String? ?: ""
|
|
18
|
+
val gitlabGroup: String = findProperty("group") as String? ?: ""
|
|
19
19
|
val gitlabArtifactId: String = findProperty("artifact.id") as String? ?: ""
|
|
20
|
-
val gitlabVersion: String
|
|
21
|
-
val gitlabUser: String
|
|
22
|
-
val gitlabKey: String
|
|
20
|
+
val gitlabVersion: String = findProperty("version") as String? ?: ""
|
|
21
|
+
val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
|
|
22
|
+
val gitlabKey: String = findProperty("gitlab.password") as String? ?: ""
|
|
23
23
|
|
|
24
24
|
kotlin {
|
|
25
25
|
androidTarget {
|
|
@@ -40,7 +40,7 @@ kotlin {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
cocoapods {
|
|
43
|
-
version = "0.163.1-beta.
|
|
43
|
+
version = "0.163.1-beta.2-debug"
|
|
44
44
|
summary = "IOS Shared module"
|
|
45
45
|
homepage = "https://momo.vn"
|
|
46
46
|
ios.deploymentTarget = "15.0"
|
|
@@ -58,6 +58,9 @@ kotlin {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
sourceSets {
|
|
61
|
+
all {
|
|
62
|
+
languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
|
|
63
|
+
}
|
|
61
64
|
commonMain.dependencies {
|
|
62
65
|
implementation(compose.runtime)
|
|
63
66
|
implementation(compose.material)
|
|
@@ -12,14 +12,14 @@ plugins {
|
|
|
12
12
|
kotlin("plugin.serialization")
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
val gitlabName: String
|
|
16
|
-
val gitlabRepo: String
|
|
17
|
-
val gitlabUrl: String
|
|
18
|
-
val gitlabGroup: String
|
|
15
|
+
val gitlabName: String = findProperty("name") as String? ?: ""
|
|
16
|
+
val gitlabRepo: String = findProperty("repo") as String? ?: ""
|
|
17
|
+
val gitlabUrl: String = findProperty("url") as String? ?: ""
|
|
18
|
+
val gitlabGroup: String = findProperty("group") as String? ?: ""
|
|
19
19
|
val gitlabArtifactId: String = findProperty("artifact.id") as String? ?: ""
|
|
20
|
-
val gitlabVersion: String
|
|
21
|
-
val gitlabUser: String
|
|
22
|
-
val gitlabKey: String
|
|
20
|
+
val gitlabVersion: String = findProperty("version") as String? ?: ""
|
|
21
|
+
val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
|
|
22
|
+
val gitlabKey: String = findProperty("gitlab.password") as String? ?: ""
|
|
23
23
|
|
|
24
24
|
kotlin {
|
|
25
25
|
androidTarget {
|
|
@@ -58,6 +58,9 @@ kotlin {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
sourceSets {
|
|
61
|
+
all {
|
|
62
|
+
languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
|
|
63
|
+
}
|
|
61
64
|
commonMain.dependencies {
|
|
62
65
|
implementation(compose.runtime)
|
|
63
66
|
implementation(compose.material)
|
package/compose/compose.podspec
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
package vn.momo.kits.application
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
|
-
import androidx.compose.foundation.layout
|
|
5
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
6
|
-
import androidx.compose.foundation.layout.height
|
|
7
|
-
import androidx.compose.foundation.layout.offset
|
|
8
|
-
import androidx.compose.foundation.layout.padding
|
|
9
|
-
import androidx.compose.foundation.layout.width
|
|
4
|
+
import androidx.compose.foundation.layout.*
|
|
10
5
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
11
6
|
import androidx.compose.runtime.Composable
|
|
12
7
|
import androidx.compose.ui.Modifier
|
|
@@ -19,7 +14,7 @@ import vn.momo.kits.const.Radius
|
|
|
19
14
|
import vn.momo.kits.const.Spacing
|
|
20
15
|
|
|
21
16
|
@Composable
|
|
22
|
-
fun AnimationSearchInput(
|
|
17
|
+
internal fun AnimationSearchInput(
|
|
23
18
|
animations: HeaderAnimations,
|
|
24
19
|
inputSearchProps: InputSearchProps
|
|
25
20
|
) {
|
|
@@ -28,7 +28,7 @@ data class MiniAppContext(
|
|
|
28
28
|
val providerId: String = "",
|
|
29
29
|
val permissions: List<Map<String, Any>>? = emptyList(),
|
|
30
30
|
val features: FeatureFlags? = null,
|
|
31
|
-
val
|
|
31
|
+
val fontScaleConfig: FontScaleConfig? = null,
|
|
32
32
|
) {
|
|
33
33
|
companion object {
|
|
34
34
|
|
|
@@ -60,7 +60,7 @@ data class MiniAppContext(
|
|
|
60
60
|
providerId = parent.providerId.ifBlank { child.providerId },
|
|
61
61
|
permissions = if (!parent.permissions.isNullOrEmpty()) parent.permissions else child.permissions,
|
|
62
62
|
features = mergeFeatureFlags(parent.features, child.features),
|
|
63
|
-
|
|
63
|
+
fontScaleConfig = parent.fontScaleConfig ?: child.fontScaleConfig,
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -90,15 +90,7 @@ data class ComponentInformation(
|
|
|
90
90
|
|
|
91
91
|
var IsShowBaseLineDebug = false
|
|
92
92
|
|
|
93
|
-
val
|
|
94
|
-
null
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
val AppConfig = staticCompositionLocalOf<DesignSystemConfig?> {
|
|
98
|
-
null
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
val AppLanguage = staticCompositionLocalOf<String?> {
|
|
93
|
+
val LocalContext = staticCompositionLocalOf<MiniAppContext?> {
|
|
102
94
|
null
|
|
103
95
|
}
|
|
104
96
|
|
|
@@ -106,4 +98,11 @@ val LocalComponentInformation = staticCompositionLocalOf<ComponentInformation?>
|
|
|
106
98
|
null
|
|
107
99
|
}
|
|
108
100
|
|
|
109
|
-
|
|
101
|
+
@Immutable
|
|
102
|
+
data class FontScaleConfig(
|
|
103
|
+
val useOSFontScale: Boolean = true,
|
|
104
|
+
val userScaleRate: Float? = null,
|
|
105
|
+
val osFontScale: Float? = null,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
val LocalFontScaleConfig = staticCompositionLocalOf { FontScaleConfig() }
|
|
@@ -1,37 +1,18 @@
|
|
|
1
1
|
package vn.momo.kits.application
|
|
2
2
|
|
|
3
|
-
import androidx.compose.animation
|
|
3
|
+
import androidx.compose.animation.*
|
|
4
4
|
import androidx.compose.animation.core.CubicBezierEasing
|
|
5
5
|
import androidx.compose.animation.core.animateDpAsState
|
|
6
6
|
import androidx.compose.animation.core.tween
|
|
7
|
-
import androidx.compose.animation.expandHorizontally
|
|
8
|
-
import androidx.compose.animation.fadeIn
|
|
9
|
-
import androidx.compose.animation.fadeOut
|
|
10
|
-
import androidx.compose.animation.shrinkHorizontally
|
|
11
7
|
import androidx.compose.foundation.ScrollState
|
|
12
8
|
import androidx.compose.foundation.background
|
|
13
9
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
14
|
-
import androidx.compose.foundation.layout
|
|
15
|
-
import androidx.compose.foundation.layout.Box
|
|
16
|
-
import androidx.compose.foundation.layout.Row
|
|
17
|
-
import androidx.compose.foundation.layout.Spacer
|
|
18
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
19
|
-
import androidx.compose.foundation.layout.height
|
|
20
|
-
import androidx.compose.foundation.layout.offset
|
|
21
|
-
import androidx.compose.foundation.layout.padding
|
|
22
|
-
import androidx.compose.foundation.layout.sizeIn
|
|
23
|
-
import androidx.compose.foundation.layout.width
|
|
10
|
+
import androidx.compose.foundation.layout.*
|
|
24
11
|
import androidx.compose.material3.AlertDialogDefaults.shape
|
|
25
12
|
import androidx.compose.material3.FloatingActionButton
|
|
26
13
|
import androidx.compose.material3.FloatingActionButtonDefaults
|
|
27
|
-
import androidx.compose.runtime
|
|
28
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
29
|
-
import androidx.compose.runtime.getValue
|
|
30
|
-
import androidx.compose.runtime.mutableStateOf
|
|
31
|
-
import androidx.compose.runtime.remember
|
|
32
|
-
import androidx.compose.runtime.rememberCoroutineScope
|
|
14
|
+
import androidx.compose.runtime.*
|
|
33
15
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
34
|
-
import androidx.compose.runtime.setValue
|
|
35
16
|
import androidx.compose.ui.Alignment
|
|
36
17
|
import androidx.compose.ui.Modifier
|
|
37
18
|
import androidx.compose.ui.graphics.Color
|
|
@@ -45,6 +26,7 @@ import kotlinx.coroutines.launch
|
|
|
45
26
|
import vn.momo.kits.components.Icon
|
|
46
27
|
import vn.momo.kits.components.Text
|
|
47
28
|
import vn.momo.kits.const.Typography
|
|
29
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
48
30
|
|
|
49
31
|
enum class FABSize {
|
|
50
32
|
SMALL,
|
|
@@ -69,7 +51,7 @@ data class FabProps(
|
|
|
69
51
|
|
|
70
52
|
@Deprecated("Use vn.momo.kits.navigation.FloatingButton instead", ReplaceWith("vn.momo.kits.navigation.FloatingButton"))
|
|
71
53
|
@Composable
|
|
72
|
-
fun FloatingButton(
|
|
54
|
+
internal fun FloatingButton(
|
|
73
55
|
scrollPosition: Int,
|
|
74
56
|
bottom: Dp,
|
|
75
57
|
onClick: () -> Unit,
|
|
@@ -112,7 +94,7 @@ fun FloatingButton(
|
|
|
112
94
|
scrollPositionStateFlow
|
|
113
95
|
.collectLatest { debouncedScrollPosition ->
|
|
114
96
|
isExpanded = debouncedScrollPosition > lastScrollPosition
|
|
115
|
-
delay(300)
|
|
97
|
+
delay(300.milliseconds)
|
|
116
98
|
lastScrollPosition = debouncedScrollPosition
|
|
117
99
|
|
|
118
100
|
}
|
|
@@ -4,24 +4,9 @@ import androidx.compose.animation.core.animateFloatAsState
|
|
|
4
4
|
import androidx.compose.foundation.background
|
|
5
5
|
import androidx.compose.foundation.border
|
|
6
6
|
import androidx.compose.foundation.clickable
|
|
7
|
-
import androidx.compose.foundation.layout
|
|
8
|
-
import androidx.compose.foundation.layout.Box
|
|
9
|
-
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
10
|
-
import androidx.compose.foundation.layout.Row
|
|
11
|
-
import androidx.compose.foundation.layout.Spacer
|
|
12
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
13
|
-
import androidx.compose.foundation.layout.height
|
|
14
|
-
import androidx.compose.foundation.layout.padding
|
|
15
|
-
import androidx.compose.foundation.layout.size
|
|
16
|
-
import androidx.compose.foundation.layout.width
|
|
7
|
+
import androidx.compose.foundation.layout.*
|
|
17
8
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
18
|
-
import androidx.compose.runtime
|
|
19
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
20
|
-
import androidx.compose.runtime.getValue
|
|
21
|
-
import androidx.compose.runtime.mutableStateOf
|
|
22
|
-
import androidx.compose.runtime.remember
|
|
23
|
-
import androidx.compose.runtime.setValue
|
|
24
|
-
import androidx.compose.runtime.snapshotFlow
|
|
9
|
+
import androidx.compose.runtime.*
|
|
25
10
|
import androidx.compose.ui.Alignment
|
|
26
11
|
import androidx.compose.ui.Modifier
|
|
27
12
|
import androidx.compose.ui.graphics.Color
|
|
@@ -74,7 +59,7 @@ fun getHeaderColor(animatedHeader: AnimatedHeader?, opacity: Float, tintColor: C
|
|
|
74
59
|
|
|
75
60
|
@Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
|
|
76
61
|
@Composable
|
|
77
|
-
fun Header(
|
|
62
|
+
internal fun Header(
|
|
78
63
|
headerType: HeaderType = HeaderType.DEFAULT,
|
|
79
64
|
titlePosition: TitlePosition,
|
|
80
65
|
title: String,
|
|
@@ -214,7 +199,7 @@ fun Header(
|
|
|
214
199
|
if (searchAnimationEnable) {
|
|
215
200
|
AnimationSearchInput(
|
|
216
201
|
animations = animations,
|
|
217
|
-
inputSearchProps = inputSearchProps
|
|
202
|
+
inputSearchProps = inputSearchProps
|
|
218
203
|
)
|
|
219
204
|
}
|
|
220
205
|
}
|
|
@@ -13,7 +13,7 @@ import vn.momo.kits.components.Image
|
|
|
13
13
|
|
|
14
14
|
@Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
|
|
15
15
|
@Composable
|
|
16
|
-
fun HeaderAnimated(image: String, scrollState: Int = 0) {
|
|
16
|
+
internal fun HeaderAnimated(image: String, scrollState: Int = 0) {
|
|
17
17
|
// Scale animation
|
|
18
18
|
val scale by animateFloatAsState(
|
|
19
19
|
targetValue = when {
|
|
@@ -23,15 +23,6 @@ fun HeaderAnimated(image: String, scrollState: Int = 0) {
|
|
|
23
23
|
}
|
|
24
24
|
)
|
|
25
25
|
|
|
26
|
-
// Opacity animation
|
|
27
|
-
val opacity by animateFloatAsState(
|
|
28
|
-
targetValue = when {
|
|
29
|
-
scrollState.toFloat() in 0f..150f -> 1f - (scrollState / 300f)
|
|
30
|
-
scrollState.toFloat() in 150f..300f -> 0.5f - ((scrollState - 150f) / 300f)
|
|
31
|
-
else -> 1f
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
|
|
35
26
|
// Translation Y animation
|
|
36
27
|
|
|
37
28
|
Box(modifier = Modifier.fillMaxWidth().height(200.dp)
|
|
@@ -27,7 +27,7 @@ data class AnimatedHeader(
|
|
|
27
27
|
val composable: @Composable (scrollState: Int) -> Unit = {}
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
-
fun animateColor(start: Color, stop: Color, fraction: Float): Color {
|
|
30
|
+
internal fun animateColor(start: Color, stop: Color, fraction: Float): Color {
|
|
31
31
|
return Color(
|
|
32
32
|
red = start.red + fraction * (stop.red - start.red),
|
|
33
33
|
green = start.green + fraction * (stop.green - start.green),
|
|
@@ -38,7 +38,7 @@ fun animateColor(start: Color, stop: Color, fraction: Float): Color {
|
|
|
38
38
|
|
|
39
39
|
@Deprecated("Use vn.momo.kits.navigation.component.HeaderBackground instead", ReplaceWith("vn.momo.kits.navigation.component.HeaderBackground"))
|
|
40
40
|
@Composable
|
|
41
|
-
fun HeaderBackground(
|
|
41
|
+
internal fun HeaderBackground(
|
|
42
42
|
headerType: HeaderType = HeaderType.DEFAULT,
|
|
43
43
|
scrollState: Int,
|
|
44
44
|
headerTransparent: Boolean = false,
|
|
@@ -21,7 +21,7 @@ import vn.momo.kits.utils.bottomBorder
|
|
|
21
21
|
|
|
22
22
|
@Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
|
|
23
23
|
@Composable
|
|
24
|
-
fun HeaderDefault(
|
|
24
|
+
internal fun HeaderDefault(
|
|
25
25
|
opacityAni: Float,
|
|
26
26
|
statusBarHeight: Dp,
|
|
27
27
|
backgroundColor: Color?,
|
|
@@ -21,7 +21,7 @@ import vn.momo.kits.utils.bottomBorder
|
|
|
21
21
|
|
|
22
22
|
@Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
|
|
23
23
|
@Composable
|
|
24
|
-
fun HeaderExtended(
|
|
24
|
+
internal fun HeaderExtended(
|
|
25
25
|
opacityAni: Float,
|
|
26
26
|
statusBarHeight: Dp,
|
|
27
27
|
backgroundColor: Color
|
|
@@ -3,22 +3,10 @@ package vn.momo.kits.application
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
5
|
import androidx.compose.foundation.clickable
|
|
6
|
-
import androidx.compose.foundation.layout
|
|
7
|
-
import androidx.compose.foundation.layout.Box
|
|
8
|
-
import androidx.compose.foundation.layout.Row
|
|
9
|
-
import androidx.compose.foundation.layout.height
|
|
10
|
-
import androidx.compose.foundation.layout.offset
|
|
11
|
-
import androidx.compose.foundation.layout.padding
|
|
12
|
-
import androidx.compose.foundation.layout.size
|
|
13
|
-
import androidx.compose.foundation.layout.width
|
|
6
|
+
import androidx.compose.foundation.layout.*
|
|
14
7
|
import androidx.compose.foundation.shape.CircleShape
|
|
15
8
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
16
|
-
import androidx.compose.runtime
|
|
17
|
-
import androidx.compose.runtime.Stable
|
|
18
|
-
import androidx.compose.runtime.getValue
|
|
19
|
-
import androidx.compose.runtime.mutableStateOf
|
|
20
|
-
import androidx.compose.runtime.remember
|
|
21
|
-
import androidx.compose.runtime.setValue
|
|
9
|
+
import androidx.compose.runtime.*
|
|
22
10
|
import androidx.compose.ui.Alignment
|
|
23
11
|
import androidx.compose.ui.Modifier
|
|
24
12
|
import androidx.compose.ui.draw.clip
|
|
@@ -108,7 +96,7 @@ private fun getNavigationButtonConfig(
|
|
|
108
96
|
icon = "navigation_more_icon"
|
|
109
97
|
onClickHandler = onPressMore
|
|
110
98
|
} else if (totalTools == 1 && !headerRight?.tools.isNullOrEmpty()) {
|
|
111
|
-
val singleTool = headerRight
|
|
99
|
+
val singleTool = headerRight.tools.first().items.firstOrNull()
|
|
112
100
|
if (singleTool != null) {
|
|
113
101
|
icon = singleTool.icon
|
|
114
102
|
onClickHandler = {
|
|
@@ -129,7 +117,7 @@ private fun ToolkitHeaderRight(
|
|
|
129
117
|
var isFavorite by remember { mutableStateOf(false) }
|
|
130
118
|
val isLoading by remember { mutableStateOf(false) }
|
|
131
119
|
val api = PlatformApi.current as? ComposeApi
|
|
132
|
-
val context =
|
|
120
|
+
val context = LocalContext.current
|
|
133
121
|
|
|
134
122
|
fun onPressShortcut() {
|
|
135
123
|
api?.request("onToolAction", mapOf("item" to mapOf("key" to "onFavorite"))) {
|
|
@@ -151,7 +139,7 @@ private fun ToolkitHeaderRight(
|
|
|
151
139
|
}
|
|
152
140
|
|
|
153
141
|
fun onPressClose() {
|
|
154
|
-
api?.request("dismissAll", ""
|
|
142
|
+
api?.request("dismissAll", "")
|
|
155
143
|
}
|
|
156
144
|
|
|
157
145
|
fun onPressMore() {
|
|
@@ -274,6 +262,7 @@ fun NavigationButton(
|
|
|
274
262
|
modifier = Modifier
|
|
275
263
|
.size(28.dp)
|
|
276
264
|
.clickable(enabled = !disabled, onClick = onClick)
|
|
265
|
+
|
|
277
266
|
) {
|
|
278
267
|
Box(
|
|
279
268
|
modifier = Modifier
|
|
@@ -12,7 +12,7 @@ import vn.momo.kits.const.Typography
|
|
|
12
12
|
|
|
13
13
|
@Deprecated("Use vn.momo.kits.navigation.component instead", ReplaceWith("vn.momo.kits.navigation.component"))
|
|
14
14
|
@Composable
|
|
15
|
-
fun HeaderTitle(
|
|
15
|
+
internal fun HeaderTitle(
|
|
16
16
|
title: String = "",
|
|
17
17
|
modifier: Modifier = Modifier,
|
|
18
18
|
textAlign: TextAlign = TextAlign.Start,
|
|
@@ -2,43 +2,16 @@ package vn.momo.kits.application
|
|
|
2
2
|
|
|
3
3
|
import androidx.annotation.FloatRange
|
|
4
4
|
import androidx.compose.animation.animateContentSize
|
|
5
|
-
import androidx.compose.foundation
|
|
6
|
-
import androidx.compose.foundation.background
|
|
7
|
-
import androidx.compose.foundation.border
|
|
5
|
+
import androidx.compose.foundation.*
|
|
8
6
|
import androidx.compose.foundation.gestures.detectTapGestures
|
|
9
7
|
import androidx.compose.foundation.interaction.FocusInteraction
|
|
10
8
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
11
|
-
import androidx.compose.foundation.layout
|
|
12
|
-
import androidx.compose.foundation.layout.Box
|
|
13
|
-
import androidx.compose.foundation.layout.Row
|
|
14
|
-
import androidx.compose.foundation.layout.WindowInsets
|
|
15
|
-
import androidx.compose.foundation.layout.asPaddingValues
|
|
16
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
17
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
18
|
-
import androidx.compose.foundation.layout.ime
|
|
19
|
-
import androidx.compose.foundation.layout.navigationBars
|
|
20
|
-
import androidx.compose.foundation.layout.offset
|
|
21
|
-
import androidx.compose.foundation.layout.padding
|
|
22
|
-
import androidx.compose.foundation.layout.size
|
|
23
|
-
import androidx.compose.foundation.rememberScrollState
|
|
9
|
+
import androidx.compose.foundation.layout.*
|
|
24
10
|
import androidx.compose.foundation.shape.CircleShape
|
|
25
11
|
import androidx.compose.foundation.text.BasicTextField
|
|
26
12
|
import androidx.compose.foundation.text.KeyboardActions
|
|
27
13
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
28
|
-
import androidx.compose.
|
|
29
|
-
import androidx.compose.runtime.Composable
|
|
30
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
31
|
-
import androidx.compose.runtime.MutableState
|
|
32
|
-
import androidx.compose.runtime.Stable
|
|
33
|
-
import androidx.compose.runtime.State
|
|
34
|
-
import androidx.compose.runtime.derivedStateOf
|
|
35
|
-
import androidx.compose.runtime.getValue
|
|
36
|
-
import androidx.compose.runtime.mutableStateOf
|
|
37
|
-
import androidx.compose.runtime.produceState
|
|
38
|
-
import androidx.compose.runtime.remember
|
|
39
|
-
import androidx.compose.runtime.rememberUpdatedState
|
|
40
|
-
import androidx.compose.runtime.snapshotFlow
|
|
41
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
14
|
+
import androidx.compose.runtime.*
|
|
42
15
|
import androidx.compose.ui.Alignment
|
|
43
16
|
import androidx.compose.ui.Modifier
|
|
44
17
|
import androidx.compose.ui.composed
|
|
@@ -52,25 +25,13 @@ import androidx.compose.ui.graphics.Color
|
|
|
52
25
|
import androidx.compose.ui.graphics.SolidColor
|
|
53
26
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
54
27
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
55
|
-
import androidx.compose.ui.layout
|
|
56
|
-
import androidx.compose.ui.layout.Measurable
|
|
57
|
-
import androidx.compose.ui.layout.MeasurePolicy
|
|
58
|
-
import androidx.compose.ui.layout.MeasureResult
|
|
59
|
-
import androidx.compose.ui.layout.MeasureScope
|
|
60
|
-
import androidx.compose.ui.layout.Placeable
|
|
61
|
-
import androidx.compose.ui.layout.layoutId
|
|
28
|
+
import androidx.compose.ui.layout.*
|
|
62
29
|
import androidx.compose.ui.platform.LocalDensity
|
|
63
30
|
import androidx.compose.ui.platform.LocalFocusManager
|
|
64
31
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
65
32
|
import androidx.compose.ui.text.TextStyle
|
|
66
33
|
import androidx.compose.ui.text.style.TextOverflow
|
|
67
|
-
import androidx.compose.ui.unit
|
|
68
|
-
import androidx.compose.ui.unit.Dp
|
|
69
|
-
import androidx.compose.ui.unit.IntOffset
|
|
70
|
-
import androidx.compose.ui.unit.LayoutDirection
|
|
71
|
-
import androidx.compose.ui.unit.dp
|
|
72
|
-
import androidx.compose.ui.unit.lerp
|
|
73
|
-
import androidx.compose.ui.unit.sp
|
|
34
|
+
import androidx.compose.ui.unit.*
|
|
74
35
|
import kotlinx.coroutines.flow.collectLatest
|
|
75
36
|
import kotlinx.coroutines.flow.mapNotNull
|
|
76
37
|
import vn.momo.kits.components.Icon
|
|
@@ -82,7 +43,6 @@ import vn.momo.kits.const.Typography
|
|
|
82
43
|
import vn.momo.kits.modifier.kitsAutomationId
|
|
83
44
|
import vn.momo.kits.modifier.noFeedbackClickable
|
|
84
45
|
import vn.momo.kits.modifier.setAutomationId
|
|
85
|
-
import vn.momo.kits.modifier.shadow
|
|
86
46
|
import vn.momo.kits.navigation.component.HEADER_HEIGHT
|
|
87
47
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
88
48
|
import kotlin.math.max
|
|
@@ -123,7 +83,7 @@ fun LiteScreen(
|
|
|
123
83
|
title: String? = null,
|
|
124
84
|
inputSearchProps: LiteInputSearchProps? = null,
|
|
125
85
|
goBack: (() -> Unit)? = null,
|
|
126
|
-
headerRight: @Composable
|
|
86
|
+
headerRight: @Composable (() -> Unit)? = null,
|
|
127
87
|
useAnimationSearch: Boolean = true,
|
|
128
88
|
titlePosition: TitlePosition = TitlePosition.LEFT,
|
|
129
89
|
headerRightData: HeaderRightData? = null,
|
|
@@ -853,61 +813,6 @@ private fun LiteInputSearch(
|
|
|
853
813
|
}
|
|
854
814
|
}
|
|
855
815
|
|
|
856
|
-
@Composable
|
|
857
|
-
private fun footerOffset(
|
|
858
|
-
useAvoidKeyboard: Boolean = true,
|
|
859
|
-
): State<IntOffset> {
|
|
860
|
-
if (!useAvoidKeyboard) return remember { mutableStateOf(IntOffset.Zero) }
|
|
861
|
-
val density = LocalDensity.current
|
|
862
|
-
val navPaddingValue = WindowInsets.navigationBars.asPaddingValues()
|
|
863
|
-
val keyboardSize = keyboardSizeState()
|
|
864
|
-
|
|
865
|
-
return produceState(IntOffset.Zero, density, navPaddingValue) {
|
|
866
|
-
val navSystemOffset = with(density) { navPaddingValue.calculateBottomPadding().roundToPx() }
|
|
867
|
-
snapshotFlow { keyboardSize.value }.collectLatest {
|
|
868
|
-
value = if (it == 0.dp) IntOffset.Zero
|
|
869
|
-
else IntOffset(
|
|
870
|
-
x = 0, y = with(density) {
|
|
871
|
-
navSystemOffset - it.roundToPx()
|
|
872
|
-
})
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
@Composable
|
|
878
|
-
fun keyboardSizeState(): State<Dp> {
|
|
879
|
-
val bottom = WindowInsets.ime.asPaddingValues()
|
|
880
|
-
return rememberUpdatedState(bottom.calculateBottomPadding())
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
@Composable
|
|
884
|
-
private fun Footer(
|
|
885
|
-
useAvoidKeyboard: Boolean,
|
|
886
|
-
footerContent: (@Composable () -> Unit)?,
|
|
887
|
-
) {
|
|
888
|
-
footerContent ?: return
|
|
889
|
-
val theme = AppTheme.current
|
|
890
|
-
val navPaddingValue = WindowInsets.navigationBars.asPaddingValues()
|
|
891
|
-
val offsetMove = footerOffset(useAvoidKeyboard)
|
|
892
|
-
|
|
893
|
-
Box(
|
|
894
|
-
modifier = Modifier.padding(navPaddingValue).fillMaxWidth().offset {
|
|
895
|
-
offsetMove.value
|
|
896
|
-
}.shadow(
|
|
897
|
-
color = Colors.black_20.copy(alpha = 0.05f),
|
|
898
|
-
blurRadius = 24f,
|
|
899
|
-
offsetX = 0.dp,
|
|
900
|
-
offsetY = (-4).dp
|
|
901
|
-
).background(theme.colors.background.surface).padding(
|
|
902
|
-
start = Spacing.M,
|
|
903
|
-
top = Spacing.M,
|
|
904
|
-
end = Spacing.M,
|
|
905
|
-
)
|
|
906
|
-
) {
|
|
907
|
-
footerContent()
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
|
|
911
816
|
fun Modifier.hideKeyboardOnTap() = composed {
|
|
912
817
|
val focusManager = LocalFocusManager.current
|
|
913
818
|
val keyboardManager = LocalSoftwareKeyboardController.current
|
|
@@ -2,21 +2,10 @@ package vn.momo.kits.application
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.layout.Box
|
|
4
4
|
import androidx.compose.foundation.layout.wrapContentSize
|
|
5
|
-
import androidx.compose.runtime
|
|
6
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
7
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
8
|
-
import androidx.compose.runtime.getValue
|
|
9
|
-
import androidx.compose.runtime.mutableStateOf
|
|
10
|
-
import androidx.compose.runtime.remember
|
|
11
|
-
import androidx.compose.runtime.setValue
|
|
12
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
5
|
+
import androidx.compose.runtime.*
|
|
13
6
|
import androidx.compose.ui.Modifier
|
|
14
7
|
import androidx.compose.ui.unit.Dp
|
|
15
|
-
import vn.momo.kits.const
|
|
16
|
-
import vn.momo.kits.const.AppTheme
|
|
17
|
-
import vn.momo.kits.const.Theme
|
|
18
|
-
import vn.momo.kits.const.ThemeAssets
|
|
19
|
-
import vn.momo.kits.const.defaultTheme
|
|
8
|
+
import vn.momo.kits.const.*
|
|
20
9
|
import vn.momo.kits.modifier.DeprecatedModifier
|
|
21
10
|
import vn.momo.kits.platform.getStatusBarHeight
|
|
22
11
|
|
|
@@ -108,9 +97,7 @@ fun ApplicationContainer(
|
|
|
108
97
|
AppTheme provides appTheme,
|
|
109
98
|
PlatformApi provides composeApi,
|
|
110
99
|
AppStatusBar provides appStatusBarHeight,
|
|
111
|
-
|
|
112
|
-
AppConfig provides config,
|
|
113
|
-
AppLanguage provides language,
|
|
100
|
+
LocalContext provides applicationContext,
|
|
114
101
|
) {
|
|
115
102
|
Box(Modifier.wrapContentSize().then(DeprecatedModifier())) {
|
|
116
103
|
content()
|
|
@@ -6,32 +6,10 @@ import androidx.compose.animation.core.tween
|
|
|
6
6
|
import androidx.compose.foundation.ScrollState
|
|
7
7
|
import androidx.compose.foundation.background
|
|
8
8
|
import androidx.compose.foundation.gestures.detectTapGestures
|
|
9
|
-
import androidx.compose.foundation.layout
|
|
10
|
-
import androidx.compose.foundation.layout.Box
|
|
11
|
-
import androidx.compose.foundation.layout.Column
|
|
12
|
-
import androidx.compose.foundation.layout.Spacer
|
|
13
|
-
import androidx.compose.foundation.layout.WindowInsets
|
|
14
|
-
import androidx.compose.foundation.layout.asPaddingValues
|
|
15
|
-
import androidx.compose.foundation.layout.aspectRatio
|
|
16
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
17
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
18
|
-
import androidx.compose.foundation.layout.height
|
|
19
|
-
import androidx.compose.foundation.layout.ime
|
|
20
|
-
import androidx.compose.foundation.layout.imePadding
|
|
21
|
-
import androidx.compose.foundation.layout.navigationBars
|
|
22
|
-
import androidx.compose.foundation.layout.offset
|
|
23
|
-
import androidx.compose.foundation.layout.padding
|
|
9
|
+
import androidx.compose.foundation.layout.*
|
|
24
10
|
import androidx.compose.foundation.rememberScrollState
|
|
25
11
|
import androidx.compose.foundation.verticalScroll
|
|
26
|
-
import androidx.compose.runtime
|
|
27
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
28
|
-
import androidx.compose.runtime.DisposableEffect
|
|
29
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
30
|
-
import androidx.compose.runtime.getValue
|
|
31
|
-
import androidx.compose.runtime.mutableStateOf
|
|
32
|
-
import androidx.compose.runtime.remember
|
|
33
|
-
import androidx.compose.runtime.setValue
|
|
34
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
12
|
+
import androidx.compose.runtime.*
|
|
35
13
|
import androidx.compose.ui.Alignment
|
|
36
14
|
import androidx.compose.ui.Modifier
|
|
37
15
|
import androidx.compose.ui.graphics.Color
|
|
@@ -44,24 +22,20 @@ import androidx.compose.ui.unit.Dp
|
|
|
44
22
|
import androidx.compose.ui.unit.IntOffset
|
|
45
23
|
import androidx.compose.ui.unit.dp
|
|
46
24
|
import androidx.compose.ui.zIndex
|
|
47
|
-
import kotlinx.coroutines
|
|
48
|
-
import kotlinx.coroutines.Dispatchers
|
|
49
|
-
import kotlinx.coroutines.SupervisorJob
|
|
50
|
-
import kotlinx.coroutines.cancel
|
|
51
|
-
import kotlinx.coroutines.delay
|
|
52
|
-
import kotlinx.coroutines.launch
|
|
25
|
+
import kotlinx.coroutines.*
|
|
53
26
|
import vn.momo.kits.components.InputSearchProps
|
|
54
27
|
import vn.momo.kits.const.AppNavigationBar
|
|
55
28
|
import vn.momo.kits.const.AppTheme
|
|
56
29
|
import vn.momo.kits.const.Colors
|
|
57
30
|
import vn.momo.kits.const.Spacing
|
|
58
|
-
import vn.momo.kits.modifier.DeprecatedModifier
|
|
59
31
|
import vn.momo.kits.modifier.conditional
|
|
32
|
+
import vn.momo.kits.modifier.DeprecatedModifier
|
|
60
33
|
import vn.momo.kits.modifier.shadow
|
|
61
34
|
import vn.momo.kits.navigation.component.SnackBar
|
|
62
35
|
import vn.momo.kits.platform.supportsImePadding
|
|
63
36
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
64
37
|
import vn.momo.kits.utils.getNavigationBarHeight
|
|
38
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
65
39
|
|
|
66
40
|
enum class HeaderType {
|
|
67
41
|
DEFAULT,
|
|
@@ -281,6 +255,7 @@ fun Footer(
|
|
|
281
255
|
.onGloballyPositioned {
|
|
282
256
|
onFooterMeasured?.invoke(it.size.height)
|
|
283
257
|
}
|
|
258
|
+
|
|
284
259
|
) {
|
|
285
260
|
Box(
|
|
286
261
|
Modifier.fillMaxWidth()
|
|
@@ -333,7 +308,7 @@ val LocalScreenHelper = staticCompositionLocalOf<ScreenHelper> {
|
|
|
333
308
|
}
|
|
334
309
|
|
|
335
310
|
@Composable
|
|
336
|
-
fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
311
|
+
internal fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
337
312
|
val helper = LocalScreenHelper.current
|
|
338
313
|
val snackBarData = helper.snackBarState ?: return
|
|
339
314
|
val density = LocalDensity.current
|
|
@@ -370,7 +345,7 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
370
345
|
LaunchedEffect(snackBarData.type.duration) {
|
|
371
346
|
val duration = snackBarData.type.duration
|
|
372
347
|
if (duration != null) {
|
|
373
|
-
delay(duration)
|
|
348
|
+
delay(duration.milliseconds)
|
|
374
349
|
helper.hideSnackBar()
|
|
375
350
|
}
|
|
376
351
|
}
|