@momo-kits/native-kits 0.159.1-beta.4-debug → 0.159.1-beta.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/.claude/settings.local.json +9 -2
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +4 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +4 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +54 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +8 -30
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +1 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +17 -0
- package/gradle.properties +1 -1
- package/ios/Typography/Text.swift +24 -1
- package/local.properties +2 -2
- package/package.json +1 -1
- package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(
|
|
5
|
-
"
|
|
4
|
+
"Bash(yarn react-native:*)",
|
|
5
|
+
"Read(//Users/phuc/.claude/skills/ai-skill-generator/**)",
|
|
6
|
+
"Bash(python3 scripts/install_skill.py --update)",
|
|
7
|
+
"Bash(cd /Users/phuc/momo-kits/.claude/skills/design-system-kits && mkdir -p .claude/skills/design-system-kits && mv SKILL.md README.md references .claude/skills/design-system-kits/)",
|
|
8
|
+
"Bash(mv .claude/skills/design-system-kits/* . && rmdir .claude/skills/design-system-kits && rmdir .claude/skills)",
|
|
9
|
+
"WebFetch(domain:via.placeholder.com)",
|
|
10
|
+
"WebFetch(domain:image.tmdb.org)",
|
|
11
|
+
"WebFetch(domain:placehold.co)",
|
|
12
|
+
"WebFetch(domain:dummyimage.com)"
|
|
6
13
|
]
|
|
7
14
|
}
|
|
8
15
|
}
|
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |spec|
|
|
2
2
|
spec.name = 'compose'
|
|
3
|
-
spec.version = '0.
|
|
3
|
+
spec.version = '0.159.1-beta.3'
|
|
4
4
|
spec.homepage = 'https://momo.vn'
|
|
5
5
|
spec.source = { :http=> ''}
|
|
6
6
|
spec.authors = ''
|
|
@@ -10,27 +10,20 @@ Pod::Spec.new do |spec|
|
|
|
10
10
|
spec.libraries = 'c++'
|
|
11
11
|
spec.ios.deployment_target = '15.0'
|
|
12
12
|
spec.dependency 'lottie-ios', '4.4.3'
|
|
13
|
-
|
|
14
13
|
if !Dir.exist?('build/cocoapods/framework/kits.framework') || Dir.empty?('build/cocoapods/framework/kits.framework')
|
|
15
14
|
raise "
|
|
16
|
-
|
|
17
15
|
Kotlin framework 'kits' doesn't exist yet, so a proper Xcode project can't be generated.
|
|
18
16
|
'pod install' should be executed after running ':generateDummyFramework' Gradle task:
|
|
19
|
-
|
|
20
17
|
./gradlew :compose:generateDummyFramework
|
|
21
|
-
|
|
22
18
|
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
|
|
23
19
|
end
|
|
24
|
-
|
|
25
20
|
spec.xcconfig = {
|
|
26
21
|
'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
spec.pod_target_xcconfig = {
|
|
30
24
|
'KOTLIN_PROJECT_PATH' => ':compose',
|
|
31
25
|
'PRODUCT_MODULE_NAME' => 'kits',
|
|
32
26
|
}
|
|
33
|
-
|
|
34
27
|
spec.script_phases = [
|
|
35
28
|
{
|
|
36
29
|
:name => 'Build compose',
|
|
@@ -38,8 +31,8 @@ Pod::Spec.new do |spec|
|
|
|
38
31
|
:shell_path => '/bin/sh',
|
|
39
32
|
:script => <<-SCRIPT
|
|
40
33
|
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
|
|
35
|
+
exit 0
|
|
43
36
|
fi
|
|
44
37
|
set -ev
|
|
45
38
|
REPO_ROOT="$PODS_TARGET_SRCROOT"
|
|
@@ -51,4 +44,4 @@ Pod::Spec.new do |spec|
|
|
|
51
44
|
}
|
|
52
45
|
]
|
|
53
46
|
spec.resources = ['build/compose/cocoapods/compose-resources']
|
|
54
|
-
end
|
|
47
|
+
end
|
|
@@ -18,9 +18,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
18
18
|
import androidx.compose.foundation.layout.height
|
|
19
19
|
import androidx.compose.foundation.layout.ime
|
|
20
20
|
import androidx.compose.foundation.layout.imePadding
|
|
21
|
+
import androidx.compose.foundation.layout.navigationBars
|
|
21
22
|
import androidx.compose.foundation.layout.offset
|
|
22
23
|
import androidx.compose.foundation.layout.padding
|
|
23
|
-
import androidx.compose.foundation.layout.systemBars
|
|
24
24
|
import androidx.compose.foundation.rememberScrollState
|
|
25
25
|
import androidx.compose.foundation.verticalScroll
|
|
26
26
|
import androidx.compose.runtime.Composable
|
|
@@ -43,7 +43,6 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
|
43
43
|
import androidx.compose.ui.unit.Dp
|
|
44
44
|
import androidx.compose.ui.unit.IntOffset
|
|
45
45
|
import androidx.compose.ui.unit.dp
|
|
46
|
-
import androidx.compose.ui.unit.min
|
|
47
46
|
import androidx.compose.ui.zIndex
|
|
48
47
|
import kotlinx.coroutines.CoroutineScope
|
|
49
48
|
import kotlinx.coroutines.Dispatchers
|
|
@@ -103,8 +102,8 @@ fun Screen(
|
|
|
103
102
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
104
103
|
|
|
105
104
|
val isKeyboardVisible = isKeyboardVisible()
|
|
106
|
-
val indicator =
|
|
107
|
-
val bottomPadding =
|
|
105
|
+
val indicator = getAppStatusBarHeight()
|
|
106
|
+
val bottomPadding = if (isKeyboardVisible) 0.dp else indicator
|
|
108
107
|
|
|
109
108
|
val headerHeight = if (animatedHeader !== null)
|
|
110
109
|
with(LocalDensity.current) { layoutOffset.roundToPx() }
|
|
@@ -343,7 +342,7 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
343
342
|
footerHeightPx
|
|
344
343
|
} else {
|
|
345
344
|
with(density) {
|
|
346
|
-
|
|
345
|
+
navigationBar.toPx()
|
|
347
346
|
}
|
|
348
347
|
}.toInt()
|
|
349
348
|
|
|
@@ -401,5 +400,3 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
401
400
|
|
|
402
401
|
|
|
403
402
|
|
|
404
|
-
|
|
405
|
-
|
|
@@ -2,16 +2,21 @@ package vn.momo.kits.const
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.runtime.Composable
|
|
4
4
|
import androidx.compose.runtime.Immutable
|
|
5
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
5
6
|
import androidx.compose.ui.text.TextStyle
|
|
6
7
|
import androidx.compose.ui.text.font.FontFamily
|
|
7
8
|
import androidx.compose.ui.text.font.FontWeight
|
|
8
9
|
import androidx.compose.ui.text.style.TextDecoration
|
|
9
10
|
import androidx.compose.ui.unit.Dp
|
|
10
11
|
import androidx.compose.ui.unit.TextUnit
|
|
12
|
+
import androidx.compose.ui.unit.TextUnitType
|
|
13
|
+
import androidx.compose.ui.unit.dp
|
|
11
14
|
import androidx.compose.ui.unit.sp
|
|
12
15
|
import org.jetbrains.compose.resources.Font
|
|
13
16
|
import org.jetbrains.compose.resources.FontResource
|
|
14
17
|
import org.jetbrains.compose.resources.InternalResourceApi
|
|
18
|
+
import vn.momo.kits.application.ScaleSizeMaxRate
|
|
19
|
+
import vn.momo.kits.platform.getScreenDimensions
|
|
15
20
|
import vn.momo.uikits.resources.Res
|
|
16
21
|
import vn.momo.uikits.resources.momosignature
|
|
17
22
|
import vn.momo.uikits.resources.momotrustdisplay
|
|
@@ -24,25 +29,70 @@ import vn.momo.uikits.resources.sfprotext_regular
|
|
|
24
29
|
import vn.momo.uikits.resources.sfprotext_semibold
|
|
25
30
|
import vn.momo.uikits.resources.sfprotext_thin
|
|
26
31
|
import vn.momo.uikits.resources.sfprotext_ultralight
|
|
32
|
+
import kotlin.math.max
|
|
33
|
+
import kotlin.math.min
|
|
34
|
+
|
|
35
|
+
const val DEFAULT_SCREEN_SIZE = 375f
|
|
36
|
+
const val MAX_FONT_SCALE = 1.2f
|
|
37
|
+
const val MAX_DEVICE_SCALE = 5
|
|
27
38
|
|
|
28
39
|
@Composable
|
|
29
40
|
fun scaleSize(size: Float): Float {
|
|
30
|
-
|
|
41
|
+
val scaleSizeMaxRate: Float = ScaleSizeMaxRate.current ?: MAX_FONT_SCALE
|
|
42
|
+
val deviceWidth = getScreenDimensions().width
|
|
43
|
+
val deviceScale = deviceWidth / DEFAULT_SCREEN_SIZE
|
|
44
|
+
|
|
45
|
+
val density = LocalDensity.current
|
|
46
|
+
val fontScale = density.fontScale
|
|
47
|
+
|
|
48
|
+
var fontSizeScaleDevice = size
|
|
49
|
+
var fontSizeScaleOS = size
|
|
50
|
+
|
|
51
|
+
if (deviceScale > 1) {
|
|
52
|
+
fontSizeScaleDevice =
|
|
53
|
+
min(deviceScale * fontSizeScaleDevice, fontSizeScaleDevice + MAX_DEVICE_SCALE)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (fontScale > 1) {
|
|
57
|
+
fontSizeScaleOS = min(fontScale * fontSizeScaleOS, fontSizeScaleOS * scaleSizeMaxRate)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return max(
|
|
61
|
+
fontSizeScaleDevice,
|
|
62
|
+
fontSizeScaleOS
|
|
63
|
+
)
|
|
31
64
|
}
|
|
32
65
|
|
|
33
66
|
@Composable
|
|
34
67
|
fun scaleSize(size: TextUnit): TextUnit {
|
|
35
|
-
return size
|
|
68
|
+
if (!size.isSp) return size
|
|
69
|
+
|
|
70
|
+
val density = LocalDensity.current
|
|
71
|
+
|
|
72
|
+
val scaled = scaleSize(size.value)
|
|
73
|
+
val spValue = scaled / density.fontScale
|
|
74
|
+
|
|
75
|
+
return TextUnit(value = spValue, type = TextUnitType.Sp)
|
|
36
76
|
}
|
|
37
77
|
|
|
38
78
|
@Composable
|
|
39
79
|
fun scaleSize(size: Dp): Dp {
|
|
40
|
-
return size
|
|
80
|
+
return scaleSize(size.value).dp
|
|
41
81
|
}
|
|
42
82
|
|
|
43
83
|
@Composable
|
|
44
84
|
fun scaleSize(textStyle: TextStyle): TextStyle {
|
|
45
|
-
return textStyle
|
|
85
|
+
return textStyle.copy(
|
|
86
|
+
fontSize = if (textStyle.fontSize != TextUnit.Unspecified)
|
|
87
|
+
scaleSize(textStyle.fontSize)
|
|
88
|
+
else
|
|
89
|
+
TextUnit.Unspecified,
|
|
90
|
+
|
|
91
|
+
lineHeight = if (textStyle.lineHeight != TextUnit.Unspecified)
|
|
92
|
+
scaleSize(textStyle.lineHeight)
|
|
93
|
+
else
|
|
94
|
+
TextUnit.Unspecified,
|
|
95
|
+
)
|
|
46
96
|
}
|
|
47
97
|
|
|
48
98
|
|
|
@@ -1,40 +1,23 @@
|
|
|
1
1
|
package vn.momo.kits.navigation
|
|
2
2
|
|
|
3
|
+
import androidx.compose.animation.*
|
|
3
4
|
import androidx.compose.animation.core.tween
|
|
4
|
-
import androidx.compose.animation.fadeIn
|
|
5
|
-
import androidx.compose.animation.slideInHorizontally
|
|
6
|
-
import androidx.compose.animation.slideInVertically
|
|
7
|
-
import androidx.compose.animation.slideOutHorizontally
|
|
8
|
-
import androidx.compose.animation.slideOutVertically
|
|
9
5
|
import androidx.compose.foundation.layout.WindowInsets
|
|
10
6
|
import androidx.compose.foundation.layout.asPaddingValues
|
|
11
7
|
import androidx.compose.foundation.layout.systemBars
|
|
12
|
-
import androidx.compose.runtime
|
|
13
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
14
|
-
import androidx.compose.runtime.DisposableEffect
|
|
15
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
16
|
-
import androidx.compose.runtime.mutableStateOf
|
|
17
|
-
import androidx.compose.runtime.remember
|
|
18
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
8
|
+
import androidx.compose.runtime.*
|
|
19
9
|
import androidx.compose.ui.unit.Dp
|
|
20
10
|
import androidx.compose.ui.unit.dp
|
|
11
|
+
import androidx.compose.ui.unit.min
|
|
21
12
|
import androidx.navigation.compose.NavHost
|
|
22
13
|
import androidx.navigation.compose.composable
|
|
23
14
|
import androidx.navigation.compose.rememberNavController
|
|
24
15
|
import androidx.navigation.toRoute
|
|
25
|
-
import vn.momo.kits.application
|
|
26
|
-
import vn.momo.kits.
|
|
27
|
-
import vn.momo.kits.
|
|
28
|
-
import vn.momo.kits.application.KitConfig
|
|
29
|
-
import vn.momo.kits.application.MiniAppContext
|
|
30
|
-
import vn.momo.kits.application.ScaleSizeMaxRate
|
|
31
|
-
import vn.momo.kits.const.AppNavigationBar
|
|
32
|
-
import vn.momo.kits.const.AppStatusBar
|
|
33
|
-
import vn.momo.kits.const.AppTheme
|
|
34
|
-
import vn.momo.kits.const.Theme
|
|
35
|
-
import vn.momo.kits.const.ThemeAssets
|
|
36
|
-
import vn.momo.kits.const.defaultTheme
|
|
16
|
+
import vn.momo.kits.application.*
|
|
17
|
+
import vn.momo.kits.const.*
|
|
18
|
+
import vn.momo.kits.platform.getPlatformName
|
|
37
19
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
20
|
+
import vn.momo.kits.utils.getNavigationBarHeight
|
|
38
21
|
import vn.momo.maxapi.IMaxApi
|
|
39
22
|
|
|
40
23
|
@Composable
|
|
@@ -53,11 +36,7 @@ fun NavigationContainer(
|
|
|
53
36
|
val navController = rememberNavController()
|
|
54
37
|
val navigator = remember { Navigator(navController = navController, maxApi = maxApi) }
|
|
55
38
|
val statusBarHeight = statusBarHeight ?: getAppStatusBarHeight()
|
|
56
|
-
val navigationBarHeight =
|
|
57
|
-
WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
58
|
-
} else {
|
|
59
|
-
AppNavigationBar.current
|
|
60
|
-
}
|
|
39
|
+
val navigationBarHeight = getNavigationBarHeight()
|
|
61
40
|
|
|
62
41
|
val parentContext = ApplicationContext.current
|
|
63
42
|
val mergedContext = MiniAppContext.merge(parentContext, applicationContext)
|
|
@@ -163,4 +142,3 @@ fun NavigationContainer(
|
|
|
163
142
|
val LocalMaxApi = staticCompositionLocalOf<IMaxApi?> {
|
|
164
143
|
error("No MaxApi provided")
|
|
165
144
|
}
|
|
166
|
-
|
|
@@ -289,7 +289,7 @@ fun FooterContent(){
|
|
|
289
289
|
val imeBottom = ime.getBottom(density)
|
|
290
290
|
val thresholdPx = with(density) { 50.dp.toPx() }
|
|
291
291
|
val isKeyboardVisible = imeBottom > thresholdPx
|
|
292
|
-
val bottomPadding =
|
|
292
|
+
val bottomPadding = if (isKeyboardVisible) 0.dp else AppNavigationBar.current
|
|
293
293
|
Footer(footerComponent = options.footerComponent, bottomPadding = bottomPadding)
|
|
294
294
|
}
|
|
295
295
|
}
|
|
@@ -18,7 +18,6 @@ import androidx.compose.runtime.LaunchedEffect
|
|
|
18
18
|
import androidx.compose.ui.Alignment
|
|
19
19
|
import androidx.compose.ui.Modifier
|
|
20
20
|
import androidx.compose.ui.unit.dp
|
|
21
|
-
import androidx.compose.ui.unit.min
|
|
22
21
|
import androidx.navigation.compose.NavHost
|
|
23
22
|
import androidx.navigation.compose.composable
|
|
24
23
|
import androidx.navigation.compose.rememberNavController
|
|
@@ -139,7 +138,7 @@ fun BottomTab(
|
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
)
|
|
142
|
-
Spacer(modifier = Modifier.fillMaxWidth().height(
|
|
141
|
+
Spacer(modifier = Modifier.fillMaxWidth().height(AppNavigationBar.current + Spacing.S).background(AppTheme.current.colors.background.surface))
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
144
|
}
|
|
@@ -19,7 +19,6 @@ import androidx.compose.ui.layout.onGloballyPositioned
|
|
|
19
19
|
import androidx.compose.ui.platform.LocalDensity
|
|
20
20
|
import androidx.compose.ui.unit.IntOffset
|
|
21
21
|
import androidx.compose.ui.unit.dp
|
|
22
|
-
import androidx.compose.ui.unit.min
|
|
23
22
|
import kotlinx.coroutines.delay
|
|
24
23
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
25
24
|
import vn.momo.kits.const.Colors
|
|
@@ -56,7 +55,7 @@ fun SnackBar(
|
|
|
56
55
|
val footerHeight = if (options.footerComponent != null) {
|
|
57
56
|
footerHeightPxState.value
|
|
58
57
|
} else {
|
|
59
|
-
with(density){
|
|
58
|
+
with(density){ navigationBar.toPx() }
|
|
60
59
|
}.toInt()
|
|
61
60
|
|
|
62
61
|
var startPosition by remember { mutableStateOf(Float.MAX_VALUE) }
|
|
@@ -129,4 +128,4 @@ fun SnackBar(
|
|
|
129
128
|
is SnackBar.Toast -> {}
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
|
-
}
|
|
131
|
+
}
|
|
@@ -12,7 +12,10 @@ import androidx.compose.ui.graphics.Color
|
|
|
12
12
|
import androidx.compose.ui.platform.LocalDensity
|
|
13
13
|
import androidx.compose.ui.unit.Dp
|
|
14
14
|
import androidx.compose.ui.unit.dp
|
|
15
|
+
import androidx.compose.ui.unit.min
|
|
16
|
+
import vn.momo.kits.const.AppNavigationBar
|
|
15
17
|
import vn.momo.kits.const.AppStatusBar
|
|
18
|
+
import vn.momo.kits.platform.getPlatformName
|
|
16
19
|
import kotlin.math.abs
|
|
17
20
|
|
|
18
21
|
|
|
@@ -86,3 +89,17 @@ fun getAppStatusBarHeight(): Dp {
|
|
|
86
89
|
AppStatusBar.current
|
|
87
90
|
}
|
|
88
91
|
}
|
|
92
|
+
|
|
93
|
+
@Composable
|
|
94
|
+
fun getNavigationBarHeight(): Dp {
|
|
95
|
+
return if (AppNavigationBar.current == 0.dp) {
|
|
96
|
+
val systemBottomPadding = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
97
|
+
if (getPlatformName() == "iOS") {
|
|
98
|
+
min(systemBottomPadding, 21.dp)
|
|
99
|
+
} else {
|
|
100
|
+
systemBottomPadding
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
AppNavigationBar.current
|
|
104
|
+
}
|
|
105
|
+
}
|
package/gradle.properties
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
2
|
|
|
3
3
|
public func scaleSize(_ size: CGFloat, _ scaleRate: CGFloat? = nil) -> CGFloat {
|
|
4
|
-
|
|
4
|
+
let defaultScreenSize: CGFloat = 375
|
|
5
|
+
let maxFontScale: CGFloat = scaleRate ?? 1.2
|
|
6
|
+
let maxDeviceScale: CGFloat = 5
|
|
7
|
+
|
|
8
|
+
let deviceWidth = UIScreen.main.bounds.width
|
|
9
|
+
let deviceScale = deviceWidth / defaultScreenSize
|
|
10
|
+
|
|
11
|
+
let defaultFont = UIFont.systemFont(ofSize: UIFont.labelFontSize)
|
|
12
|
+
let scaledFont = UIFontMetrics.default.scaledFont(for: defaultFont)
|
|
13
|
+
let fontScale = scaledFont.pointSize / defaultFont.pointSize
|
|
14
|
+
|
|
15
|
+
var fontSizeDeviceScale = size
|
|
16
|
+
var fontSizeOSScale = size
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
if deviceScale > 1 {
|
|
20
|
+
fontSizeDeviceScale = min(fontSizeDeviceScale * deviceScale, fontSizeDeviceScale + maxDeviceScale)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if fontScale > 1 {
|
|
24
|
+
fontSizeOSScale = min(fontSizeOSScale * fontScale, fontSizeOSScale * maxFontScale)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return max(fontSizeDeviceScale, fontSizeOSScale)
|
|
5
28
|
}
|
|
6
29
|
|
|
7
30
|
public enum TypographyStyle {
|
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
|
+
#Thu Oct 02 17:53:13 ICT 2025
|
|
8
|
+
sdk.dir=/Users/phuc/Library/Android/sdk
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>Example.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|
|
Binary file
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "3B6FB503A75BF5BC1FA6F30BC06B9D28"
|
|
18
|
-
BuildableName = "MoMoUIKits.framework"
|
|
19
|
-
BlueprintName = "MoMoUIKits"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "0AEE99A309977BD12A049FF48AF9BA4B"
|
|
18
|
-
BuildableName = "Pods_Example.framework"
|
|
19
|
-
BlueprintName = "Pods-Example"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "3847153A6E5EEFB86565BA840768F429"
|
|
18
|
-
BuildableName = "SDWebImage.framework"
|
|
19
|
-
BlueprintName = "SDWebImage"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "92EBFA3E7005B4C18A9C0B44324EB80F"
|
|
18
|
-
BuildableName = "SDWebImageSwiftUI.framework"
|
|
19
|
-
BlueprintName = "SDWebImageSwiftUI"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "6510766A9670BFA3B251E2A62446FC5D"
|
|
18
|
-
BuildableName = "SkeletonUI.framework"
|
|
19
|
-
BlueprintName = "SkeletonUI"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>MoMoUIKits.xcscheme</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>isShown</key>
|
|
10
|
-
<false />
|
|
11
|
-
<key>orderHint</key>
|
|
12
|
-
<integer>0</integer>
|
|
13
|
-
</dict>
|
|
14
|
-
<key>Pods-Example.xcscheme</key>
|
|
15
|
-
<dict>
|
|
16
|
-
<key>isShown</key>
|
|
17
|
-
<false />
|
|
18
|
-
<key>orderHint</key>
|
|
19
|
-
<integer>1</integer>
|
|
20
|
-
</dict>
|
|
21
|
-
<key>SDWebImage.xcscheme</key>
|
|
22
|
-
<dict>
|
|
23
|
-
<key>isShown</key>
|
|
24
|
-
<false />
|
|
25
|
-
<key>orderHint</key>
|
|
26
|
-
<integer>2</integer>
|
|
27
|
-
</dict>
|
|
28
|
-
<key>SDWebImageSwiftUI.xcscheme</key>
|
|
29
|
-
<dict>
|
|
30
|
-
<key>isShown</key>
|
|
31
|
-
<false />
|
|
32
|
-
<key>orderHint</key>
|
|
33
|
-
<integer>3</integer>
|
|
34
|
-
</dict>
|
|
35
|
-
<key>SkeletonUI.xcscheme</key>
|
|
36
|
-
<dict>
|
|
37
|
-
<key>isShown</key>
|
|
38
|
-
<false />
|
|
39
|
-
<key>orderHint</key>
|
|
40
|
-
<integer>4</integer>
|
|
41
|
-
</dict>
|
|
42
|
-
</dict>
|
|
43
|
-
<key>SuppressBuildableAutocreation</key>
|
|
44
|
-
<dict />
|
|
45
|
-
</dict>
|
|
46
|
-
</plist>
|