@momo-kits/native-kits 0.162.1-gif.11-debug → 0.162.1-gif.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 +10 -13
- package/compose/build.gradle.kts.backup +9 -12
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +7 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +3 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +24 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +19 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +10 -1
- 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 +16 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +101 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +14 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +33 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +25 -22
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +29 -27
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +26 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +30 -27
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +13 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +11 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +18 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +11 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +35 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +59 -84
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +71 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +51 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +1 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +21 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +75 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +26 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +11 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +36 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +9 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +28 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +13 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +10 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +28 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +47 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +25 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +11 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +17 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +111 -50
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +8 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +12 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +96 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +12 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +21 -9
- 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 +14 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +11 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +40 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +4 -94
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +15 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +7 -48
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +33 -48
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +55 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +12 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +31 -13
- 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 +24 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +6 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +1 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +3 -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 +13 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +40 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +17 -2
- 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 +3 -2
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +2 -0
- package/gradle/libs.versions.toml +2 -2
- package/gradle.properties +1 -1
- package/ios/Application/ApplicationEnvironment.swift +0 -1
- package/ios/Application/Components.swift +0 -1
- package/ios/Application/FloatingButton.swift +0 -1
- package/ios/Badge/Badge.swift +0 -1
- package/ios/Badge/BadgeRibbon.swift +0 -2
- package/ios/Button/Button.swift +1 -1
- package/ios/Checkbox/Checkbox.swift +0 -1
- package/ios/Input/Input.swift +0 -1
- package/ios/Input/InputPhoneNumber.swift +0 -1
- package/ios/Input/InputSearch.swift +0 -3
- package/ios/Input/InputTextArea.swift +0 -1
- package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +0 -6
- package/ios/Popup/PopupInput.swift +0 -2
- package/ios/Template/TrustBanner/TrustBanner.swift +0 -2
- package/ios/Typography/Text.swift +7 -13
- package/ios/Typography/Typography.swift +8 -22
- package/package.json +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/SketchGifBridge.android.kt +0 -161
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SketchGifImage.kt +0 -81
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/GifImageHttpClient.kt +0 -97
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/SketchGifBridge.kt +0 -116
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/SketchGifBridge.ios.kt +0 -23
- package/ios/Application/FontScaleStore.swift +0 -59
- package/ios/Information/Information.swift +0 -151
package/compose/build.gradle.kts
CHANGED
|
@@ -12,14 +12,14 @@ plugins {
|
|
|
12
12
|
kotlin("plugin.serialization")
|
|
13
13
|
}
|
|
14
14
|
|
|
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? ?: ""
|
|
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 = findProperty("version") as String? ?: ""
|
|
21
|
-
val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
|
|
22
|
-
val gitlabKey: String = findProperty("gitlab.password") as 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.162.1-gif.
|
|
43
|
+
version = "0.162.1-gif.2-debug"
|
|
44
44
|
summary = "IOS Shared module"
|
|
45
45
|
homepage = "https://momo.vn"
|
|
46
46
|
ios.deploymentTarget = "15.0"
|
|
@@ -58,9 +58,6 @@ kotlin {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
sourceSets {
|
|
61
|
-
all {
|
|
62
|
-
languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
|
|
63
|
-
}
|
|
64
61
|
commonMain.dependencies {
|
|
65
62
|
implementation(compose.runtime)
|
|
66
63
|
implementation(compose.material)
|
|
@@ -77,8 +74,8 @@ kotlin {
|
|
|
77
74
|
implementation(libs.kotlinx.datetime)
|
|
78
75
|
api(libs.native.max.api)
|
|
79
76
|
implementation(libs.compottie)
|
|
80
|
-
implementation(libs.sketch.
|
|
81
|
-
implementation(libs.sketch.http.
|
|
77
|
+
implementation(libs.sketch.compose)
|
|
78
|
+
implementation(libs.sketch.http.ktor3)
|
|
82
79
|
implementation(libs.sketch.animated.gif)
|
|
83
80
|
}
|
|
84
81
|
androidMain.dependencies {
|
|
@@ -12,14 +12,14 @@ plugins {
|
|
|
12
12
|
kotlin("plugin.serialization")
|
|
13
13
|
}
|
|
14
14
|
|
|
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? ?: ""
|
|
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 = findProperty("version") as String? ?: ""
|
|
21
|
-
val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
|
|
22
|
-
val gitlabKey: String = findProperty("gitlab.password") as 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,9 +58,6 @@ kotlin {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
sourceSets {
|
|
61
|
-
all {
|
|
62
|
-
languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
|
|
63
|
-
}
|
|
64
61
|
commonMain.dependencies {
|
|
65
62
|
implementation(compose.runtime)
|
|
66
63
|
implementation(compose.material)
|
|
@@ -77,8 +74,8 @@ kotlin {
|
|
|
77
74
|
implementation(libs.kotlinx.datetime)
|
|
78
75
|
api(libs.native.max.api)
|
|
79
76
|
implementation(libs.compottie)
|
|
80
|
-
implementation(libs.sketch.
|
|
81
|
-
implementation(libs.sketch.http.
|
|
77
|
+
implementation(libs.sketch.compose)
|
|
78
|
+
implementation(libs.sketch.http.ktor3)
|
|
82
79
|
implementation(libs.sketch.animated.gif)
|
|
83
80
|
}
|
|
84
81
|
androidMain.dependencies {
|
package/compose/compose.podspec
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
package vn.momo.kits.application
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
|
-
import androidx.compose.foundation.layout
|
|
4
|
+
import androidx.compose.foundation.layout.Box
|
|
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
|
|
5
10
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
6
11
|
import androidx.compose.runtime.Composable
|
|
7
12
|
import androidx.compose.ui.Modifier
|
|
@@ -14,7 +19,7 @@ import vn.momo.kits.const.Radius
|
|
|
14
19
|
import vn.momo.kits.const.Spacing
|
|
15
20
|
|
|
16
21
|
@Composable
|
|
17
|
-
|
|
22
|
+
fun AnimationSearchInput(
|
|
18
23
|
animations: HeaderAnimations,
|
|
19
24
|
inputSearchProps: InputSearchProps
|
|
20
25
|
) {
|
|
@@ -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 scaleSizeMaxRate: Float? = 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
|
+
scaleSizeMaxRate = parent.scaleSizeMaxRate ?: child.scaleSizeMaxRate,
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -106,11 +106,4 @@ val LocalComponentInformation = staticCompositionLocalOf<ComponentInformation?>
|
|
|
106
106
|
null
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
data class FontScaleConfig(
|
|
111
|
-
val useOSFontScale: Boolean = true,
|
|
112
|
-
val userScaleRate: Float? = null,
|
|
113
|
-
val osFontScale: Float? = null,
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
val LocalFontScaleConfig = staticCompositionLocalOf { FontScaleConfig() }
|
|
109
|
+
val ScaleSizeMaxRate = staticCompositionLocalOf<Float?> { null }
|
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
package vn.momo.kits.application
|
|
2
2
|
|
|
3
|
-
import androidx.compose.animation
|
|
3
|
+
import androidx.compose.animation.AnimatedVisibility
|
|
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
|
|
7
11
|
import androidx.compose.foundation.ScrollState
|
|
8
12
|
import androidx.compose.foundation.background
|
|
9
13
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
10
|
-
import androidx.compose.foundation.layout
|
|
14
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
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
|
|
11
24
|
import androidx.compose.material3.AlertDialogDefaults.shape
|
|
12
25
|
import androidx.compose.material3.FloatingActionButton
|
|
13
26
|
import androidx.compose.material3.FloatingActionButtonDefaults
|
|
14
|
-
import androidx.compose.runtime
|
|
27
|
+
import androidx.compose.runtime.Composable
|
|
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
|
|
15
33
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
34
|
+
import androidx.compose.runtime.setValue
|
|
16
35
|
import androidx.compose.ui.Alignment
|
|
17
36
|
import androidx.compose.ui.Modifier
|
|
18
37
|
import androidx.compose.ui.graphics.Color
|
|
@@ -26,7 +45,6 @@ import kotlinx.coroutines.launch
|
|
|
26
45
|
import vn.momo.kits.components.Icon
|
|
27
46
|
import vn.momo.kits.components.Text
|
|
28
47
|
import vn.momo.kits.const.Typography
|
|
29
|
-
import kotlin.time.Duration.Companion.milliseconds
|
|
30
48
|
|
|
31
49
|
enum class FABSize {
|
|
32
50
|
SMALL,
|
|
@@ -51,7 +69,7 @@ data class FabProps(
|
|
|
51
69
|
|
|
52
70
|
@Deprecated("Use vn.momo.kits.navigation.FloatingButton instead", ReplaceWith("vn.momo.kits.navigation.FloatingButton"))
|
|
53
71
|
@Composable
|
|
54
|
-
|
|
72
|
+
fun FloatingButton(
|
|
55
73
|
scrollPosition: Int,
|
|
56
74
|
bottom: Dp,
|
|
57
75
|
onClick: () -> Unit,
|
|
@@ -94,7 +112,7 @@ internal fun FloatingButton(
|
|
|
94
112
|
scrollPositionStateFlow
|
|
95
113
|
.collectLatest { debouncedScrollPosition ->
|
|
96
114
|
isExpanded = debouncedScrollPosition > lastScrollPosition
|
|
97
|
-
delay(300
|
|
115
|
+
delay(300)
|
|
98
116
|
lastScrollPosition = debouncedScrollPosition
|
|
99
117
|
|
|
100
118
|
}
|
|
@@ -4,9 +4,24 @@ 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
|
|
7
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
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
|
|
8
17
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
9
|
-
import androidx.compose.runtime
|
|
18
|
+
import androidx.compose.runtime.Composable
|
|
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
|
|
10
25
|
import androidx.compose.ui.Alignment
|
|
11
26
|
import androidx.compose.ui.Modifier
|
|
12
27
|
import androidx.compose.ui.graphics.Color
|
|
@@ -59,7 +74,7 @@ fun getHeaderColor(animatedHeader: AnimatedHeader?, opacity: Float, tintColor: C
|
|
|
59
74
|
|
|
60
75
|
@Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
|
|
61
76
|
@Composable
|
|
62
|
-
|
|
77
|
+
fun Header(
|
|
63
78
|
headerType: HeaderType = HeaderType.DEFAULT,
|
|
64
79
|
titlePosition: TitlePosition,
|
|
65
80
|
title: String,
|
|
@@ -199,7 +214,7 @@ internal fun Header(
|
|
|
199
214
|
if (searchAnimationEnable) {
|
|
200
215
|
AnimationSearchInput(
|
|
201
216
|
animations = animations,
|
|
202
|
-
inputSearchProps = inputSearchProps
|
|
217
|
+
inputSearchProps = inputSearchProps!!
|
|
203
218
|
)
|
|
204
219
|
}
|
|
205
220
|
}
|
|
@@ -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
|
-
|
|
16
|
+
fun HeaderAnimated(image: String, scrollState: Int = 0) {
|
|
17
17
|
// Scale animation
|
|
18
18
|
val scale by animateFloatAsState(
|
|
19
19
|
targetValue = when {
|
|
@@ -23,6 +23,15 @@ internal 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
|
+
|
|
26
35
|
// Translation Y animation
|
|
27
36
|
|
|
28
37
|
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
|
-
|
|
30
|
+
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 @@ internal 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
|
-
|
|
41
|
+
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
|
-
|
|
24
|
+
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
|
-
|
|
24
|
+
fun HeaderExtended(
|
|
25
25
|
opacityAni: Float,
|
|
26
26
|
statusBarHeight: Dp,
|
|
27
27
|
backgroundColor: Color
|
|
@@ -3,10 +3,22 @@ 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
|
|
6
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
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
|
|
7
14
|
import androidx.compose.foundation.shape.CircleShape
|
|
8
15
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
9
|
-
import androidx.compose.runtime
|
|
16
|
+
import androidx.compose.runtime.Composable
|
|
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
|
|
10
22
|
import androidx.compose.ui.Alignment
|
|
11
23
|
import androidx.compose.ui.Modifier
|
|
12
24
|
import androidx.compose.ui.draw.clip
|
|
@@ -96,7 +108,7 @@ private fun getNavigationButtonConfig(
|
|
|
96
108
|
icon = "navigation_more_icon"
|
|
97
109
|
onClickHandler = onPressMore
|
|
98
110
|
} else if (totalTools == 1 && !headerRight?.tools.isNullOrEmpty()) {
|
|
99
|
-
val singleTool = headerRight
|
|
111
|
+
val singleTool = headerRight?.tools?.first()?.items?.firstOrNull()
|
|
100
112
|
if (singleTool != null) {
|
|
101
113
|
icon = singleTool.icon
|
|
102
114
|
onClickHandler = {
|
|
@@ -139,7 +151,7 @@ private fun ToolkitHeaderRight(
|
|
|
139
151
|
}
|
|
140
152
|
|
|
141
153
|
fun onPressClose() {
|
|
142
|
-
api?.request("dismissAll", "")
|
|
154
|
+
api?.request("dismissAll", "", { _ -> })
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
fun onPressMore() {
|
|
@@ -262,7 +274,6 @@ fun NavigationButton(
|
|
|
262
274
|
modifier = Modifier
|
|
263
275
|
.size(28.dp)
|
|
264
276
|
.clickable(enabled = !disabled, onClick = onClick)
|
|
265
|
-
|
|
266
277
|
) {
|
|
267
278
|
Box(
|
|
268
279
|
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
|
-
|
|
15
|
+
fun HeaderTitle(
|
|
16
16
|
title: String = "",
|
|
17
17
|
modifier: Modifier = Modifier,
|
|
18
18
|
textAlign: TextAlign = TextAlign.Start,
|
|
@@ -2,16 +2,43 @@ 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
|
|
5
|
+
import androidx.compose.foundation.ScrollState
|
|
6
|
+
import androidx.compose.foundation.background
|
|
7
|
+
import androidx.compose.foundation.border
|
|
6
8
|
import androidx.compose.foundation.gestures.detectTapGestures
|
|
7
9
|
import androidx.compose.foundation.interaction.FocusInteraction
|
|
8
10
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
9
|
-
import androidx.compose.foundation.layout
|
|
11
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
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
|
|
10
24
|
import androidx.compose.foundation.shape.CircleShape
|
|
11
25
|
import androidx.compose.foundation.text.BasicTextField
|
|
12
26
|
import androidx.compose.foundation.text.KeyboardActions
|
|
13
27
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
14
|
-
import androidx.compose.
|
|
28
|
+
import androidx.compose.foundation.verticalScroll
|
|
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
|
|
15
42
|
import androidx.compose.ui.Alignment
|
|
16
43
|
import androidx.compose.ui.Modifier
|
|
17
44
|
import androidx.compose.ui.composed
|
|
@@ -25,13 +52,25 @@ import androidx.compose.ui.graphics.Color
|
|
|
25
52
|
import androidx.compose.ui.graphics.SolidColor
|
|
26
53
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
27
54
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
28
|
-
import androidx.compose.ui.layout
|
|
55
|
+
import androidx.compose.ui.layout.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
|
|
29
62
|
import androidx.compose.ui.platform.LocalDensity
|
|
30
63
|
import androidx.compose.ui.platform.LocalFocusManager
|
|
31
64
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
32
65
|
import androidx.compose.ui.text.TextStyle
|
|
33
66
|
import androidx.compose.ui.text.style.TextOverflow
|
|
34
|
-
import androidx.compose.ui.unit
|
|
67
|
+
import androidx.compose.ui.unit.Constraints
|
|
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
|
|
35
74
|
import kotlinx.coroutines.flow.collectLatest
|
|
36
75
|
import kotlinx.coroutines.flow.mapNotNull
|
|
37
76
|
import vn.momo.kits.components.Icon
|
|
@@ -43,6 +82,7 @@ import vn.momo.kits.const.Typography
|
|
|
43
82
|
import vn.momo.kits.modifier.kitsAutomationId
|
|
44
83
|
import vn.momo.kits.modifier.noFeedbackClickable
|
|
45
84
|
import vn.momo.kits.modifier.setAutomationId
|
|
85
|
+
import vn.momo.kits.modifier.shadow
|
|
46
86
|
import vn.momo.kits.navigation.component.HEADER_HEIGHT
|
|
47
87
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
48
88
|
import kotlin.math.max
|
|
@@ -83,7 +123,7 @@ fun LiteScreen(
|
|
|
83
123
|
title: String? = null,
|
|
84
124
|
inputSearchProps: LiteInputSearchProps? = null,
|
|
85
125
|
goBack: (() -> Unit)? = null,
|
|
86
|
-
headerRight: @Composable (() -> Unit)? = null,
|
|
126
|
+
headerRight: @Composable() (() -> Unit)? = null,
|
|
87
127
|
useAnimationSearch: Boolean = true,
|
|
88
128
|
titlePosition: TitlePosition = TitlePosition.LEFT,
|
|
89
129
|
headerRightData: HeaderRightData? = null,
|
|
@@ -813,6 +853,61 @@ private fun LiteInputSearch(
|
|
|
813
853
|
}
|
|
814
854
|
}
|
|
815
855
|
|
|
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
|
+
|
|
816
911
|
fun Modifier.hideKeyboardOnTap() = composed {
|
|
817
912
|
val focusManager = LocalFocusManager.current
|
|
818
913
|
val keyboardManager = LocalSoftwareKeyboardController.current
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
package vn.momo.kits.application
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.layout.Box
|
|
4
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
4
5
|
import androidx.compose.foundation.layout.wrapContentSize
|
|
5
|
-
import androidx.compose.runtime
|
|
6
|
+
import androidx.compose.runtime.Composable
|
|
7
|
+
import androidx.compose.runtime.CompositionLocalProvider
|
|
8
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
9
|
+
import androidx.compose.runtime.getValue
|
|
10
|
+
import androidx.compose.runtime.mutableStateOf
|
|
11
|
+
import androidx.compose.runtime.remember
|
|
12
|
+
import androidx.compose.runtime.setValue
|
|
13
|
+
import androidx.compose.runtime.staticCompositionLocalOf
|
|
6
14
|
import androidx.compose.ui.Modifier
|
|
7
15
|
import androidx.compose.ui.unit.Dp
|
|
8
|
-
import vn.momo.kits.const
|
|
16
|
+
import vn.momo.kits.const.AppStatusBar
|
|
17
|
+
import vn.momo.kits.const.AppTheme
|
|
18
|
+
import vn.momo.kits.const.Theme
|
|
19
|
+
import vn.momo.kits.const.ThemeAssets
|
|
20
|
+
import vn.momo.kits.const.defaultTheme
|
|
9
21
|
import vn.momo.kits.modifier.DeprecatedModifier
|
|
10
22
|
import vn.momo.kits.platform.getStatusBarHeight
|
|
11
23
|
|
|
@@ -6,10 +6,32 @@ 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
|
|
9
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
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
|
|
10
24
|
import androidx.compose.foundation.rememberScrollState
|
|
11
25
|
import androidx.compose.foundation.verticalScroll
|
|
12
|
-
import androidx.compose.runtime
|
|
26
|
+
import androidx.compose.runtime.Composable
|
|
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
|
|
13
35
|
import androidx.compose.ui.Alignment
|
|
14
36
|
import androidx.compose.ui.Modifier
|
|
15
37
|
import androidx.compose.ui.graphics.Color
|
|
@@ -22,20 +44,24 @@ import androidx.compose.ui.unit.Dp
|
|
|
22
44
|
import androidx.compose.ui.unit.IntOffset
|
|
23
45
|
import androidx.compose.ui.unit.dp
|
|
24
46
|
import androidx.compose.ui.zIndex
|
|
25
|
-
import kotlinx.coroutines
|
|
47
|
+
import kotlinx.coroutines.CoroutineScope
|
|
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
|
|
26
53
|
import vn.momo.kits.components.InputSearchProps
|
|
27
54
|
import vn.momo.kits.const.AppNavigationBar
|
|
28
55
|
import vn.momo.kits.const.AppTheme
|
|
29
56
|
import vn.momo.kits.const.Colors
|
|
30
57
|
import vn.momo.kits.const.Spacing
|
|
31
|
-
import vn.momo.kits.modifier.conditional
|
|
32
58
|
import vn.momo.kits.modifier.DeprecatedModifier
|
|
59
|
+
import vn.momo.kits.modifier.conditional
|
|
33
60
|
import vn.momo.kits.modifier.shadow
|
|
34
61
|
import vn.momo.kits.navigation.component.SnackBar
|
|
35
62
|
import vn.momo.kits.platform.supportsImePadding
|
|
36
63
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
37
64
|
import vn.momo.kits.utils.getNavigationBarHeight
|
|
38
|
-
import kotlin.time.Duration.Companion.milliseconds
|
|
39
65
|
|
|
40
66
|
enum class HeaderType {
|
|
41
67
|
DEFAULT,
|
|
@@ -255,7 +281,6 @@ fun Footer(
|
|
|
255
281
|
.onGloballyPositioned {
|
|
256
282
|
onFooterMeasured?.invoke(it.size.height)
|
|
257
283
|
}
|
|
258
|
-
|
|
259
284
|
) {
|
|
260
285
|
Box(
|
|
261
286
|
Modifier.fillMaxWidth()
|
|
@@ -308,7 +333,7 @@ val LocalScreenHelper = staticCompositionLocalOf<ScreenHelper> {
|
|
|
308
333
|
}
|
|
309
334
|
|
|
310
335
|
@Composable
|
|
311
|
-
|
|
336
|
+
fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
312
337
|
val helper = LocalScreenHelper.current
|
|
313
338
|
val snackBarData = helper.snackBarState ?: return
|
|
314
339
|
val density = LocalDensity.current
|
|
@@ -345,7 +370,7 @@ internal fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
345
370
|
LaunchedEffect(snackBarData.type.duration) {
|
|
346
371
|
val duration = snackBarData.type.duration
|
|
347
372
|
if (duration != null) {
|
|
348
|
-
delay(duration
|
|
373
|
+
delay(duration)
|
|
349
374
|
helper.hideSnackBar()
|
|
350
375
|
}
|
|
351
376
|
}
|
|
@@ -24,7 +24,7 @@ private const val BACK_WIDTH = 28
|
|
|
24
24
|
|
|
25
25
|
@Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
|
|
26
26
|
@Composable
|
|
27
|
-
|
|
27
|
+
fun useHeaderSearchAnimation(
|
|
28
28
|
opacityAni: Float,
|
|
29
29
|
scrollState: Int,
|
|
30
30
|
headerRightWidth: Dp,
|