@momo-kits/native-kits 0.157.5 → 0.158.1-beta.1-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/.claude/settings.local.json +11 -0
- package/.claude/skills/design-system/SKILL.md +88 -0
- package/.claude/skills/design-system/references/components/avatar.md +134 -0
- package/.claude/skills/design-system/references/components/badge.md +127 -0
- package/.claude/skills/design-system/references/components/bottom-tab.md +177 -0
- package/.claude/skills/design-system/references/components/bottomsheet.md +170 -0
- package/.claude/skills/design-system/references/components/button.md +206 -0
- package/.claude/skills/design-system/references/components/carousel.md +117 -0
- package/.claude/skills/design-system/references/components/checkbox.md +98 -0
- package/.claude/skills/design-system/references/components/chip.md +146 -0
- package/.claude/skills/design-system/references/components/collapse.md +120 -0
- package/.claude/skills/design-system/references/components/date-picker.md +119 -0
- package/.claude/skills/design-system/references/components/divider.md +84 -0
- package/.claude/skills/design-system/references/components/icon.md +130 -0
- package/.claude/skills/design-system/references/components/image.md +81 -0
- package/.claude/skills/design-system/references/components/information.md +107 -0
- package/.claude/skills/design-system/references/components/input-dropdown.md +138 -0
- package/.claude/skills/design-system/references/components/input-money.md +157 -0
- package/.claude/skills/design-system/references/components/input-otp.md +132 -0
- package/.claude/skills/design-system/references/components/input-phone-number.md +140 -0
- package/.claude/skills/design-system/references/components/input-search.md +124 -0
- package/.claude/skills/design-system/references/components/input-text-area.md +133 -0
- package/.claude/skills/design-system/references/components/input.md +152 -0
- package/.claude/skills/design-system/references/components/loader.md +87 -0
- package/.claude/skills/design-system/references/components/pagination.md +105 -0
- package/.claude/skills/design-system/references/components/popup-notify.md +128 -0
- package/.claude/skills/design-system/references/components/progress-info.md +114 -0
- package/.claude/skills/design-system/references/components/radio.md +86 -0
- package/.claude/skills/design-system/references/components/rating.md +126 -0
- package/.claude/skills/design-system/references/components/skeleton.md +120 -0
- package/.claude/skills/design-system/references/components/slider.md +141 -0
- package/.claude/skills/design-system/references/components/snackbar.md +97 -0
- package/.claude/skills/design-system/references/components/stepper.md +100 -0
- package/.claude/skills/design-system/references/components/steps.md +91 -0
- package/.claude/skills/design-system/references/components/suggest-action.md +95 -0
- package/.claude/skills/design-system/references/components/swipe.md +121 -0
- package/.claude/skills/design-system/references/components/switch.md +98 -0
- package/.claude/skills/design-system/references/components/tab-view.md +120 -0
- package/.claude/skills/design-system/references/components/tag.md +118 -0
- package/.claude/skills/design-system/references/components/text.md +151 -0
- package/.claude/skills/design-system/references/components/toast.md +99 -0
- package/.claude/skills/design-system/references/components/tooltip.md +138 -0
- package/.claude/skills/design-system/references/components/top-nav-miniapp.md +94 -0
- package/.claude/skills/design-system/references/components/top-nav.md +226 -0
- package/.claude/skills/design-system/references/components/uploader.md +115 -0
- package/.claude/skills/design-system/references/navigation/bottom-tab.md +131 -0
- package/.claude/skills/design-system/references/navigation/bottomsheet.md +161 -0
- package/.claude/skills/design-system/references/navigation/modal.md +133 -0
- package/.claude/skills/design-system/references/navigation/navigation-options.md +225 -0
- package/.claude/skills/design-system/references/navigation/navigator.md +111 -0
- package/.claude/skills/design-system/references/navigation/setup.md +134 -0
- package/.claude/skills/design-system/references/navigation/stack.md +128 -0
- package/.claude/skills/design-system/references/spec-convention.md +80 -0
- package/.claude/skills/design-system/references/tokens/colors.md +131 -0
- package/.claude/skills/design-system/references/tokens/spacing-radius.md +144 -0
- package/.claude/skills/design-system/references/tokens/theme.md +125 -0
- package/.claude/skills/design-system/references/tokens/typography.md +135 -0
- package/.claude/skills/design-system-kits/SKILL.md +102 -0
- package/.claude/skills/design-system-kits/references/code-convention.md +118 -0
- package/.claude/skills/design-system-kits/references/components/avatar.md +45 -0
- package/.claude/skills/design-system-kits/references/components/badge.md +27 -0
- package/.claude/skills/design-system-kits/references/components/button.md +65 -0
- package/.claude/skills/design-system-kits/references/components/carousel.md +51 -0
- package/.claude/skills/design-system-kits/references/components/checkbox.md +39 -0
- package/.claude/skills/design-system-kits/references/components/chip.md +54 -0
- package/.claude/skills/design-system-kits/references/components/collapse.md +63 -0
- package/.claude/skills/design-system-kits/references/components/date-picker.md +36 -0
- package/.claude/skills/design-system-kits/references/components/divider.md +21 -0
- package/.claude/skills/design-system-kits/references/components/icon.md +382 -0
- package/.claude/skills/design-system-kits/references/components/image.md +62 -0
- package/.claude/skills/design-system-kits/references/components/information.md +61 -0
- package/.claude/skills/design-system-kits/references/components/input-dropdown.md +92 -0
- package/.claude/skills/design-system-kits/references/components/input-money.md +128 -0
- package/.claude/skills/design-system-kits/references/components/input-otp.md +85 -0
- package/.claude/skills/design-system-kits/references/components/input-phone-number.md +96 -0
- package/.claude/skills/design-system-kits/references/components/input-search.md +127 -0
- package/.claude/skills/design-system-kits/references/components/input-text-area.md +100 -0
- package/.claude/skills/design-system-kits/references/components/input.md +126 -0
- package/.claude/skills/design-system-kits/references/components/loader.md +41 -0
- package/.claude/skills/design-system-kits/references/components/pagination.md +47 -0
- package/.claude/skills/design-system-kits/references/components/popup-notify.md +69 -0
- package/.claude/skills/design-system-kits/references/components/popup-promotion.md +35 -0
- package/.claude/skills/design-system-kits/references/components/progress-info.md +55 -0
- package/.claude/skills/design-system-kits/references/components/radio.md +42 -0
- package/.claude/skills/design-system-kits/references/components/rating.md +36 -0
- package/.claude/skills/design-system-kits/references/components/skeleton.md +25 -0
- package/.claude/skills/design-system-kits/references/components/slider.md +53 -0
- package/.claude/skills/design-system-kits/references/components/snackbar.md +52 -0
- package/.claude/skills/design-system-kits/references/components/stepper.md +46 -0
- package/.claude/skills/design-system-kits/references/components/steps.md +57 -0
- package/.claude/skills/design-system-kits/references/components/suggest-action.md +44 -0
- package/.claude/skills/design-system-kits/references/components/swipe.md +44 -0
- package/.claude/skills/design-system-kits/references/components/switch.md +43 -0
- package/.claude/skills/design-system-kits/references/components/tab-view.md +56 -0
- package/.claude/skills/design-system-kits/references/components/tag.md +50 -0
- package/.claude/skills/design-system-kits/references/components/text.md +56 -0
- package/.claude/skills/design-system-kits/references/components/toast.md +51 -0
- package/.claude/skills/design-system-kits/references/components/tooltip.md +95 -0
- package/.claude/skills/design-system-kits/references/components/uploader.md +48 -0
- package/.claude/skills/design-system-kits/references/design-spec-structure.md +356 -0
- package/.claude/skills/design-system-kits/references/design-spec-to-code.md +596 -0
- package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +155 -0
- package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +94 -0
- package/.claude/skills/design-system-kits/references/navigation/modal.md +125 -0
- package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +430 -0
- package/.claude/skills/design-system-kits/references/navigation/navigator.md +177 -0
- package/.claude/skills/design-system-kits/references/navigation/setup.md +94 -0
- package/.claude/skills/design-system-kits/references/navigation/stack.md +152 -0
- package/.claude/skills/design-system-kits/references/screen-layout-rule.md +125 -0
- package/.claude/skills/design-system-kits/references/tokens/colors.md +183 -0
- package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +45 -0
- package/.claude/skills/design-system-kits/references/tokens/theme.md +97 -0
- package/.claude/skills/design-system-kits/references/tokens/typography.md +105 -0
- package/.claude/skills/vibe-design/SKILL.md +306 -0
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +180 -0
- package/compose/build.gradle.kts.backup +180 -0
- package/compose/compose.podspec +54 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +117 -0
- package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +57 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +107 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +201 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +222 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +305 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +720 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +121 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +405 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -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 +85 -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 +340 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +198 -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 +123 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +94 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +136 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +148 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +116 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +448 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +172 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +255 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +233 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +254 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +241 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +364 -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 +92 -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 +352 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +103 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +70 -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 +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +130 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +590 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +177 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +205 -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 +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +191 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -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 +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +285 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +68 -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 +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -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 +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +119 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +98 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +161 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +331 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +497 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +162 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +243 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +187 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +279 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +370 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +46 -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 +62 -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 +88 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +161 -0
- package/gradle/libs.versions.toml +57 -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/Popup/PopupPromotion.swift +2 -2
- package/local.properties +8 -0
- package/package.json +1 -1
- package/settings.gradle.kts +52 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
package vn.momo.kits.navigation.bottomtab
|
|
2
|
+
|
|
3
|
+
import androidx.compose.animation.core.FastOutSlowInEasing
|
|
4
|
+
import androidx.compose.animation.core.animateDpAsState
|
|
5
|
+
import androidx.compose.animation.core.tween
|
|
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.Column
|
|
11
|
+
import androidx.compose.foundation.layout.Row
|
|
12
|
+
import androidx.compose.foundation.layout.RowScope
|
|
13
|
+
import androidx.compose.foundation.layout.Spacer
|
|
14
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
15
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
16
|
+
import androidx.compose.foundation.layout.height
|
|
17
|
+
import androidx.compose.foundation.layout.offset
|
|
18
|
+
import androidx.compose.foundation.layout.padding
|
|
19
|
+
import androidx.compose.foundation.layout.size
|
|
20
|
+
import androidx.compose.foundation.layout.width
|
|
21
|
+
import androidx.compose.foundation.shape.CircleShape
|
|
22
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
23
|
+
import androidx.compose.runtime.Composable
|
|
24
|
+
import androidx.compose.runtime.getValue
|
|
25
|
+
import androidx.compose.ui.Alignment
|
|
26
|
+
import androidx.compose.ui.Modifier
|
|
27
|
+
import androidx.compose.ui.draw.clip
|
|
28
|
+
import androidx.compose.ui.graphics.Brush
|
|
29
|
+
import androidx.compose.ui.graphics.Color
|
|
30
|
+
import androidx.compose.ui.text.style.TextAlign
|
|
31
|
+
import androidx.compose.ui.text.style.TextOverflow
|
|
32
|
+
import androidx.compose.ui.unit.dp
|
|
33
|
+
import androidx.navigation.NavController
|
|
34
|
+
import androidx.navigation.compose.currentBackStackEntryAsState
|
|
35
|
+
import vn.momo.kits.components.Badge
|
|
36
|
+
import vn.momo.kits.components.Icon
|
|
37
|
+
import vn.momo.kits.components.Text
|
|
38
|
+
import vn.momo.kits.const.AppTheme
|
|
39
|
+
import vn.momo.kits.const.Colors
|
|
40
|
+
import vn.momo.kits.const.Radius
|
|
41
|
+
import vn.momo.kits.const.Spacing
|
|
42
|
+
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
43
|
+
import vn.momo.kits.components.BadgeDot
|
|
44
|
+
import vn.momo.kits.components.DotSize
|
|
45
|
+
import vn.momo.kits.const.Typography
|
|
46
|
+
import vn.momo.kits.modifier.conditional
|
|
47
|
+
import vn.momo.kits.modifier.noFeedbackClickable
|
|
48
|
+
import vn.momo.kits.platform.getScreenDimensions
|
|
49
|
+
|
|
50
|
+
val floatingButtonWidth = 75.dp
|
|
51
|
+
const val BOTTOM_TAB_BAR_HEIGHT = 64
|
|
52
|
+
|
|
53
|
+
@Composable
|
|
54
|
+
fun BottomTabBar(
|
|
55
|
+
items: List<BottomTabItem>,
|
|
56
|
+
floatingButton: BottomTabFloatingButton? = null,
|
|
57
|
+
navController: NavController,
|
|
58
|
+
onTabSelected: (Int) -> Unit,
|
|
59
|
+
) {
|
|
60
|
+
val currentRoute = navController.currentBackStackEntryAsState().value?.destination?.route
|
|
61
|
+
val selectedIndex = items.indexOfFirst { "option${items.indexOf(it)}" == currentRoute }
|
|
62
|
+
|
|
63
|
+
val screenWidth = getScreenDimensions().width.dp
|
|
64
|
+
val mid = items.size / 2
|
|
65
|
+
|
|
66
|
+
val tabWidth = if (floatingButton != null) {
|
|
67
|
+
(screenWidth - floatingButtonWidth) / items.size
|
|
68
|
+
} else {
|
|
69
|
+
screenWidth / items.size
|
|
70
|
+
}
|
|
71
|
+
val adjustSize = if(floatingButton != null && selectedIndex >= mid) floatingButtonWidth else 0.dp
|
|
72
|
+
val targetOffset = tabWidth * selectedIndex + tabWidth / 2 - screenWidth / 2 + adjustSize
|
|
73
|
+
|
|
74
|
+
val indicatorOffsetX by animateDpAsState(
|
|
75
|
+
targetValue = targetOffset,
|
|
76
|
+
animationSpec = tween(durationMillis = 250, easing = FastOutSlowInEasing),
|
|
77
|
+
label = "IndicatorX"
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
Box(
|
|
81
|
+
contentAlignment = Alignment.BottomCenter
|
|
82
|
+
) {
|
|
83
|
+
Row(
|
|
84
|
+
modifier = Modifier
|
|
85
|
+
.fillMaxWidth()
|
|
86
|
+
.height(BOTTOM_TAB_BAR_HEIGHT.dp)
|
|
87
|
+
.background(AppTheme.current.colors.background.surface)
|
|
88
|
+
.conditional(IsShowBaseLineDebug) {
|
|
89
|
+
border(1.dp, Colors.blue_03)
|
|
90
|
+
},
|
|
91
|
+
horizontalArrangement = Arrangement.SpaceAround,
|
|
92
|
+
) {
|
|
93
|
+
if (floatingButton == null) {
|
|
94
|
+
renderTabBarItem(items, 0, items.size, selectedIndex, onTabSelected)
|
|
95
|
+
} else {
|
|
96
|
+
renderTabBarItem(items, 0, mid, selectedIndex, onTabSelected)
|
|
97
|
+
Spacer(modifier = Modifier.width(floatingButtonWidth).padding(horizontal = Spacing.XXS))
|
|
98
|
+
renderTabBarItem(items, mid, items.size, selectedIndex, onTabSelected)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
Box(modifier = Modifier
|
|
103
|
+
.offset(x = indicatorOffsetX, y = (-BOTTOM_TAB_BAR_HEIGHT + 2).dp)
|
|
104
|
+
.height(2.dp)
|
|
105
|
+
.width(44.dp)
|
|
106
|
+
.background(
|
|
107
|
+
color = AppTheme.current.colors.primary ,
|
|
108
|
+
shape = RoundedCornerShape(bottomStart = 2.dp, bottomEnd = 2.dp)
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
Box(modifier = Modifier
|
|
113
|
+
.fillMaxWidth()
|
|
114
|
+
.height(6.dp)
|
|
115
|
+
.offset(x = 0.dp, y = (-BOTTOM_TAB_BAR_HEIGHT).dp)
|
|
116
|
+
.background(
|
|
117
|
+
brush = Brush.verticalGradient(
|
|
118
|
+
colors = listOf(Color.Transparent, Color.Black.copy(alpha = 0.05f))
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
floatingButton?.let { FloatingButton(it) }
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@Composable
|
|
127
|
+
fun RowScope.renderTabBarItem(
|
|
128
|
+
items: List<BottomTabItem>,
|
|
129
|
+
fromIndex: Int,
|
|
130
|
+
toIndex: Int,
|
|
131
|
+
selectedIndex: Int,
|
|
132
|
+
onTabSelected: (Int) -> Unit
|
|
133
|
+
){
|
|
134
|
+
for (index in fromIndex until toIndex) {
|
|
135
|
+
Box(modifier = Modifier.weight(1f)) {
|
|
136
|
+
TabBarItem(
|
|
137
|
+
item = items[index],
|
|
138
|
+
selected = index == selectedIndex,
|
|
139
|
+
onClick = { onTabSelected(index) }
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@Composable
|
|
146
|
+
fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> Unit) {
|
|
147
|
+
fun isNumber(label: String): Boolean {
|
|
148
|
+
val numberRegex = "^\\d+$".toRegex()
|
|
149
|
+
return numberRegex.matches(label)
|
|
150
|
+
}
|
|
151
|
+
fun formatLabel(label: String): String? {
|
|
152
|
+
if (isNumber(label) && label.toInt() == 0) {
|
|
153
|
+
return null
|
|
154
|
+
}
|
|
155
|
+
return label
|
|
156
|
+
}
|
|
157
|
+
val badgeLabel = item.badgeLabel?.let { formatLabel(it) }
|
|
158
|
+
|
|
159
|
+
Box(modifier = Modifier
|
|
160
|
+
.fillMaxSize()
|
|
161
|
+
.padding(horizontal = Spacing.XXS)
|
|
162
|
+
.conditional(IsShowBaseLineDebug) {
|
|
163
|
+
border(1.dp, Colors.blue_03)
|
|
164
|
+
}
|
|
165
|
+
.noFeedbackClickable {
|
|
166
|
+
onClick()
|
|
167
|
+
},
|
|
168
|
+
contentAlignment = Alignment.BottomStart
|
|
169
|
+
){
|
|
170
|
+
Column(
|
|
171
|
+
modifier = Modifier
|
|
172
|
+
.fillMaxSize()
|
|
173
|
+
.padding(horizontal = Spacing.S, vertical = Spacing.S)
|
|
174
|
+
.noFeedbackClickable {
|
|
175
|
+
onClick()
|
|
176
|
+
},
|
|
177
|
+
horizontalAlignment = Alignment.CenterHorizontally,
|
|
178
|
+
verticalArrangement = Arrangement.Center
|
|
179
|
+
) {
|
|
180
|
+
Icon(
|
|
181
|
+
source = item.icon,
|
|
182
|
+
size = 28.dp,
|
|
183
|
+
modifier = Modifier.padding(Spacing.XS),
|
|
184
|
+
color = if (selected) AppTheme.current.colors.primary else AppTheme.current.colors.text.hint)
|
|
185
|
+
Text(
|
|
186
|
+
text = item.label,
|
|
187
|
+
color = if (selected) AppTheme.current.colors.primary else AppTheme.current.colors.text.hint,
|
|
188
|
+
style = if (selected) Typography.labelXsMedium else Typography.descriptionXsRegular,
|
|
189
|
+
maxLines = 1,
|
|
190
|
+
overflow = TextOverflow.Ellipsis
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
if (badgeLabel != null) {
|
|
194
|
+
if (badgeLabel.isEmpty())
|
|
195
|
+
BadgeDot(
|
|
196
|
+
size = DotSize.Small,
|
|
197
|
+
modifier = Modifier.offset(x = 50.dp, y = (-48).dp)
|
|
198
|
+
)
|
|
199
|
+
else
|
|
200
|
+
Badge(badgeLabel, modifier = Modifier.offset(x = 44.dp, y = (-42).dp))
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@Composable
|
|
206
|
+
fun FloatingButton(data: BottomTabFloatingButton) {
|
|
207
|
+
Column(
|
|
208
|
+
modifier = Modifier
|
|
209
|
+
.width(floatingButtonWidth)
|
|
210
|
+
.padding(horizontal = Spacing.XXS, vertical = Spacing.S)
|
|
211
|
+
.conditional(IsShowBaseLineDebug) {
|
|
212
|
+
border(1.dp, Colors.blue_03)
|
|
213
|
+
}
|
|
214
|
+
.noFeedbackClickable {
|
|
215
|
+
data.onPress()
|
|
216
|
+
},
|
|
217
|
+
verticalArrangement = Arrangement.Bottom,
|
|
218
|
+
horizontalAlignment = Alignment.CenterHorizontally
|
|
219
|
+
|
|
220
|
+
){
|
|
221
|
+
CurvedContainer()
|
|
222
|
+
Box(
|
|
223
|
+
modifier = Modifier
|
|
224
|
+
.size(48.dp)
|
|
225
|
+
.clip(CircleShape)
|
|
226
|
+
.background(AppTheme.current.colors.primary),
|
|
227
|
+
contentAlignment = Alignment.Center
|
|
228
|
+
) {
|
|
229
|
+
Icon(source = data.icon, color = Color.White, size = 28.dp)
|
|
230
|
+
}
|
|
231
|
+
Spacer(modifier = Modifier.height(4.dp))
|
|
232
|
+
Text(
|
|
233
|
+
text = data.label,
|
|
234
|
+
style = Typography.labelXsMedium,
|
|
235
|
+
color = Colors.black_01,
|
|
236
|
+
textAlign = TextAlign.Center,
|
|
237
|
+
modifier = Modifier
|
|
238
|
+
.height(14.dp)
|
|
239
|
+
.fillMaxWidth()
|
|
240
|
+
.background(AppTheme.current.colors.primary, shape = RoundedCornerShape(size = Radius.XL))
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
package vn.momo.kits.navigation.bottomtab
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.Canvas
|
|
4
|
+
import androidx.compose.foundation.layout.Box
|
|
5
|
+
import androidx.compose.foundation.layout.height
|
|
6
|
+
import androidx.compose.foundation.layout.offset
|
|
7
|
+
import androidx.compose.foundation.layout.width
|
|
8
|
+
import androidx.compose.runtime.Composable
|
|
9
|
+
import androidx.compose.ui.Alignment
|
|
10
|
+
import androidx.compose.ui.Modifier
|
|
11
|
+
import androidx.compose.ui.graphics.Path
|
|
12
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
13
|
+
import androidx.compose.ui.unit.Dp
|
|
14
|
+
import androidx.compose.ui.unit.IntOffset
|
|
15
|
+
import androidx.compose.ui.unit.dp
|
|
16
|
+
import androidx.compose.ui.zIndex
|
|
17
|
+
import vn.momo.kits.const.AppTheme
|
|
18
|
+
|
|
19
|
+
@Composable
|
|
20
|
+
fun CurvedContainer(
|
|
21
|
+
circleSize: Dp = 48.dp,
|
|
22
|
+
tabBarItemIconSize: Dp = 28.dp,
|
|
23
|
+
circleOverSize: Dp = 2.dp,
|
|
24
|
+
width: Dp = 71.dp,
|
|
25
|
+
height: Dp = 16.dp
|
|
26
|
+
) {
|
|
27
|
+
val theme = AppTheme.current
|
|
28
|
+
val density = LocalDensity.current
|
|
29
|
+
val widthPx = with(density) { width.toPx()}
|
|
30
|
+
|
|
31
|
+
val circleSizePx = with(density) { circleSize.toPx() }
|
|
32
|
+
val tabBarItemIconSizePx = with(density) { tabBarItemIconSize.toPx() }
|
|
33
|
+
val circleOverSizePx = with(density) { circleOverSize.toPx() }
|
|
34
|
+
|
|
35
|
+
val circlePositionTop = circleSizePx - tabBarItemIconSizePx - 10f
|
|
36
|
+
val circleOverTop = circlePositionTop + circleOverSizePx
|
|
37
|
+
val circleR = circleSizePx / 2
|
|
38
|
+
val circleOverR = circleR + circleOverSizePx
|
|
39
|
+
|
|
40
|
+
val centerX = widthPx / 2
|
|
41
|
+
|
|
42
|
+
val curvedPath = getPath(
|
|
43
|
+
circleOverTop = circleOverTop,
|
|
44
|
+
centerX = centerX,
|
|
45
|
+
circleOverR = circleOverR,
|
|
46
|
+
widthPx = widthPx
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
Box(
|
|
50
|
+
contentAlignment = Alignment.BottomCenter
|
|
51
|
+
){
|
|
52
|
+
Canvas(
|
|
53
|
+
modifier = Modifier
|
|
54
|
+
.width(width)
|
|
55
|
+
.height(height)
|
|
56
|
+
.offset{ IntOffset(x = 0, y = 24) }
|
|
57
|
+
.zIndex(-1f)
|
|
58
|
+
) {
|
|
59
|
+
drawPath(path = curvedPath, color = theme.colors.background.surface)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private fun getPath(circleOverTop: Float, centerX: Float, circleOverR: Float, widthPx: Float): Path{
|
|
65
|
+
return Path().apply {
|
|
66
|
+
moveTo(0f, circleOverTop)
|
|
67
|
+
lineTo(centerX - circleOverR - 40f, circleOverTop)
|
|
68
|
+
|
|
69
|
+
cubicTo(
|
|
70
|
+
centerX - circleOverR, circleOverTop,
|
|
71
|
+
centerX - circleOverR, 0f,
|
|
72
|
+
centerX, 0f
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
cubicTo(
|
|
76
|
+
centerX + circleOverR, 0f,
|
|
77
|
+
centerX + circleOverR, circleOverTop,
|
|
78
|
+
centerX + circleOverR + 40f, circleOverTop
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
lineTo(widthPx, circleOverTop)
|
|
82
|
+
lineTo(widthPx, 60f)
|
|
83
|
+
lineTo(0f, 60f)
|
|
84
|
+
close()
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
package vn.momo.kits.navigation.component
|
|
2
|
+
|
|
3
|
+
import androidx.compose.animation.AnimatedVisibility
|
|
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.animation.expandHorizontally
|
|
9
|
+
import androidx.compose.animation.fadeIn
|
|
10
|
+
import androidx.compose.animation.fadeOut
|
|
11
|
+
import androidx.compose.animation.shrinkHorizontally
|
|
12
|
+
import androidx.compose.foundation.ScrollState
|
|
13
|
+
import androidx.compose.foundation.background
|
|
14
|
+
import androidx.compose.foundation.border
|
|
15
|
+
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
16
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
17
|
+
import androidx.compose.foundation.layout.Box
|
|
18
|
+
import androidx.compose.foundation.layout.Row
|
|
19
|
+
import androidx.compose.foundation.layout.Spacer
|
|
20
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
21
|
+
import androidx.compose.foundation.layout.height
|
|
22
|
+
import androidx.compose.foundation.layout.offset
|
|
23
|
+
import androidx.compose.foundation.layout.padding
|
|
24
|
+
import androidx.compose.foundation.layout.sizeIn
|
|
25
|
+
import androidx.compose.foundation.layout.width
|
|
26
|
+
import androidx.compose.material3.AlertDialogDefaults
|
|
27
|
+
import androidx.compose.material3.FloatingActionButton
|
|
28
|
+
import androidx.compose.material3.FloatingActionButtonDefaults
|
|
29
|
+
import androidx.compose.material3.FloatingActionButtonElevation
|
|
30
|
+
import androidx.compose.runtime.Composable
|
|
31
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
32
|
+
import androidx.compose.runtime.getValue
|
|
33
|
+
import androidx.compose.runtime.mutableStateOf
|
|
34
|
+
import androidx.compose.runtime.remember
|
|
35
|
+
import androidx.compose.runtime.rememberCoroutineScope
|
|
36
|
+
import androidx.compose.runtime.saveable.rememberSaveable
|
|
37
|
+
import androidx.compose.runtime.setValue
|
|
38
|
+
import androidx.compose.ui.Alignment
|
|
39
|
+
import androidx.compose.ui.Modifier
|
|
40
|
+
import androidx.compose.ui.graphics.Color
|
|
41
|
+
import androidx.compose.ui.unit.Dp
|
|
42
|
+
import androidx.compose.ui.unit.dp
|
|
43
|
+
import kotlinx.coroutines.delay
|
|
44
|
+
import kotlinx.coroutines.flow.MutableStateFlow
|
|
45
|
+
import kotlinx.coroutines.flow.collectLatest
|
|
46
|
+
import kotlinx.coroutines.launch
|
|
47
|
+
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
48
|
+
import vn.momo.kits.components.Icon
|
|
49
|
+
import vn.momo.kits.components.Text
|
|
50
|
+
import vn.momo.kits.const.Colors
|
|
51
|
+
import vn.momo.kits.const.Typography
|
|
52
|
+
import vn.momo.kits.modifier.conditional
|
|
53
|
+
|
|
54
|
+
enum class FABSize { SMALL, DEFAULT }
|
|
55
|
+
enum class FABPosition { END, CENTER }
|
|
56
|
+
|
|
57
|
+
data class FloatingButtonProps(
|
|
58
|
+
val icon: String,
|
|
59
|
+
val iconColor: Color? = null,
|
|
60
|
+
val label: String? = null,
|
|
61
|
+
val onClick: () -> Unit,
|
|
62
|
+
val size: FABSize = FABSize.DEFAULT,
|
|
63
|
+
val bottom: Dp? = null,
|
|
64
|
+
val scrollState: ScrollState? = null,
|
|
65
|
+
val position: FABPosition? = FABPosition.END,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
private val FabSmallSize = 36.dp
|
|
69
|
+
private val FabDefaultSize = 48.dp
|
|
70
|
+
private val FabExpandedWidth = 80.dp
|
|
71
|
+
private val FabIconSizeSmall = 12.dp
|
|
72
|
+
private val FabIconSizeDefault = 24.dp
|
|
73
|
+
private val FabPaddingHorizontal = 12.dp
|
|
74
|
+
|
|
75
|
+
@Composable
|
|
76
|
+
fun FloatingButton(
|
|
77
|
+
scrollPosition: Int,
|
|
78
|
+
bottom: Dp,
|
|
79
|
+
onClick: () -> Unit,
|
|
80
|
+
containerColor: Color,
|
|
81
|
+
contentColor: Color = containerColor,
|
|
82
|
+
icon: String,
|
|
83
|
+
iconColor: Color? = null,
|
|
84
|
+
text: String? = null,
|
|
85
|
+
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(4.dp),
|
|
86
|
+
size: FABSize = FABSize.DEFAULT,
|
|
87
|
+
position: FABPosition = FABPosition.END,
|
|
88
|
+
keyboardSize: Dp = 0.dp,
|
|
89
|
+
) {
|
|
90
|
+
val scrollStateFlow = remember { MutableStateFlow(scrollPosition) }
|
|
91
|
+
var lastScrollPosition by rememberSaveable { mutableStateOf(0) }
|
|
92
|
+
var isExpanded by rememberSaveable { mutableStateOf(false) }
|
|
93
|
+
|
|
94
|
+
val coroutineScope = rememberCoroutineScope()
|
|
95
|
+
|
|
96
|
+
// Animations
|
|
97
|
+
val baseSize = if (size == FABSize.SMALL) FabSmallSize else FabDefaultSize
|
|
98
|
+
val width by animateDpAsState(
|
|
99
|
+
targetValue = if (isExpanded && text != null) FabExpandedWidth else baseSize,
|
|
100
|
+
animationSpec = tween(100, easing = CubicBezierEasing(0.2f, 0.2f, 0.2f, 0.2f))
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
// Scroll listener
|
|
104
|
+
LaunchedEffect(text) {
|
|
105
|
+
if (text != null) {
|
|
106
|
+
coroutineScope.launch {
|
|
107
|
+
scrollStateFlow.collectLatest { newScroll ->
|
|
108
|
+
isExpanded = newScroll <= lastScrollPosition
|
|
109
|
+
delay(100)
|
|
110
|
+
lastScrollPosition = newScroll
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
LaunchedEffect(scrollPosition) {
|
|
117
|
+
scrollStateFlow.value = scrollPosition
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
Box(
|
|
121
|
+
modifier = Modifier
|
|
122
|
+
.fillMaxSize()
|
|
123
|
+
.padding(end = 12.dp, bottom = bottom)
|
|
124
|
+
.offset(y = -keyboardSize)
|
|
125
|
+
.background(Color.Transparent),
|
|
126
|
+
contentAlignment = if (position == FABPosition.END) Alignment.BottomEnd else Alignment.BottomCenter,
|
|
127
|
+
) {
|
|
128
|
+
FloatingActionButton(
|
|
129
|
+
onClick = onClick,
|
|
130
|
+
shape = AlertDialogDefaults.shape,
|
|
131
|
+
containerColor = containerColor,
|
|
132
|
+
contentColor = contentColor,
|
|
133
|
+
elevation = elevation,
|
|
134
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
135
|
+
modifier = Modifier
|
|
136
|
+
.sizeIn(minWidth = width)
|
|
137
|
+
.height(baseSize)
|
|
138
|
+
.conditional(IsShowBaseLineDebug) {
|
|
139
|
+
border(1.dp, Colors.blue_03)
|
|
140
|
+
}
|
|
141
|
+
) {
|
|
142
|
+
Row(
|
|
143
|
+
modifier = Modifier.padding(
|
|
144
|
+
start = if (isExpanded) FabPaddingHorizontal else 0.dp,
|
|
145
|
+
end = if (isExpanded) FabPaddingHorizontal else 0.dp,
|
|
146
|
+
),
|
|
147
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
148
|
+
horizontalArrangement = if (isExpanded) Arrangement.Start else Arrangement.Center
|
|
149
|
+
) {
|
|
150
|
+
Icon(
|
|
151
|
+
source = icon,
|
|
152
|
+
size = if (size == FABSize.SMALL) FabIconSizeSmall else FabIconSizeDefault,
|
|
153
|
+
color = iconColor ?: Color.White
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
AnimatedVisibility(
|
|
157
|
+
visible = isExpanded,
|
|
158
|
+
enter = fadeInExpandAnimation,
|
|
159
|
+
exit = fadeOutShrinkAnimation,
|
|
160
|
+
) {
|
|
161
|
+
Row {
|
|
162
|
+
Spacer(Modifier.width(12.dp))
|
|
163
|
+
Text(
|
|
164
|
+
text = text ?: "",
|
|
165
|
+
color = Color.White,
|
|
166
|
+
style = Typography.actionDefaultBold
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private val fadeOutShrinkAnimation = fadeOut(
|
|
176
|
+
animationSpec = tween(100, easing = LinearEasing)
|
|
177
|
+
) + shrinkHorizontally(
|
|
178
|
+
animationSpec = tween(100, easing = LinearEasing),
|
|
179
|
+
shrinkTowards = Alignment.Start
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
private val fadeInExpandAnimation = fadeIn(
|
|
183
|
+
animationSpec = tween(100, easing = LinearEasing)
|
|
184
|
+
) + expandHorizontally(
|
|
185
|
+
animationSpec = tween(100, easing = LinearEasing),
|
|
186
|
+
expandFrom = Alignment.Start
|
|
187
|
+
)
|