@momo-kits/native-kits 0.163.1-beta.9-debug → 0.163.1-sp.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 +75 -0
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +1 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +19 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +5 -18
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +3 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +1 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -1
- package/gradle.properties +1 -1
- package/ios/Application/Localize.swift +32 -0
- package/ios/Application/Navigation/NavigationContainer.swift +3 -0
- package/ios/Popup/PopupDisplay.swift +1 -1
- package/ios/Popup/PopupNotify.swift +1 -1
- package/ios/Popup/PopupPromotion.swift +5 -11
- package/ios/Template/TrustBanner/TrustBanner.swift +2 -2
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/local.properties +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
|
|
5
|
+
"Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/maven-metadata.xml\")",
|
|
6
|
+
"Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/maven-metadata.xml\")",
|
|
7
|
+
"Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/0.144.6/skiko-0.144.6.module\")",
|
|
8
|
+
"Bash(curl -s -o /dev/null -w '%{http_code}' https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.__TRACKED_VAR__)",
|
|
9
|
+
"Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/\")",
|
|
10
|
+
"Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/\")",
|
|
11
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.148.1/skiko-android-0.148.1.pom\")",
|
|
12
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.5/skiko-android-0.144.5.pom\")",
|
|
13
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://dl.google.com/dl/android/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
|
|
14
|
+
"Bash(curl -s \"https://search.maven.org/solrsearch/select?q=a:skiko-android&rows=5&wt=json\")",
|
|
15
|
+
"Bash(curl -sL -o /dev/null -w \"%{http_code} %{url_effective}\\\\n\" \"https://repo1.maven.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
|
|
16
|
+
"Bash(curl *)",
|
|
17
|
+
"Bash(./gradlew :sample:androidApp:dependencies --configuration debugRuntimeClasspath)",
|
|
18
|
+
"Bash(./gradlew :sample:shared:compileDebugKotlinAndroid)",
|
|
19
|
+
"Bash(./gradlew :sample:androidApp:compileDebugKotlin)",
|
|
20
|
+
"Bash(ls -d *.xcodeproj)",
|
|
21
|
+
"Bash(grep -c ChipDemo.swift __TRACKED_VAR__/project.pbxproj)",
|
|
22
|
+
"Bash(grep -c PBXFileSystemSynchronizedRootGroup __TRACKED_VAR__/project.pbxproj)",
|
|
23
|
+
"Bash(grep -c InformationDemo.swift __TRACKED_VAR__/project.pbxproj)",
|
|
24
|
+
"Bash(plutil -lint project.pbxproj)",
|
|
25
|
+
"Bash(xcode-select -p)",
|
|
26
|
+
"Bash(/usr/bin/xcrun xcodebuild *)",
|
|
27
|
+
"Bash(echo \"exit: $?\")",
|
|
28
|
+
"Bash(/Applications/Xcode26.app/Contents/Developer/usr/bin/xcodebuild -version)",
|
|
29
|
+
"Bash(./gradlew :compose:tasks --all)",
|
|
30
|
+
"Bash(grep -n \"vanniktech\\\\|mavenPublishing\\\\|^publishing\\\\|version = gitlabVersion\\\\|namespace =\\\\|compileSdk =\\\\|minSdk =\\\\|GitLabPackages\\\\|name = \\\\\"\\\\${gitlabRepo}Packages\\\\\"\")",
|
|
31
|
+
"Bash(git checkout *)",
|
|
32
|
+
"Bash(./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository --dry-run)",
|
|
33
|
+
"Bash(git fetch *)",
|
|
34
|
+
"Bash(git pull *)",
|
|
35
|
+
"Bash(git push *)",
|
|
36
|
+
"Bash(git branch *)",
|
|
37
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -list)",
|
|
38
|
+
"Bash(xcrun simctl *)",
|
|
39
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
|
|
40
|
+
"Bash(pod install *)",
|
|
41
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'id=1E6F9A79-5E64-4590-BEA2-828D75D99393' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
|
|
42
|
+
"Bash(xcrun swiftc *)",
|
|
43
|
+
"Bash(echo \"=== exit: $? \\(1=none found\\) ===\")",
|
|
44
|
+
"Bash(cat Radius.swift)",
|
|
45
|
+
"Bash(cat Spacing.swift)",
|
|
46
|
+
"Bash(echo \"exit=$?\")",
|
|
47
|
+
"Bash(ruby *)",
|
|
48
|
+
"Bash(xcodebuild -list -workspace iosApp.xcworkspace)",
|
|
49
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' build)",
|
|
50
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
|
|
51
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
|
|
52
|
+
"Bash(xcodebuild build *)",
|
|
53
|
+
"Bash(git stash *)",
|
|
54
|
+
"Bash(plutil -lint sample/iosApp/iosApp.xcodeproj/project.pbxproj)",
|
|
55
|
+
"Bash(git add *)",
|
|
56
|
+
"Bash(git commit -m 'feat: DS-646 [ci build] *)",
|
|
57
|
+
"Bash(git commit -q -m 'fix: DS-656 [ci build] *)",
|
|
58
|
+
"Bash(xargs git log --oneline -1)",
|
|
59
|
+
"Bash(git rev-list *)",
|
|
60
|
+
"Bash(git status *)",
|
|
61
|
+
"Bash(git rebase *)",
|
|
62
|
+
"Bash(git merge *)",
|
|
63
|
+
"Bash(git reset *)",
|
|
64
|
+
"Bash(awk '/^ *)",
|
|
65
|
+
"Bash(git ls-tree *)",
|
|
66
|
+
"Bash(awk *)",
|
|
67
|
+
"Read(//Users/sophia/Workspace/momo/momo-app/**)",
|
|
68
|
+
"Bash(git log *)",
|
|
69
|
+
"Bash(xcodebuild -version)",
|
|
70
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
|
|
71
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
|
|
72
|
+
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug clean build CODE_SIGNING_ALLOWED=NO)"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
}
|
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -209,7 +209,6 @@ internal class CupertinoOverscrollEffect(
|
|
|
209
209
|
private fun availableDelta(delta: Offset, source: CupertinoScrollSource): Offset {
|
|
210
210
|
val (x, overscrollX) = availableDelta(delta.x, overscrollOffset.x, source)
|
|
211
211
|
val (y, overscrollY) = availableDelta(delta.y, overscrollOffset.y, source)
|
|
212
|
-
println("availableDelta delta=${delta.y} consumed y=$y overscrollY=$overscrollY source=${source}")
|
|
213
212
|
overscrollOffset = Offset(overscrollX, overscrollY)
|
|
214
213
|
|
|
215
214
|
return Offset(x, y)
|
|
@@ -147,6 +147,17 @@ object Colors {
|
|
|
147
147
|
val red_10 = Color(0xFFFEF4F4)
|
|
148
148
|
val red_11 = Color(0xFFFEF8F8)
|
|
149
149
|
|
|
150
|
+
// Translucent overlays, ported from the React kit's Consts (the reference
|
|
151
|
+
// palette). React spells them `#RRGGBBAA`; Compose's Color takes `0xAARRGGBB`.
|
|
152
|
+
val opacity_black_20 = Color(0x33000000)
|
|
153
|
+
val opacity_black_40 = Color(0x66000000)
|
|
154
|
+
val opacity_black_60 = Color(0x99000000)
|
|
155
|
+
val opacity_black_80 = Color(0xCC000000)
|
|
156
|
+
val opacity_white_20 = Color(0x33FFFFFF)
|
|
157
|
+
val opacity_white_40 = Color(0x66FFFFFF)
|
|
158
|
+
val opacity_white_60 = Color(0x99FFFFFF)
|
|
159
|
+
val opacity_white_80 = Color(0xCCFFFFFF)
|
|
160
|
+
|
|
150
161
|
val colorList: Map<String, Color> = mapOf(
|
|
151
162
|
"black_01" to black_01,
|
|
152
163
|
"black_02" to black_02,
|
|
@@ -302,5 +313,13 @@ object Colors {
|
|
|
302
313
|
"red_09" to red_09,
|
|
303
314
|
"red_10" to red_10,
|
|
304
315
|
"red_11" to red_11,
|
|
316
|
+
"opacity_black_20" to opacity_black_20,
|
|
317
|
+
"opacity_black_40" to opacity_black_40,
|
|
318
|
+
"opacity_black_60" to opacity_black_60,
|
|
319
|
+
"opacity_black_80" to opacity_black_80,
|
|
320
|
+
"opacity_white_20" to opacity_white_20,
|
|
321
|
+
"opacity_white_40" to opacity_white_40,
|
|
322
|
+
"opacity_white_60" to opacity_white_60,
|
|
323
|
+
"opacity_white_80" to opacity_white_80,
|
|
305
324
|
)
|
|
306
325
|
}
|
|
@@ -4,8 +4,8 @@ import androidx.compose.foundation.background
|
|
|
4
4
|
import androidx.compose.foundation.layout.Arrangement
|
|
5
5
|
import androidx.compose.foundation.layout.Box
|
|
6
6
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
7
|
-
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
|
8
7
|
import androidx.compose.foundation.layout.FlowRow
|
|
8
|
+
import androidx.compose.foundation.layout.PaddingValues
|
|
9
9
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
10
10
|
import androidx.compose.foundation.layout.padding
|
|
11
11
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
@@ -18,18 +18,13 @@ import androidx.compose.ui.unit.dp
|
|
|
18
18
|
import vn.momo.kits.components.Image
|
|
19
19
|
import vn.momo.kits.const.AppTheme
|
|
20
20
|
import vn.momo.kits.const.Radius
|
|
21
|
+
import vn.momo.kits.const.Spacing
|
|
21
22
|
|
|
22
|
-
/**
|
|
23
|
-
* A white rounded surface card that lays its [Item]s on a 12-column grid
|
|
24
|
-
* (React kit foundations/Layout/Card). 8dp gutter, 12dp padding, 12dp
|
|
25
|
-
* horizontal margin, Radius.M corners, background = theme surface, optional
|
|
26
|
-
* shadow or [backgroundImage]. Items flow left-to-right and wrap.
|
|
27
|
-
*/
|
|
28
|
-
@OptIn(ExperimentalLayoutApi::class)
|
|
29
23
|
@Composable
|
|
30
|
-
fun Card(
|
|
24
|
+
internal fun Card(
|
|
31
25
|
useShadow: Boolean = false,
|
|
32
26
|
backgroundImage: String? = null,
|
|
27
|
+
contentPadding: PaddingValues = PaddingValues(Spacing.M),
|
|
33
28
|
modifier: Modifier = Modifier,
|
|
34
29
|
content: @Composable () -> Unit,
|
|
35
30
|
) {
|
|
@@ -39,20 +34,12 @@ fun Card(
|
|
|
39
34
|
var surface = modifier.fillMaxWidth().padding(horizontal = 12.dp)
|
|
40
35
|
if (useShadow) surface = surface.shadow(4.dp, shape)
|
|
41
36
|
surface = surface.clip(shape)
|
|
42
|
-
// The React kit drops the surface colour when a backgroundImage is supplied
|
|
43
|
-
// (`!!backgroundImage && { backgroundColor: undefined }`).
|
|
44
37
|
if (backgroundImage == null) surface = surface.background(AppTheme.current.colors.background.surface)
|
|
45
38
|
Box(modifier = surface) {
|
|
46
|
-
// React renders this as an absolutely-filled child BEHIND the content
|
|
47
|
-
// (styles.imageBackground: position absolute, inset 0) — matchParentSize
|
|
48
|
-
// fills the card without contributing to its measured size.
|
|
49
39
|
if (backgroundImage != null) {
|
|
50
40
|
Image(source = backgroundImage, modifier = Modifier.matchParentSize())
|
|
51
41
|
}
|
|
52
|
-
BoxWithConstraints(modifier = Modifier.fillMaxWidth().padding(
|
|
53
|
-
// `- 1.dp / columns` mirrors the React kit's `- 1 / numberOfColumns`
|
|
54
|
-
// nudge: it keeps a full 12-span Item ~1dp narrower than the content
|
|
55
|
-
// box so sub-pixel rounding can never overflow and wrap the FlowRow.
|
|
42
|
+
BoxWithConstraints(modifier = Modifier.fillMaxWidth().padding(contentPadding)) {
|
|
56
43
|
val sizePerSpan = (maxWidth - gutter * (columns - 1)) / columns - 1.dp / columns
|
|
57
44
|
CompositionLocalProvider(LocalGridContext provides GridContext(columns, gutter, sizePerSpan)) {
|
|
58
45
|
FlowRow(
|
|
@@ -9,30 +9,18 @@ import androidx.compose.ui.Modifier
|
|
|
9
9
|
import androidx.compose.ui.unit.Dp
|
|
10
10
|
import androidx.compose.ui.unit.dp
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
* Grid context supplied by [Section] / [Card]: the per-span cell size + gutter,
|
|
14
|
-
* so an [Item] can resolve its pixel width from a 1-12 `widthSpan`. Mirrors the
|
|
15
|
-
* React kit's GridContext (foundations/Layout/GridSystem).
|
|
16
|
-
*/
|
|
17
|
-
data class GridContext(
|
|
12
|
+
internal data class GridContext(
|
|
18
13
|
val numberOfColumns: Int = 12,
|
|
19
14
|
val gutter: Dp = 12.dp,
|
|
20
15
|
val sizePerSpan: Dp = 0.dp,
|
|
21
16
|
) {
|
|
22
|
-
/** Width covering `span` columns + the (span-1) gutters between them. */
|
|
23
17
|
fun sizeForSpan(span: Int): Dp = sizePerSpan * span + gutter * (span - 1)
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
val LocalGridContext = compositionLocalOf<GridContext?> { null }
|
|
20
|
+
internal val LocalGridContext = compositionLocalOf<GridContext?> { null }
|
|
28
21
|
|
|
29
|
-
/**
|
|
30
|
-
* A grid cell. `widthSpan` (1-12) sets the width as a fraction of the parent
|
|
31
|
-
* Section/Card; the parent's flex-wrap flows the cells into rows. Rendered
|
|
32
|
-
* outside a grid it just wraps its content at its natural size.
|
|
33
|
-
*/
|
|
34
22
|
@Composable
|
|
35
|
-
fun Item(
|
|
23
|
+
internal fun Item(
|
|
36
24
|
widthSpan: Int = 12,
|
|
37
25
|
heightSpan: Int = 0,
|
|
38
26
|
modifier: Modifier = Modifier,
|
|
@@ -3,7 +3,6 @@ package vn.momo.kits.layout
|
|
|
3
3
|
import androidx.compose.foundation.layout.Arrangement
|
|
4
4
|
import androidx.compose.foundation.layout.Box
|
|
5
5
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
6
|
-
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
|
7
6
|
import androidx.compose.foundation.layout.FlowRow
|
|
8
7
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
9
8
|
import androidx.compose.foundation.layout.padding
|
|
@@ -13,14 +12,8 @@ import androidx.compose.ui.Modifier
|
|
|
13
12
|
import androidx.compose.ui.unit.dp
|
|
14
13
|
import vn.momo.kits.components.Image
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* A transparent 12-column grid row that wraps its [Item]s (React kit
|
|
18
|
-
* foundations/Layout/Section). 12dp gutter; 12dp horizontal margin when
|
|
19
|
-
* `useMargin`; optional [backgroundImage]. Items flow left-to-right and wrap.
|
|
20
|
-
*/
|
|
21
|
-
@OptIn(ExperimentalLayoutApi::class)
|
|
22
15
|
@Composable
|
|
23
|
-
fun Section(
|
|
16
|
+
internal fun Section(
|
|
24
17
|
useMargin: Boolean = true,
|
|
25
18
|
backgroundImage: String? = null,
|
|
26
19
|
modifier: Modifier = Modifier,
|
|
@@ -30,15 +23,10 @@ fun Section(
|
|
|
30
23
|
val gutter = 12.dp
|
|
31
24
|
val margin = if (useMargin) 12.dp else 0.dp
|
|
32
25
|
Box(modifier = modifier.fillMaxWidth().padding(horizontal = margin)) {
|
|
33
|
-
// React renders this as an absolutely-filled child behind the content
|
|
34
|
-
// (styles.imageBackground: position absolute, inset 0).
|
|
35
26
|
if (backgroundImage != null) {
|
|
36
27
|
Image(source = backgroundImage, modifier = Modifier.matchParentSize())
|
|
37
28
|
}
|
|
38
29
|
BoxWithConstraints(modifier = Modifier.fillMaxWidth()) {
|
|
39
|
-
// `- 1.dp / columns` mirrors the React kit's `- 1 / numberOfColumns`
|
|
40
|
-
// nudge — keeps a full 12-span Item ~1dp inside the content box so
|
|
41
|
-
// sub-pixel rounding can never overflow and wrap the FlowRow.
|
|
42
30
|
val sizePerSpan = (maxWidth - gutter * (columns - 1)) / columns - 1.dp / columns
|
|
43
31
|
CompositionLocalProvider(LocalGridContext provides GridContext(columns, gutter, sizePerSpan)) {
|
|
44
32
|
FlowRow(
|
|
@@ -43,6 +43,7 @@ import vn.momo.kits.const.Radius
|
|
|
43
43
|
import vn.momo.kits.const.Spacing
|
|
44
44
|
import vn.momo.kits.application.LocalContext
|
|
45
45
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
46
|
+
import vn.momo.kits.const.AppNavigationBar
|
|
46
47
|
import vn.momo.kits.const.Typography
|
|
47
48
|
import vn.momo.kits.navigation.tracking.ScreenTracker
|
|
48
49
|
import vn.momo.kits.modifier.conditional
|
|
@@ -58,8 +59,6 @@ internal fun BottomSheet(
|
|
|
58
59
|
barrierDismissible: Boolean = true,
|
|
59
60
|
onDismiss: (() -> Unit)?
|
|
60
61
|
) {
|
|
61
|
-
val navigator = LocalNavigator.current
|
|
62
|
-
|
|
63
62
|
val screenHeightDp = getScreenHeight()
|
|
64
63
|
val screenHeightPx = with(LocalDensity.current) { screenHeightDp.toPx() }
|
|
65
64
|
val sheetOffset = remember { Animatable(screenHeightPx) }
|
|
@@ -162,7 +161,7 @@ internal fun BottomSheet(
|
|
|
162
161
|
.noFeedbackClickable { },
|
|
163
162
|
contentAlignment = Alignment.BottomCenter
|
|
164
163
|
) {
|
|
165
|
-
Column {
|
|
164
|
+
Column(Modifier.padding(bottom = AppNavigationBar.current)) {
|
|
166
165
|
Box(
|
|
167
166
|
modifier = Modifier
|
|
168
167
|
.height(72.dp)
|
|
@@ -280,7 +280,7 @@ internal fun ColumnScope.MainContent(content: @Composable () -> Unit, isBottomTa
|
|
|
280
280
|
bottom = when {
|
|
281
281
|
options.hasFooter() || isBottomTabRoot -> 0.dp
|
|
282
282
|
isBottomTabChild -> bottomTabBarInset() + (navigationBar - keyboardSizeState().value).coerceAtLeast(0.dp)
|
|
283
|
-
!options.scrollData.scrollable -> 0.dp
|
|
283
|
+
!options.scrollData.scrollable && options.scrollData.scrollState == null -> 0.dp
|
|
284
284
|
else -> navigationBar
|
|
285
285
|
}
|
|
286
286
|
)
|
|
@@ -31,7 +31,6 @@ object ScreenTracker {
|
|
|
31
31
|
val previousScreen = lastScreenName
|
|
32
32
|
lastScreenName = screenName
|
|
33
33
|
|
|
34
|
-
println("Tracking screen navigated native kit: $screenName")
|
|
35
34
|
maxApi?.track(
|
|
36
35
|
eventName = "auto_screen_navigated",
|
|
37
36
|
params = buildBaseParams(context, screenName).apply {
|
package/gradle.properties
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
//
|
|
12
12
|
|
|
13
13
|
import Foundation
|
|
14
|
+
import SwiftUI
|
|
14
15
|
|
|
15
16
|
/// Translation dictionary keyed by language; both `vi` and `en` are required.
|
|
16
17
|
public struct LocalizationObject {
|
|
@@ -275,3 +276,34 @@ public final class Localize: ObservableObject {
|
|
|
275
276
|
]
|
|
276
277
|
)
|
|
277
278
|
}
|
|
279
|
+
|
|
280
|
+
/// Snapshots `currentLanguage` alongside the instance so SwiftUI sees an environment
|
|
281
|
+
/// *change* on `changeLanguage`: the `Localize` reference alone never changes, and
|
|
282
|
+
/// `@Environment` does not subscribe to `@Published` the way `@EnvironmentObject` does.
|
|
283
|
+
private struct LocalizeBox: Equatable {
|
|
284
|
+
let localize: Localize
|
|
285
|
+
let language: String
|
|
286
|
+
|
|
287
|
+
init(_ localize: Localize) {
|
|
288
|
+
self.localize = localize
|
|
289
|
+
self.language = localize.currentLanguage
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
static func == (lhs: LocalizeBox, rhs: LocalizeBox) -> Bool {
|
|
293
|
+
lhs.localize === rhs.localize && lhs.language == rhs.language
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
private struct LocalizeKey: EnvironmentKey {
|
|
298
|
+
/// A default-constructed `Localize` already carries the full kit dictionary, so a
|
|
299
|
+
/// consumer that never injects one renders untranslated-but-correct text instead of
|
|
300
|
+
/// trapping the way `@EnvironmentObject` does.
|
|
301
|
+
static let defaultValue = LocalizeBox(Localize())
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
public extension EnvironmentValues {
|
|
305
|
+
var localize: Localize {
|
|
306
|
+
get { self[LocalizeKey.self].localize }
|
|
307
|
+
set { self[LocalizeKey.self] = LocalizeBox(newValue) }
|
|
308
|
+
}
|
|
309
|
+
}
|
|
@@ -63,12 +63,14 @@ public struct NavigationContainer<Initial: View>: View {
|
|
|
63
63
|
.environmentObject(applicationEnvironment)
|
|
64
64
|
.environment(\.applicationEnvironment, applicationEnvironment)
|
|
65
65
|
.environmentObject(localize)
|
|
66
|
+
.environment(\.localize, localize)
|
|
66
67
|
.fullScreenCover(item: $navigator.presented) { route in
|
|
67
68
|
screenView(forDialog: route)
|
|
68
69
|
.environmentObject(navigator)
|
|
69
70
|
.environmentObject(applicationEnvironment)
|
|
70
71
|
.environment(\.applicationEnvironment, applicationEnvironment)
|
|
71
72
|
.environmentObject(localize)
|
|
73
|
+
.environment(\.localize, localize)
|
|
72
74
|
}
|
|
73
75
|
.overlay {
|
|
74
76
|
if let item = navigator.overplay {
|
|
@@ -77,6 +79,7 @@ public struct NavigationContainer<Initial: View>: View {
|
|
|
77
79
|
.environmentObject(applicationEnvironment)
|
|
78
80
|
.environment(\.applicationEnvironment, applicationEnvironment)
|
|
79
81
|
.environmentObject(localize)
|
|
82
|
+
.environment(\.localize, localize)
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
.onAppear {
|
|
@@ -20,26 +20,21 @@ public struct PopupPromotion: View {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
public var body: some View {
|
|
23
|
-
// Mirrors Kotlin's `Modifier.fillMaxWidth().aspectRatio(0.72f)` box with
|
|
24
|
-
// `ContentScale.FillBounds` inside it: a fixed-ratio frame the image stretches
|
|
25
|
-
// to exactly fill (no `.aspectRatio` modifier on the image itself, unlike the
|
|
26
|
-
// previous `.fit`, which letterboxed instead of stretching).
|
|
27
|
-
let boxWidth = UIScreen.main.bounds.width - Spacing.XL * 2
|
|
28
|
-
let boxHeight = boxWidth / 0.72
|
|
29
|
-
|
|
30
23
|
VStack(spacing: 8) {
|
|
31
24
|
if(imageUrl.isEmpty) {
|
|
32
|
-
Icon(source: "media_fail", size:
|
|
25
|
+
Icon(source: "media_fail", size: UIScreen.main.bounds.width - Spacing.XL * 2)
|
|
33
26
|
}
|
|
34
27
|
else {
|
|
35
28
|
WebImage(url: URL(string: imageUrl)!)
|
|
36
29
|
.resizable()
|
|
37
30
|
.placeholder {
|
|
38
31
|
Color.gray
|
|
39
|
-
.
|
|
32
|
+
.aspectRatio(0.72, contentMode: .fit)
|
|
33
|
+
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
|
|
40
34
|
.clipped()
|
|
41
35
|
}
|
|
42
|
-
.
|
|
36
|
+
.aspectRatio(0.72, contentMode: .fit)
|
|
37
|
+
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2, alignment: .center)
|
|
43
38
|
.clipped()
|
|
44
39
|
.onTapGesture {
|
|
45
40
|
onAction?()
|
|
@@ -70,7 +65,6 @@ public struct PopupPromotion: View {
|
|
|
70
65
|
.padding(8)
|
|
71
66
|
.zIndex(1)
|
|
72
67
|
}
|
|
73
|
-
.buttonStyle(.plain)
|
|
74
68
|
}
|
|
75
69
|
}
|
|
76
70
|
|
|
@@ -51,8 +51,8 @@ let defaultBanner = TrustBannerData(
|
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
public struct TrustBanner: View {
|
|
54
|
-
@
|
|
55
|
-
@
|
|
54
|
+
@Environment(\.applicationEnvironment) var applicationEnvironment
|
|
55
|
+
@Environment(\.localize) private var localize
|
|
56
56
|
|
|
57
57
|
var onPress: ((String)->Void)?
|
|
58
58
|
|
package/ios/native-kits.podspec
CHANGED
package/local.properties
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
# Location of the SDK. This is only used by Gradle.
|
|
5
5
|
# For customization when using a Version Control System, please read the
|
|
6
6
|
# header note.
|
|
7
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Tue Jun 02 17:05:32 ICT 2026
|
|
8
|
+
sdk.dir=/Users/sophia/Library/Android/sdk
|