@momo-kits/native-kits 0.300.4 → 0.300.5-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/build.gradle.kts +13 -0
- package/compose/build.gradle.kts +197 -0
- package/compose/build.gradle.kts.backup +197 -0
- package/compose/compose.podspec +47 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +20 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +153 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1071 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +65 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +81 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +542 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +189 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +478 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +265 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +223 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +265 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +185 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +361 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +308 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +330 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +560 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +125 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +501 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +236 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +287 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +137 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +116 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +215 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +404 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +732 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +233 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +217 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +377 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +455 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +103 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +413 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +37 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +192 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +135 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +74 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +20 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
- package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +44 -0
- package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +62 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +34 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +217 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +138 -0
- package/gradle/libs.versions.toml +68 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/README.md +120 -0
- package/package.json +1 -1
- package/settings.gradle.kts +64 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
package vn.momo.kits.navigation.component
|
|
2
|
+
|
|
3
|
+
import androidx.compose.animation.*
|
|
4
|
+
import androidx.compose.animation.core.CubicBezierEasing
|
|
5
|
+
import androidx.compose.animation.core.LinearEasing
|
|
6
|
+
import androidx.compose.animation.core.animateDpAsState
|
|
7
|
+
import androidx.compose.animation.core.tween
|
|
8
|
+
import androidx.compose.foundation.ScrollState
|
|
9
|
+
import androidx.compose.foundation.background
|
|
10
|
+
import androidx.compose.foundation.border
|
|
11
|
+
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
12
|
+
import androidx.compose.foundation.layout.*
|
|
13
|
+
import androidx.compose.material3.AlertDialogDefaults
|
|
14
|
+
import androidx.compose.material3.FloatingActionButton
|
|
15
|
+
import androidx.compose.material3.FloatingActionButtonDefaults
|
|
16
|
+
import androidx.compose.material3.FloatingActionButtonElevation
|
|
17
|
+
import androidx.compose.runtime.*
|
|
18
|
+
import androidx.compose.runtime.saveable.rememberSaveable
|
|
19
|
+
import androidx.compose.ui.Alignment
|
|
20
|
+
import androidx.compose.ui.Modifier
|
|
21
|
+
import androidx.compose.ui.graphics.Color
|
|
22
|
+
import androidx.compose.ui.unit.Dp
|
|
23
|
+
import androidx.compose.ui.unit.dp
|
|
24
|
+
import kotlinx.coroutines.delay
|
|
25
|
+
import kotlinx.coroutines.flow.MutableStateFlow
|
|
26
|
+
import kotlinx.coroutines.flow.collectLatest
|
|
27
|
+
import kotlinx.coroutines.launch
|
|
28
|
+
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
29
|
+
import vn.momo.kits.components.Icon
|
|
30
|
+
import vn.momo.kits.components.Text
|
|
31
|
+
import vn.momo.kits.const.Colors
|
|
32
|
+
import vn.momo.kits.const.Typography
|
|
33
|
+
import vn.momo.kits.modifier.conditional
|
|
34
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
35
|
+
|
|
36
|
+
enum class FABSize { SMALL, DEFAULT }
|
|
37
|
+
enum class FABPosition { END, CENTER }
|
|
38
|
+
|
|
39
|
+
data class FloatingButtonProps(
|
|
40
|
+
val icon: String,
|
|
41
|
+
val iconColor: Color? = null,
|
|
42
|
+
val label: String? = null,
|
|
43
|
+
val onClick: () -> Unit,
|
|
44
|
+
val size: FABSize = FABSize.DEFAULT,
|
|
45
|
+
val bottom: Dp? = null,
|
|
46
|
+
val scrollState: ScrollState? = null,
|
|
47
|
+
val position: FABPosition? = FABPosition.END,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
private val FabSmallSize = 36.dp
|
|
51
|
+
private val FabDefaultSize = 48.dp
|
|
52
|
+
private val FabExpandedWidth = 80.dp
|
|
53
|
+
private val FabIconSizeSmall = 12.dp
|
|
54
|
+
private val FabIconSizeDefault = 24.dp
|
|
55
|
+
private val FabPaddingHorizontal = 12.dp
|
|
56
|
+
|
|
57
|
+
@Composable
|
|
58
|
+
internal fun FloatingButton(
|
|
59
|
+
scrollPosition: Int,
|
|
60
|
+
bottom: Dp,
|
|
61
|
+
onClick: () -> Unit,
|
|
62
|
+
containerColor: Color,
|
|
63
|
+
contentColor: Color = containerColor,
|
|
64
|
+
icon: String,
|
|
65
|
+
iconColor: Color? = null,
|
|
66
|
+
text: String? = null,
|
|
67
|
+
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(4.dp),
|
|
68
|
+
size: FABSize = FABSize.DEFAULT,
|
|
69
|
+
position: FABPosition = FABPosition.END,
|
|
70
|
+
keyboardSize: Dp = 0.dp,
|
|
71
|
+
) {
|
|
72
|
+
val scrollStateFlow = remember { MutableStateFlow(scrollPosition) }
|
|
73
|
+
var lastScrollPosition by rememberSaveable { mutableStateOf(0) }
|
|
74
|
+
var isExpanded by rememberSaveable { mutableStateOf(false) }
|
|
75
|
+
|
|
76
|
+
val coroutineScope = rememberCoroutineScope()
|
|
77
|
+
|
|
78
|
+
// Animations
|
|
79
|
+
val baseSize = if (size == FABSize.SMALL) FabSmallSize else FabDefaultSize
|
|
80
|
+
val width by animateDpAsState(
|
|
81
|
+
targetValue = if (isExpanded && text != null) FabExpandedWidth else baseSize,
|
|
82
|
+
animationSpec = tween(100, easing = CubicBezierEasing(0.2f, 0.2f, 0.2f, 0.2f))
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
// Scroll listener
|
|
86
|
+
LaunchedEffect(text) {
|
|
87
|
+
if (text != null) {
|
|
88
|
+
coroutineScope.launch {
|
|
89
|
+
scrollStateFlow.collectLatest { newScroll ->
|
|
90
|
+
isExpanded = newScroll <= lastScrollPosition
|
|
91
|
+
delay(100.milliseconds)
|
|
92
|
+
lastScrollPosition = newScroll
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
LaunchedEffect(scrollPosition) {
|
|
99
|
+
scrollStateFlow.value = scrollPosition
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
Box(
|
|
103
|
+
modifier = Modifier
|
|
104
|
+
.fillMaxSize()
|
|
105
|
+
.padding(end = 12.dp, bottom = bottom)
|
|
106
|
+
.offset(y = -keyboardSize)
|
|
107
|
+
.background(Color.Transparent),
|
|
108
|
+
contentAlignment = if (position == FABPosition.END) Alignment.BottomEnd else Alignment.BottomCenter,
|
|
109
|
+
) {
|
|
110
|
+
FloatingActionButton(
|
|
111
|
+
onClick = onClick,
|
|
112
|
+
shape = AlertDialogDefaults.shape,
|
|
113
|
+
containerColor = containerColor,
|
|
114
|
+
contentColor = contentColor,
|
|
115
|
+
elevation = elevation,
|
|
116
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
117
|
+
modifier = Modifier
|
|
118
|
+
.sizeIn(minWidth = width)
|
|
119
|
+
.height(baseSize)
|
|
120
|
+
.conditional(IsShowBaseLineDebug) {
|
|
121
|
+
border(1.dp, Colors.blue_03)
|
|
122
|
+
}
|
|
123
|
+
) {
|
|
124
|
+
Row(
|
|
125
|
+
modifier = Modifier.padding(
|
|
126
|
+
start = if (isExpanded) FabPaddingHorizontal else 0.dp,
|
|
127
|
+
end = if (isExpanded) FabPaddingHorizontal else 0.dp,
|
|
128
|
+
),
|
|
129
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
130
|
+
horizontalArrangement = if (isExpanded) Arrangement.Start else Arrangement.Center
|
|
131
|
+
) {
|
|
132
|
+
Icon(
|
|
133
|
+
source = icon,
|
|
134
|
+
size = if (size == FABSize.SMALL) FabIconSizeSmall else FabIconSizeDefault,
|
|
135
|
+
color = iconColor ?: Color.White
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
AnimatedVisibility(
|
|
139
|
+
visible = isExpanded,
|
|
140
|
+
enter = fadeInExpandAnimation,
|
|
141
|
+
exit = fadeOutShrinkAnimation,
|
|
142
|
+
) {
|
|
143
|
+
Row {
|
|
144
|
+
Spacer(Modifier.width(12.dp))
|
|
145
|
+
Text(
|
|
146
|
+
text = text ?: "",
|
|
147
|
+
color = Color.White,
|
|
148
|
+
style = Typography.actionDefaultBold
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private val fadeOutShrinkAnimation = fadeOut(
|
|
158
|
+
animationSpec = tween(100, easing = LinearEasing)
|
|
159
|
+
) + shrinkHorizontally(
|
|
160
|
+
animationSpec = tween(100, easing = LinearEasing),
|
|
161
|
+
shrinkTowards = Alignment.Start
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
private val fadeInExpandAnimation = fadeIn(
|
|
165
|
+
animationSpec = tween(100, easing = LinearEasing)
|
|
166
|
+
) + expandHorizontally(
|
|
167
|
+
animationSpec = tween(100, easing = LinearEasing),
|
|
168
|
+
expandFrom = Alignment.Start
|
|
169
|
+
)
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
package vn.momo.kits.navigation.component
|
|
2
|
+
|
|
3
|
+
import vn.momo.kits.modifier.InternalApi
|
|
4
|
+
|
|
5
|
+
import androidx.compose.animation.core.animateFloatAsState
|
|
6
|
+
import androidx.compose.foundation.background
|
|
7
|
+
import androidx.compose.foundation.border
|
|
8
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
9
|
+
import androidx.compose.foundation.layout.Box
|
|
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.offset
|
|
15
|
+
import androidx.compose.foundation.layout.padding
|
|
16
|
+
import androidx.compose.foundation.layout.size
|
|
17
|
+
import androidx.compose.foundation.layout.width
|
|
18
|
+
import androidx.compose.foundation.layout.wrapContentHeight
|
|
19
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
20
|
+
import androidx.compose.runtime.Composable
|
|
21
|
+
import androidx.compose.runtime.CompositionLocalProvider
|
|
22
|
+
import androidx.compose.runtime.compositionLocalOf
|
|
23
|
+
import androidx.compose.runtime.getValue
|
|
24
|
+
import androidx.compose.ui.Alignment
|
|
25
|
+
import androidx.compose.ui.Modifier
|
|
26
|
+
import androidx.compose.ui.draw.clipToBounds
|
|
27
|
+
import androidx.compose.ui.draw.drawBehind
|
|
28
|
+
import androidx.compose.ui.geometry.Offset
|
|
29
|
+
import androidx.compose.ui.graphics.graphicsLayer
|
|
30
|
+
import androidx.compose.ui.graphics.Brush
|
|
31
|
+
import androidx.compose.ui.graphics.Color
|
|
32
|
+
import androidx.compose.ui.layout.onGloballyPositioned
|
|
33
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
34
|
+
import androidx.compose.ui.text.style.TextAlign
|
|
35
|
+
import androidx.compose.ui.unit.Dp
|
|
36
|
+
import androidx.compose.ui.unit.dp
|
|
37
|
+
import vn.momo.kits.components.Icon
|
|
38
|
+
import vn.momo.kits.components.Image
|
|
39
|
+
import vn.momo.kits.components.InputSearchProps
|
|
40
|
+
import vn.momo.kits.const.AppTheme
|
|
41
|
+
import vn.momo.kits.const.Colors
|
|
42
|
+
import vn.momo.kits.components.PopupNotifyProps
|
|
43
|
+
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
44
|
+
import vn.momo.kits.const.Spacing
|
|
45
|
+
import vn.momo.kits.layout.DuoMetrics
|
|
46
|
+
import vn.momo.kits.layout.getScreenLayout
|
|
47
|
+
import vn.momo.kits.modifier.activeOpacityClickable
|
|
48
|
+
import vn.momo.kits.modifier.conditional
|
|
49
|
+
import vn.momo.kits.modifier.setAutomationId
|
|
50
|
+
import vn.momo.kits.navigation.LocalHeaderRightWidthPx
|
|
51
|
+
import vn.momo.kits.navigation.LocalNavigator
|
|
52
|
+
import vn.momo.kits.navigation.LocalOptions
|
|
53
|
+
import vn.momo.kits.navigation.LocalScrollState
|
|
54
|
+
import vn.momo.kits.navigation.getInputSearchType
|
|
55
|
+
import vn.momo.kits.navigation.usesDuoGlassHeader
|
|
56
|
+
import vn.momo.kits.utils.horizontalSafeAreaPadding
|
|
57
|
+
|
|
58
|
+
@InternalApi
|
|
59
|
+
const val HEADER_HEIGHT = 52
|
|
60
|
+
internal enum class InputSearchType { None, Header, Animated }
|
|
61
|
+
enum class TitlePosition { LEFT, CENTER }
|
|
62
|
+
|
|
63
|
+
private val HEADER_ACTIONS_WIDTH = 172.dp
|
|
64
|
+
|
|
65
|
+
// Extra width the 48pt back and toolkit take on the iPhone Duo status bar row.
|
|
66
|
+
private val STATUS_BAR_ROW_ACTIONS_EXTRA = 55.dp
|
|
67
|
+
|
|
68
|
+
@Suppress("FrequentlyChangingValue")
|
|
69
|
+
@Composable
|
|
70
|
+
internal fun headerOpacity(): Float {
|
|
71
|
+
val options = LocalOptions.current
|
|
72
|
+
val scrollState = LocalScrollState.current
|
|
73
|
+
val opacityHeight = when (val header = options.headerType) {
|
|
74
|
+
is HeaderType.Animated -> with(LocalDensity.current) { header.layoutOffSet.roundToPx() }
|
|
75
|
+
else -> HEADER_HEIGHT
|
|
76
|
+
}
|
|
77
|
+
val opacity by animateFloatAsState(
|
|
78
|
+
targetValue = when {
|
|
79
|
+
options.headerType is HeaderType.Transparent -> 0f
|
|
80
|
+
opacityHeight <= 0 -> if (scrollState.value > 0) 1f else 0f
|
|
81
|
+
else -> (scrollState.value / opacityHeight.toFloat()).coerceIn(0f, 1f)
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
return opacity
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Back button and toolkit share the bar with the title unless the iPhone Duo side bar holds them.
|
|
88
|
+
@Composable
|
|
89
|
+
internal fun headerTitleMaxWidth(): Dp {
|
|
90
|
+
val layout = getScreenLayout()
|
|
91
|
+
val clearance = layout.statusBarClearance
|
|
92
|
+
val clearanceWidth = clearance?.let { it.left + it.right } ?: 0.dp
|
|
93
|
+
if (layout.sideBar != null) return layout.contentWidth - Spacing.M * 2 - clearanceWidth
|
|
94
|
+
return layout.width - HEADER_ACTIONS_WIDTH - (if (clearance != null) STATUS_BAR_ROW_ACTIONS_EXTRA else 0.dp) - clearanceWidth
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Scroll distance over which the Duo glass bar fades in.
|
|
98
|
+
private val DUO_GLASS_FADE_DISTANCE = 16.dp
|
|
99
|
+
|
|
100
|
+
// RN DuoGlassBackground: translucent surface with a hairline once content scrolls under it.
|
|
101
|
+
@Suppress("FrequentlyChangingValue")
|
|
102
|
+
@Composable
|
|
103
|
+
private fun Modifier.duoGlassBar(): Modifier {
|
|
104
|
+
val scrollState = LocalScrollState.current
|
|
105
|
+
val fadePx = with(LocalDensity.current) { DUO_GLASS_FADE_DISTANCE.toPx() }
|
|
106
|
+
val alpha by animateFloatAsState((scrollState.value / fadePx).coerceIn(0f, 1f), label = "DuoGlassAlpha")
|
|
107
|
+
val colors = AppTheme.current.colors
|
|
108
|
+
return background(colors.background.surface.copy(alpha = 0.8f * alpha))
|
|
109
|
+
.drawBehind {
|
|
110
|
+
val stroke = 0.5.dp.toPx()
|
|
111
|
+
drawLine(
|
|
112
|
+
color = colors.border.default.copy(alpha = alpha),
|
|
113
|
+
start = Offset(0f, size.height - stroke / 2),
|
|
114
|
+
end = Offset(size.width, size.height - stroke / 2),
|
|
115
|
+
strokeWidth = stroke,
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@Composable
|
|
121
|
+
internal fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
122
|
+
val options = LocalOptions.current
|
|
123
|
+
val navigator = LocalNavigator.current
|
|
124
|
+
val headerRightWidthPx = LocalHeaderRightWidthPx.current
|
|
125
|
+
val inputSearchType = getInputSearchType(options)
|
|
126
|
+
val layout = getScreenLayout()
|
|
127
|
+
val useSideBar = layout.sideBar != null
|
|
128
|
+
// iPhone Duo inner portrait: the row sits on the status bar, between its clusters
|
|
129
|
+
val clearance = layout.statusBarClearance
|
|
130
|
+
val statusBarRow = clearance != null && !useSideBar
|
|
131
|
+
val opacity = headerOpacity()
|
|
132
|
+
|
|
133
|
+
val headerColor = getHeaderColor(options.headerType, opacity, options.tintColor, Colors.black_17)
|
|
134
|
+
|
|
135
|
+
val animatedAlpha by animateFloatAsState(targetValue = opacity, label = "BackgroundAlpha")
|
|
136
|
+
|
|
137
|
+
val background = if (options.headerType is HeaderType.Transparent)
|
|
138
|
+
options.backgroundColor ?: AppTheme.current.colors.background.surface
|
|
139
|
+
else
|
|
140
|
+
AppTheme.current.colors.background.surface
|
|
141
|
+
|
|
142
|
+
if (options.headerType == HeaderType.None) return
|
|
143
|
+
|
|
144
|
+
val titlePosition = options.titlePosition
|
|
145
|
+
val titleColor = headerColor.tintIconColor
|
|
146
|
+
.copy(alpha = if (inputSearchType == InputSearchType.Animated) 1f - animatedAlpha else 1f)
|
|
147
|
+
// Centered title needs a full-width overlay to stay screen-centered, not boxed between back button and header right.
|
|
148
|
+
val centerTitle = titlePosition == TitlePosition.CENTER && options.headerTitle is HeaderTitle.Default
|
|
149
|
+
|
|
150
|
+
val useDuoGlass = options.usesDuoGlassHeader(layout)
|
|
151
|
+
val headerImage = AppTheme.current.assets.headerBackground
|
|
152
|
+
.takeUnless { options.headerType is HeaderType.Transparent || useDuoGlass }
|
|
153
|
+
|
|
154
|
+
Box(
|
|
155
|
+
Modifier.height(layout.headerHeight)
|
|
156
|
+
.fillMaxWidth()
|
|
157
|
+
.then(if (useDuoGlass) Modifier.duoGlassBar() else Modifier)
|
|
158
|
+
.conditional(headerImage.isNullOrEmpty() && !useDuoGlass) {
|
|
159
|
+
background(background.copy(alpha = animatedAlpha))
|
|
160
|
+
}
|
|
161
|
+
.conditional(IsShowBaseLineDebug) {
|
|
162
|
+
border(1.dp, Colors.blue_03)
|
|
163
|
+
},
|
|
164
|
+
contentAlignment = Alignment.BottomCenter
|
|
165
|
+
) {
|
|
166
|
+
if (!headerImage.isNullOrEmpty()) {
|
|
167
|
+
Box(
|
|
168
|
+
Modifier
|
|
169
|
+
.matchParentSize()
|
|
170
|
+
.clipToBounds()
|
|
171
|
+
.graphicsLayer { alpha = animatedAlpha }
|
|
172
|
+
.background(background)
|
|
173
|
+
) {
|
|
174
|
+
Image(
|
|
175
|
+
source = headerImage,
|
|
176
|
+
loading = false,
|
|
177
|
+
modifier = Modifier
|
|
178
|
+
.fillMaxWidth()
|
|
179
|
+
.wrapContentHeight(Alignment.Top, unbounded = true)
|
|
180
|
+
.height(HEADER_BACKGROUND_HEIGHT),
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
Row(
|
|
185
|
+
modifier = Modifier.height(layout.headerBarHeight)
|
|
186
|
+
.fillMaxWidth()
|
|
187
|
+
.horizontalSafeAreaPadding()
|
|
188
|
+
.padding(
|
|
189
|
+
start = Spacing.M + (clearance?.left ?: 0.dp),
|
|
190
|
+
end = Spacing.M + (clearance?.right ?: 0.dp),
|
|
191
|
+
),
|
|
192
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
193
|
+
horizontalArrangement = Arrangement.SpaceBetween
|
|
194
|
+
) {
|
|
195
|
+
if (!options.hiddenBack && !useSideBar) {
|
|
196
|
+
if (statusBarRow) {
|
|
197
|
+
SideBarButton(
|
|
198
|
+
icon = "arrow-back",
|
|
199
|
+
headerColor = headerColor,
|
|
200
|
+
automationId = "btn_navigation_back",
|
|
201
|
+
onClick = { navigator.onBackSafe { } },
|
|
202
|
+
)
|
|
203
|
+
} else {
|
|
204
|
+
BackButton(
|
|
205
|
+
borderColor = headerColor.borderColor,
|
|
206
|
+
backgroundButton = headerColor.backgroundButton,
|
|
207
|
+
tintIconColor = headerColor.tintIconColor,
|
|
208
|
+
onBackHandler = {
|
|
209
|
+
navigator.onBackSafe { }
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
Spacer(Modifier.width(Spacing.S))
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (centerTitle) {
|
|
217
|
+
Spacer(Modifier.weight(1f))
|
|
218
|
+
} else {
|
|
219
|
+
HeaderContent(
|
|
220
|
+
headerTitle = options.headerTitle,
|
|
221
|
+
tintIconColor = titleColor,
|
|
222
|
+
titlePosition = titlePosition,
|
|
223
|
+
modifier = Modifier.weight(1f)
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
Box(Modifier.onGloballyPositioned {
|
|
227
|
+
if(headerRightWidthPx.intValue != it.size.width) headerRightWidthPx.intValue = it.size.width
|
|
228
|
+
}){
|
|
229
|
+
val headerRight = options.headerRight
|
|
230
|
+
when {
|
|
231
|
+
useSideBar && headerRight is HeaderRight.Toolkit -> Unit
|
|
232
|
+
statusBarRow && headerRight is HeaderRight.Toolkit -> Toolkit(
|
|
233
|
+
headerRight = headerRight,
|
|
234
|
+
tintColor = options.tintColor,
|
|
235
|
+
headerColor = headerColor,
|
|
236
|
+
layout = ToolkitLayout.SideBarRow,
|
|
237
|
+
)
|
|
238
|
+
else -> CompositionLocalProvider(LocalHeaderColor provides headerColor) {
|
|
239
|
+
HeaderRight(headerRight, options.tintColor, headerColor)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (centerTitle) {
|
|
245
|
+
// on the status bar row the clusters are lopsided, so both sides keep the wider one's room
|
|
246
|
+
val centerInset = if (clearance != null) {
|
|
247
|
+
val back = if (options.hiddenBack || useSideBar) 0.dp else DuoMetrics.controlSize + Spacing.S
|
|
248
|
+
val right = with(LocalDensity.current) { headerRightWidthPx.intValue.toDp() }
|
|
249
|
+
maxOf(clearance.left + back, clearance.right + right) + Spacing.S
|
|
250
|
+
} else {
|
|
251
|
+
0.dp
|
|
252
|
+
}
|
|
253
|
+
Box(
|
|
254
|
+
modifier = Modifier.height(layout.headerBarHeight)
|
|
255
|
+
.fillMaxWidth()
|
|
256
|
+
.horizontalSafeAreaPadding()
|
|
257
|
+
.padding(horizontal = Spacing.M + centerInset),
|
|
258
|
+
contentAlignment = Alignment.Center
|
|
259
|
+
) {
|
|
260
|
+
HeaderContent(
|
|
261
|
+
headerTitle = options.headerTitle,
|
|
262
|
+
tintIconColor = titleColor,
|
|
263
|
+
titlePosition = titlePosition,
|
|
264
|
+
centerWidthFraction = if (clearance != null) 1f else 0.5f,
|
|
265
|
+
modifier = Modifier.fillMaxWidth()
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
VerticalShadow(opacity)
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@Composable
|
|
274
|
+
private fun BackButton(borderColor: Color, backgroundButton: Color, tintIconColor: Color, onBackHandler: () -> Unit){
|
|
275
|
+
Box(
|
|
276
|
+
modifier = Modifier
|
|
277
|
+
.size(28.dp)
|
|
278
|
+
.background(backgroundButton, RoundedCornerShape(100))
|
|
279
|
+
.border(width = 0.2.dp, color = borderColor, shape = RoundedCornerShape(100))
|
|
280
|
+
.activeOpacityClickable(onClick = onBackHandler)
|
|
281
|
+
.padding(Spacing.XS)
|
|
282
|
+
.setAutomationId("btn_navigation_back"),
|
|
283
|
+
contentAlignment = Alignment.Center
|
|
284
|
+
) {
|
|
285
|
+
Icon(
|
|
286
|
+
source = "arrow-back",
|
|
287
|
+
color = tintIconColor,
|
|
288
|
+
size = 20.dp,
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@Composable
|
|
294
|
+
internal fun HeaderContent(
|
|
295
|
+
headerTitle: HeaderTitle,
|
|
296
|
+
tintIconColor: Color,
|
|
297
|
+
titlePosition: TitlePosition = TitlePosition.LEFT,
|
|
298
|
+
centerWidthFraction: Float = 0.5f,
|
|
299
|
+
modifier: Modifier = Modifier,
|
|
300
|
+
){
|
|
301
|
+
Box(
|
|
302
|
+
modifier = modifier,
|
|
303
|
+
contentAlignment = if (titlePosition == TitlePosition.CENTER) Alignment.Center else Alignment.CenterStart
|
|
304
|
+
) {
|
|
305
|
+
when (headerTitle){
|
|
306
|
+
is HeaderTitle.Default -> {
|
|
307
|
+
HeaderTitle(
|
|
308
|
+
title = headerTitle.title,
|
|
309
|
+
color = tintIconColor,
|
|
310
|
+
modifier = Modifier.fillMaxWidth(fraction = if (titlePosition == TitlePosition.CENTER) centerWidthFraction else 1f),
|
|
311
|
+
textAlign = if (titlePosition == TitlePosition.CENTER) TextAlign.Center else TextAlign.Start
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
is HeaderTitle.Journey -> {
|
|
315
|
+
HeaderJourney(
|
|
316
|
+
data = headerTitle,
|
|
317
|
+
tintIconColor = tintIconColor
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
is HeaderTitle.Location -> {
|
|
321
|
+
HeaderLocation(
|
|
322
|
+
data = headerTitle,
|
|
323
|
+
tintIconColor = tintIconColor
|
|
324
|
+
)
|
|
325
|
+
}
|
|
326
|
+
is HeaderTitle.User -> {
|
|
327
|
+
HeaderUser(
|
|
328
|
+
data = headerTitle
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@Composable
|
|
336
|
+
internal fun VerticalShadow(opacity: Float){
|
|
337
|
+
if(opacity == 1f){
|
|
338
|
+
Box(modifier = Modifier
|
|
339
|
+
.fillMaxWidth()
|
|
340
|
+
.height(6.dp)
|
|
341
|
+
.offset(x = 0.dp, y = 6.dp)
|
|
342
|
+
.background(
|
|
343
|
+
brush = Brush.verticalGradient(
|
|
344
|
+
colors = listOf(Color.Black.copy(alpha = 0.05f), Color.Transparent)
|
|
345
|
+
)
|
|
346
|
+
)
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
sealed class HeaderTitle {
|
|
352
|
+
class Default(val title: String) : HeaderTitle()
|
|
353
|
+
|
|
354
|
+
class User(
|
|
355
|
+
val title: String,
|
|
356
|
+
val subTitle: String? = null,
|
|
357
|
+
val image: List<String>? = null,
|
|
358
|
+
val dotColor: Color? = null,
|
|
359
|
+
val tintColor: Color? = null,
|
|
360
|
+
val onPress: (() -> Unit)? = null,
|
|
361
|
+
val icons: List<String> = emptyList(),
|
|
362
|
+
val isLoading: Boolean = false
|
|
363
|
+
) : HeaderTitle()
|
|
364
|
+
|
|
365
|
+
class Location(
|
|
366
|
+
val description: String? = null,
|
|
367
|
+
val location: String,
|
|
368
|
+
val tintColor: String? = null,
|
|
369
|
+
val onPress: (() -> Unit)? = null,
|
|
370
|
+
val isLoading: Boolean = false
|
|
371
|
+
) : HeaderTitle()
|
|
372
|
+
|
|
373
|
+
class Journey(
|
|
374
|
+
val start: String,
|
|
375
|
+
val end: String? = null,
|
|
376
|
+
val description: String? = null,
|
|
377
|
+
val icon: String,
|
|
378
|
+
val iconColor: String? = null,
|
|
379
|
+
val tintColor: String? = null,
|
|
380
|
+
val onPress: (() -> Unit)? = null,
|
|
381
|
+
val isLoading: Boolean = false
|
|
382
|
+
) : HeaderTitle()
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
sealed class HeaderType {
|
|
386
|
+
interface DefaultOrExtended {
|
|
387
|
+
val useAnimated: Boolean
|
|
388
|
+
val inputSearchProps: InputSearchProps?
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
data class Default(
|
|
392
|
+
override val useAnimated: Boolean = false,
|
|
393
|
+
override val inputSearchProps: InputSearchProps? = null
|
|
394
|
+
) : HeaderType(), DefaultOrExtended
|
|
395
|
+
|
|
396
|
+
data class Extended(
|
|
397
|
+
override val useAnimated: Boolean = false,
|
|
398
|
+
override val inputSearchProps: InputSearchProps? = null
|
|
399
|
+
) : HeaderType(), DefaultOrExtended
|
|
400
|
+
|
|
401
|
+
data object None : HeaderType()
|
|
402
|
+
|
|
403
|
+
data class Animated(
|
|
404
|
+
val aspectRatio: AnimatedHeaderRatio = AnimatedHeaderRatio.RATIO_16_9,
|
|
405
|
+
val isSurface: Boolean = true,
|
|
406
|
+
val layoutOffSet: Dp = 56.dp,
|
|
407
|
+
val height: Dp? = null,
|
|
408
|
+
val composable: @Composable (scrollState: Int) -> Unit = {}
|
|
409
|
+
) : HeaderType()
|
|
410
|
+
|
|
411
|
+
data class Transparent(
|
|
412
|
+
val isFullScreenContent: Boolean = false
|
|
413
|
+
) : HeaderType()
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
data class HeaderBackProps(
|
|
417
|
+
val preventBack: PopupNotifyProps? = null,
|
|
418
|
+
)
|
|
419
|
+
|
|
420
|
+
@InternalApi
|
|
421
|
+
data class HeaderColor(val tintIconColor: Color, val backgroundButton: Color, val borderColor: Color)
|
|
422
|
+
|
|
423
|
+
// The enclosing header's colors, so a custom header right follows the bar (SwiftUI `\.headerColor`).
|
|
424
|
+
internal val LocalHeaderColor = compositionLocalOf<HeaderColor?> { null }
|
|
425
|
+
|
|
426
|
+
internal fun getHeaderColor(headerType: HeaderType, opacity: Float, tintColor: Color?, defaultColor: Color): HeaderColor{
|
|
427
|
+
return if(headerType is HeaderType.Animated) {
|
|
428
|
+
if (opacity == 1f || !headerType.isSurface)
|
|
429
|
+
HeaderColor(
|
|
430
|
+
tintIconColor = Colors.black_17,
|
|
431
|
+
backgroundButton = Colors.black_01.copy(alpha = 0.6f),
|
|
432
|
+
borderColor = Colors.black_20.copy(alpha = 0.2f)
|
|
433
|
+
)
|
|
434
|
+
else
|
|
435
|
+
HeaderColor(
|
|
436
|
+
tintIconColor = Colors.black_01,
|
|
437
|
+
backgroundButton = Colors.black_20.copy(alpha = 0.6f),
|
|
438
|
+
borderColor = Color.Transparent
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
if (tintColor == Colors.black_01)
|
|
443
|
+
HeaderColor(
|
|
444
|
+
tintIconColor = tintColor,
|
|
445
|
+
backgroundButton = Colors.black_20.copy(alpha = 0.6f),
|
|
446
|
+
borderColor = Colors.black_01.copy(alpha = 0.2f)
|
|
447
|
+
)
|
|
448
|
+
else
|
|
449
|
+
HeaderColor(
|
|
450
|
+
tintIconColor = tintColor ?: defaultColor,
|
|
451
|
+
backgroundButton = Colors.black_01.copy(alpha = 0.6f),
|
|
452
|
+
borderColor = Colors.black_20.copy(alpha = 0.2f)
|
|
453
|
+
)
|
|
454
|
+
}
|
|
455
|
+
}
|