@momo-kits/native-kits 0.162.2-beta.1-debug → 0.162.2-beta.2-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/compose/build.gradle.kts +1 -1
  2. package/compose/build.gradle.kts.backup +4 -4
  3. package/compose/compose.podspec +1 -1
  4. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +1 -9
  5. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -6
  6. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +4 -14
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -2
  8. package/gradle.properties +1 -1
  9. package/ios/Application/Components.swift +1 -0
  10. package/ios/Application/FloatingButton.swift +1 -0
  11. package/ios/Badge/Badge.swift +1 -0
  12. package/ios/Badge/BadgeRibbon.swift +2 -0
  13. package/ios/Button/Button.swift +1 -1
  14. package/ios/Checkbox/Checkbox.swift +1 -0
  15. package/ios/Information/Information.swift +151 -0
  16. package/ios/Input/Input.swift +1 -0
  17. package/ios/Input/InputPhoneNumber.swift +1 -0
  18. package/ios/Input/InputSearch.swift +3 -0
  19. package/ios/Input/InputTextArea.swift +1 -0
  20. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  21. package/ios/Popup/PopupDisplay.swift +6 -0
  22. package/ios/Popup/PopupInput.swift +2 -0
  23. package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
  24. package/ios/Typography/Text.swift +10 -19
  25. package/ios/Typography/Typography.swift +31 -6
  26. package/package.json +1 -1
  27. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +0 -32
  28. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  29. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  30. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +0 -16
  31. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  32. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  33. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  34. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  35. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
  36. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
  37. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
  38. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
  39. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
  40. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -60
  41. package/ios/Typography/MomoFontScale.swift +0 -36
  42. package/local.properties +0 -8
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.161.0-debug"
43
+ version = "0.162.2-beta.2-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.161.0-debug"
43
+ version = gitlabVersion
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -86,14 +86,14 @@ kotlin {
86
86
  }
87
87
 
88
88
  android {
89
- namespace = "vn.momo.kits.kits"
90
- compileSdk = 35
89
+ namespace = "$gitlabGroup.$gitlabArtifactId"
90
+ compileSdk = libs.versions.android.compileSdk.get().toInt()
91
91
  compileOptions {
92
92
  sourceCompatibility = JavaVersion.VERSION_17
93
93
  targetCompatibility = JavaVersion.VERSION_17
94
94
  }
95
95
  defaultConfig {
96
- minSdk = 24
96
+ minSdk = libs.versions.android.minSdk.get().toInt()
97
97
  }
98
98
  }
99
99
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.161.0-debug'
3
+ spec.version = '0.161.2-beta.15'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -29,8 +29,6 @@ data class MiniAppContext(
29
29
  val permissions: List<Map<String, Any>>? = emptyList(),
30
30
  val features: FeatureFlags? = null,
31
31
  val scaleSizeMaxRate: Float? = null,
32
- val followOSScale: Boolean? = null,
33
- val fontSizeRatio: Float? = null,
34
32
  ) {
35
33
  companion object {
36
34
 
@@ -63,8 +61,6 @@ data class MiniAppContext(
63
61
  permissions = if (!parent.permissions.isNullOrEmpty()) parent.permissions else child.permissions,
64
62
  features = mergeFeatureFlags(parent.features, child.features),
65
63
  scaleSizeMaxRate = parent.scaleSizeMaxRate ?: child.scaleSizeMaxRate,
66
- followOSScale = parent.followOSScale ?: child.followOSScale,
67
- fontSizeRatio = parent.fontSizeRatio ?: child.fontSizeRatio,
68
64
  )
69
65
  }
70
66
 
@@ -110,8 +106,4 @@ val LocalComponentInformation = staticCompositionLocalOf<ComponentInformation?>
110
106
  null
111
107
  }
112
108
 
113
- val ScaleSizeMaxRate = staticCompositionLocalOf<Float?> { null }
114
-
115
- val FollowOSScale = staticCompositionLocalOf<Boolean?> { null }
116
-
117
- val FontSizeRatio = staticCompositionLocalOf<Float?> { null }
109
+ val ScaleSizeMaxRate = staticCompositionLocalOf<Float?> { null }
@@ -2,21 +2,15 @@ package vn.momo.kits.components
2
2
 
3
3
  import androidx.compose.runtime.Composable
4
4
  import androidx.compose.runtime.CompositionLocalProvider
5
- import vn.momo.kits.application.FollowOSScale
6
- import vn.momo.kits.application.FontSizeRatio
7
5
  import vn.momo.kits.application.ScaleSizeMaxRate
8
6
 
9
7
  @Composable
10
8
  fun ScaleSizeScope(
11
9
  scaleSizeMaxRate: Float? = null,
12
- followOSScale: Boolean? = null,
13
- fontSizeRatio: Float? = null,
14
10
  content: @Composable () -> Unit
15
11
  ) {
16
12
  CompositionLocalProvider(
17
13
  ScaleSizeMaxRate provides scaleSizeMaxRate,
18
- FollowOSScale provides followOSScale,
19
- FontSizeRatio provides fontSizeRatio,
20
14
  ) {
21
15
  content()
22
16
  }
@@ -15,8 +15,6 @@ import androidx.compose.ui.unit.sp
15
15
  import org.jetbrains.compose.resources.Font
16
16
  import org.jetbrains.compose.resources.FontResource
17
17
  import org.jetbrains.compose.resources.InternalResourceApi
18
- import vn.momo.kits.application.FollowOSScale
19
- import vn.momo.kits.application.FontSizeRatio
20
18
  import vn.momo.kits.application.ScaleSizeMaxRate
21
19
  import vn.momo.kits.platform.getScreenDimensions
22
20
  import vn.momo.uikits.resources.Res
@@ -41,8 +39,6 @@ const val MAX_DEVICE_SCALE = 5
41
39
  @Composable
42
40
  fun scaleSize(size: Float): Float {
43
41
  val scaleSizeMaxRate: Float = ScaleSizeMaxRate.current ?: MAX_FONT_SCALE
44
- val followOSScale: Boolean = FollowOSScale.current ?: false
45
- val fontSizeRatio: Float = FontSizeRatio.current ?: 1f
46
42
  val deviceWidth = getScreenDimensions().width
47
43
  val deviceScale = deviceWidth / DEFAULT_SCREEN_SIZE
48
44
 
@@ -50,26 +46,20 @@ fun scaleSize(size: Float): Float {
50
46
  val fontScale = density.fontScale
51
47
 
52
48
  var fontSizeScaleDevice = size
53
- var fontSizeScaleUser = size
49
+ var fontSizeScaleOS = size
54
50
 
55
51
  if (deviceScale > 1) {
56
52
  fontSizeScaleDevice =
57
53
  min(deviceScale * fontSizeScaleDevice, fontSizeScaleDevice + MAX_DEVICE_SCALE)
58
54
  }
59
55
 
60
- if (followOSScale) {
61
- // Follow OS font scale (capped). User ratio is ignored in this mode.
62
- if (fontScale > 1) {
63
- fontSizeScaleUser = min(fontScale * fontSizeScaleUser, fontSizeScaleUser * scaleSizeMaxRate)
64
- }
65
- } else if (fontSizeRatio > 1) {
66
- // Custom in-app ratio. OS font scale is ignored.
67
- fontSizeScaleUser = fontSizeScaleUser * fontSizeRatio
56
+ if (fontScale > 1) {
57
+ fontSizeScaleOS = min(fontScale * fontSizeScaleOS, fontSizeScaleOS * scaleSizeMaxRate)
68
58
  }
69
59
 
70
60
  return max(
71
61
  fontSizeScaleDevice,
72
- fontSizeScaleUser
62
+ fontSizeScaleOS
73
63
  )
74
64
  }
75
65
 
@@ -65,8 +65,6 @@ fun NavigationContainer(
65
65
  AppConfig provides config,
66
66
  AppLanguage provides language,
67
67
  ScaleSizeMaxRate provides mergedContext?.scaleSizeMaxRate,
68
- FollowOSScale provides mergedContext?.followOSScale,
69
- FontSizeRatio provides mergedContext?.fontSizeRatio,
70
68
  ) {
71
69
  LaunchedEffect(Unit) {
72
70
  setNavigator?.invoke(navigator)
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.162.2-beta.1
21
+ version=0.162.2-beta.2
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -245,6 +245,7 @@ public struct Header: View {
245
245
  } else {
246
246
  Text(title)
247
247
  .font(.system(size: 17, weight: .bold))
248
+ .ignoreBoldTextSetting()
248
249
  .foregroundColor(tintColor ?? Colors.black17)
249
250
  .frame(maxWidth: titlePosition == .center ? UIScreen.main.bounds.width - 252 : nil)
250
251
  .frame(maxWidth: titlePosition == .center ? .infinity : UIScreen.main.bounds.width - 172, alignment: titlePosition == .center ? .center : .leading)
@@ -155,6 +155,7 @@ public struct FloatingButton: View {
155
155
  Text(label)
156
156
  .foregroundColor(.white)
157
157
  .font(.system(size: scaleSize(16), weight: .bold))
158
+ .ignoreBoldTextSetting()
158
159
  .lineLimit(1)
159
160
  .background(
160
161
  GeometryReader { geo in
@@ -54,6 +54,7 @@ public struct Badge: View {
54
54
  public var body: some View {
55
55
  Text(formatTitle(label))
56
56
  .font(.system(size: scaleSize(10), weight: .bold))
57
+ .ignoreBoldTextSetting()
57
58
  .foregroundColor(Colors.black01)
58
59
  .padding(.horizontal, Spacing.XS)
59
60
  .frame(minWidth: scaleSize(16), minHeight: scaleSize(16))
@@ -138,6 +138,7 @@ public struct BadgeRibbon: View {
138
138
  HStack(spacing: 0) {
139
139
  Text(label)
140
140
  .font(.system(size: scaleSize(12), weight: .medium))
141
+ .ignoreBoldTextSetting()
141
142
  .foregroundColor(Colors.black01)
142
143
  .lineLimit(1)
143
144
  .rotationEffect(rotation)
@@ -159,6 +160,7 @@ public struct BadgeRibbon: View {
159
160
  HStack(spacing: 0) {
160
161
  Text(label)
161
162
  .font(.system(size: scaleSize(12), weight: .medium))
163
+ .ignoreBoldTextSetting()
162
164
  .foregroundColor(Colors.black01)
163
165
  .lineLimit(1)
164
166
  .rotationEffect(rotation)
@@ -200,7 +200,7 @@ public struct Button: View {
200
200
  .background(bg)
201
201
  .overlay(
202
202
  RoundedRectangle(cornerRadius: size.radius)
203
- .stroke(border ?? .clear, lineWidth: border != nil ? borderWidth : 0)
203
+ .strokeBorder(border ?? .clear, lineWidth: border != nil ? borderWidth : 0)
204
204
  )
205
205
  .clipShape(RoundedRectangle(cornerRadius: size.radius))
206
206
  .opacity(loading ? 0.75 : 1)
@@ -55,6 +55,7 @@ public struct Checkbox: View{
55
55
  if !title.isEmpty {
56
56
  Text(title)
57
57
  .font(.description1)
58
+ .ignoreBoldTextSetting()
58
59
  }
59
60
  }
60
61
  }
@@ -0,0 +1,151 @@
1
+ import SwiftUI
2
+
3
+ public enum InformationState {
4
+ case `default`
5
+ case warning
6
+ case error
7
+ }
8
+
9
+ public struct Information: View {
10
+ private let title: String?
11
+ private let description: String
12
+ private let state: InformationState
13
+ private let image: String?
14
+ private let onPressAction: (() -> Void)?
15
+ private let showIcon: Bool
16
+ private let action: String?
17
+ private let showIconClose: Bool
18
+ private let onPressClose: (() -> Void)?
19
+
20
+ public init(
21
+ title: String? = nil,
22
+ description: String = "Description",
23
+ state: InformationState = .default,
24
+ image: String? = nil,
25
+ onPressAction: (() -> Void)? = nil,
26
+ showIcon: Bool = true,
27
+ action: String? = nil,
28
+ showIconClose: Bool = true,
29
+ onPressClose: (() -> Void)? = nil
30
+ ) {
31
+ self.title = title
32
+ self.description = description
33
+ self.state = state
34
+ self.image = image
35
+ self.onPressAction = onPressAction
36
+ self.showIcon = showIcon
37
+ self.action = action
38
+ self.showIconClose = showIconClose
39
+ self.onPressClose = onPressClose
40
+ }
41
+
42
+ private var borderColor: Color {
43
+ switch state {
44
+ case .default: return Colors.blue07
45
+ case .warning: return Colors.yellow06
46
+ case .error: return Colors.red07
47
+ }
48
+ }
49
+
50
+ private var backgroundColor: Color {
51
+ switch state {
52
+ case .default: return Colors.blue10
53
+ case .warning: return Colors.yellow09
54
+ case .error: return Colors.red10
55
+ }
56
+ }
57
+
58
+ private var accentColor: Color {
59
+ switch state {
60
+ case .default: return Colors.blue03
61
+ case .warning: return Colors.orange03
62
+ case .error: return Colors.red03
63
+ }
64
+ }
65
+
66
+ private var iconSource: String {
67
+ switch state {
68
+ case .default: return "notifications_info"
69
+ case .warning: return "24_notifications_alert_triangle"
70
+ case .error: return "24_notifications_alert_octagon"
71
+ }
72
+ }
73
+
74
+ public var body: some View {
75
+ VStack(alignment: .leading, spacing: 0) {
76
+ HStack(alignment: .top, spacing: 0) {
77
+ if let image {
78
+ ImageView(image)
79
+ .frame(width: 40, height: 40)
80
+ .clipShape(RoundedRectangle(cornerRadius: Radius.S))
81
+ .padding(.trailing, Spacing.S)
82
+ } else if showIcon {
83
+ Icon(source: iconSource, size: 16, color: accentColor)
84
+ .padding(.trailing, Spacing.S)
85
+ }
86
+
87
+ VStack(alignment: .leading, spacing: 0) {
88
+ if let title {
89
+ MomoText(title, typography: .labelDefaultMedium)
90
+ }
91
+ MomoText(description, typography: .descriptionDefaultRegular)
92
+ }
93
+ .frame(maxWidth: .infinity, alignment: .leading)
94
+
95
+ if let onPressClose, showIconClose {
96
+ Icon(source: "navigation_close", size: 16, color: Colors.black17)
97
+ .contentShape(Rectangle())
98
+ .onTapGesture(perform: onPressClose)
99
+ }
100
+ }
101
+
102
+ if let action, let onPressAction {
103
+ MomoText(action, typography: .actionXsBold, color: accentColor)
104
+ .frame(maxWidth: .infinity, alignment: .trailing)
105
+ .contentShape(Rectangle())
106
+ .onTapGesture(perform: onPressAction)
107
+ .padding(.top, Spacing.S)
108
+ }
109
+ }
110
+ .padding(Spacing.M)
111
+ .background(
112
+ RoundedRectangle(cornerRadius: Radius.S)
113
+ .fill(backgroundColor)
114
+ )
115
+ .overlay(
116
+ RoundedRectangle(cornerRadius: Radius.S)
117
+ .stroke(borderColor, lineWidth: 0.5)
118
+ )
119
+ }
120
+ }
121
+
122
+ // MARK: - Preview
123
+ #if DEBUG
124
+ struct Information_Previews: PreviewProvider {
125
+ static var previews: some View {
126
+ VStack(spacing: 16) {
127
+ Information(
128
+ title: "Information",
129
+ description: "This is a default information message."
130
+ )
131
+ Information(
132
+ title: "Warning",
133
+ description: "This is a warning message.",
134
+ state: .warning
135
+ )
136
+ Information(
137
+ title: "Error",
138
+ description: "This is an error message.",
139
+ state: .error,
140
+ onPressAction: {}, action: "Retry"
141
+ )
142
+ Information(
143
+ description: "Dismissible information.",
144
+ onPressClose: {}
145
+ )
146
+ }
147
+ .padding()
148
+ .previewLayout(.sizeThatFits)
149
+ }
150
+ }
151
+ #endif
@@ -157,6 +157,7 @@ public struct Input: View {
157
157
  })
158
158
  .keyboardType(keyboardType)
159
159
  .font(fontWeight == .bold ? .action_s_bold : .body_default_regular)
160
+ .ignoreBoldTextSetting()
160
161
  .foregroundColor(getTextColor())
161
162
  .disabled(disabled || readOnly)
162
163
  .applyPrimaryCursorColor()
@@ -94,6 +94,7 @@ public struct InputPhoneNumber: View {
94
94
  })
95
95
  .keyboardType(.numberPad)
96
96
  .font(size == .small ? .header_s_semibold : .header_m_bold)
97
+ .ignoreBoldTextSetting()
97
98
  .foregroundColor(Colors.black17)
98
99
  .applyPrimaryCursorColor()
99
100
  .lineLimit(1)
@@ -168,6 +168,7 @@ public struct InputSearch: View {
168
168
  Text(placeholder)
169
169
  .foregroundColor(disabled ? Colors.black08 : Colors.black12)
170
170
  .font(.system(size: 16, weight: fontWeight))
171
+ .ignoreBoldTextSetting()
171
172
  }
172
173
  TextField("", text: $text, onEditingChanged: { editing in
173
174
  isFocused = editing
@@ -183,6 +184,7 @@ public struct InputSearch: View {
183
184
  .disabled(disabled)
184
185
  .foregroundColor(disabled ? Colors.black08 : Colors.black17)
185
186
  .font(.system(size: 15, weight: fontWeight))
187
+ .ignoreBoldTextSetting()
186
188
  .keyboardType(keyboardType)
187
189
  }
188
190
 
@@ -212,6 +214,7 @@ public struct InputSearch: View {
212
214
  Text(buttonText)
213
215
  .foregroundColor(Colors.black17)
214
216
  .font(.system(size: 14, weight: .medium))
217
+ .ignoreBoldTextSetting()
215
218
  }
216
219
  .padding(.leading, Spacing.L)
217
220
  }
@@ -223,6 +223,7 @@ public struct InputTextArea: View {
223
223
  onBlur()
224
224
  }
225
225
  }
226
+ .ignoreBoldTextSetting()
226
227
  }
227
228
 
228
229
  private var borderColor: Color {
@@ -22,7 +22,7 @@ public struct KeyboardButton: View {
22
22
  public var body: some View {
23
23
  SwiftUI.Button(action: { self.action(key) }) {
24
24
  HStack {
25
- Text(key).font(.system(size: 24, weight: .bold))
25
+ Text(key).font(.system(size: 24, weight: .bold)).ignoreBoldTextSetting()
26
26
  }.frame(maxWidth: CGFloat(width), minHeight: height)
27
27
  .background(color)
28
28
  .foregroundColor(textColor)
@@ -24,6 +24,7 @@ extension View {
24
24
  VStack(spacing: 0) {
25
25
  Text("A")
26
26
  .font(font)
27
+ .ignoreBoldTextSetting()
27
28
  .lineLimit(1)
28
29
  .fixedSize()
29
30
  .background(
@@ -35,6 +36,7 @@ extension View {
35
36
 
36
37
  Text("A\nA")
37
38
  .font(font)
39
+ .ignoreBoldTextSetting()
38
40
  .lineLimit(2)
39
41
  .fixedSize(horizontal: false, vertical: true)
40
42
  .background(
@@ -221,12 +223,14 @@ public struct PopupDisplay: View {
221
223
  SwiftUI.Button(action: onPressCloseButton) {
222
224
  Text(closeButtonTitle)
223
225
  .font(.action2)
226
+ .ignoreBoldTextSetting()
224
227
  }.foregroundColor(Colors.black09)
225
228
  .padding(.trailing, 12)
226
229
 
227
230
  SwiftUI.Button(action: onPressAction) {
228
231
  Text(actionButtonTitle)
229
232
  .font(.action2)
233
+ .ignoreBoldTextSetting()
230
234
  }.foregroundColor(Colors.primary)
231
235
  }
232
236
  .frame(maxWidth: .infinity, alignment: .trailing)
@@ -238,12 +242,14 @@ public struct PopupDisplay: View {
238
242
  SwiftUI.Button(action: onPressAction) {
239
243
  Text(actionButtonTitle)
240
244
  .font(.action2)
245
+ .ignoreBoldTextSetting()
241
246
  }.foregroundColor(Colors.primary)
242
247
  .padding(.bottom, 6)
243
248
 
244
249
  SwiftUI.Button(action: onPressCloseButton) {
245
250
  Text(closeButtonTitle)
246
251
  .font(.action2)
252
+ .ignoreBoldTextSetting()
247
253
  }.foregroundColor(Colors.black09)
248
254
  }
249
255
  .frame(maxWidth: .infinity, alignment: .trailing)
@@ -38,12 +38,14 @@ public struct PopupInput: View {
38
38
  Text(title)
39
39
  .foregroundColor(.black)
40
40
  .font(.headerText1)
41
+ .ignoreBoldTextSetting()
41
42
  .padding(.top, 12)
42
43
  .padding(.bottom, 24)
43
44
 
44
45
  Text(description)
45
46
  .foregroundColor(.black)
46
47
  .font(.paragraph)
48
+ .ignoreBoldTextSetting()
47
49
  .opacity(0.6)
48
50
  .multilineTextAlignment(.leading)
49
51
  .padding(.bottom, 20)
@@ -79,6 +79,7 @@ public struct TrustBanner: View {
79
79
  .foregroundColor(Color(hex: "484848"))
80
80
  .lineLimit(2)
81
81
  .font(.system(size: 13, weight: Font.Weight.regular))
82
+ .ignoreBoldTextSetting()
82
83
  .lineSpacing(3)
83
84
  .padding(.bottom, 8)
84
85
  HStack {
@@ -86,6 +87,7 @@ public struct TrustBanner: View {
86
87
  Text(applicationEnvironment.config?.trustBanner?.subContent[language ?? "vi"] as? String ?? defaultBanner.subContent[language ?? "vi"])
87
88
  .foregroundColor(Colors.pink03)
88
89
  .font(.system(size: 13, weight: .bold))
90
+ .ignoreBoldTextSetting()
89
91
  .padding(.trailing, 4)
90
92
 
91
93
  Icon(source: "arrow_chevron_right_small", color: Colors.pink03)
@@ -8,30 +8,23 @@ public func scaleSize(_ size: CGFloat, _ scaleRate: CGFloat? = nil) -> CGFloat {
8
8
  let deviceWidth = UIScreen.main.bounds.width
9
9
  let deviceScale = deviceWidth / defaultScreenSize
10
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
+
11
15
  var fontSizeDeviceScale = size
12
- var fontSizeUserScale = size
16
+ var fontSizeOSScale = size
17
+
13
18
 
14
19
  if deviceScale > 1 {
15
20
  fontSizeDeviceScale = min(fontSizeDeviceScale * deviceScale, fontSizeDeviceScale + maxDeviceScale)
16
21
  }
17
22
 
18
- if MomoFontScale.shared.followOSScale {
19
- // Follow OS font scale (capped). User ratio is ignored in this mode.
20
- let defaultFont = UIFont.systemFont(ofSize: UIFont.labelFontSize)
21
- let scaledFont = UIFontMetrics.default.scaledFont(for: defaultFont)
22
- let fontScale = scaledFont.pointSize / defaultFont.pointSize
23
- if fontScale > 1 {
24
- fontSizeUserScale = min(fontSizeUserScale * fontScale, fontSizeUserScale * maxFontScale)
25
- }
26
- } else {
27
- // Custom in-app ratio. OS font scale is ignored.
28
- let ratio = MomoFontScale.shared.ratio
29
- if ratio > 1 {
30
- fontSizeUserScale = fontSizeUserScale * ratio
31
- }
23
+ if fontScale > 1 {
24
+ fontSizeOSScale = min(fontSizeOSScale * fontScale, fontSizeOSScale * maxFontScale)
32
25
  }
33
26
 
34
- return max(fontSizeDeviceScale, fontSizeUserScale)
27
+ return max(fontSizeDeviceScale, fontSizeOSScale)
35
28
  }
36
29
 
37
30
  public enum TypographyStyle {
@@ -125,9 +118,6 @@ public struct MomoText: View {
125
118
  private let content: String
126
119
  private let typography: TypographyStyle
127
120
  private let color: Color
128
- // Observe so the text re-renders immediately when the user changes the
129
- // font-size setting (live update, no app restart).
130
- @ObservedObject private var fontScale = MomoFontScale.shared
131
121
 
132
122
  public init(
133
123
  _ content: String,
@@ -146,5 +136,6 @@ public struct MomoText: View {
146
136
  .lineSpacing(scaleSize(typography.lineHeight) - scaleSize(typography.fontSize))
147
137
 
148
138
  return text
139
+ .ignoreBoldTextSetting()
149
140
  }
150
141
  }
@@ -1,13 +1,38 @@
1
1
  import SwiftUI
2
2
 
3
+ public extension View {
4
+ /// Forces SwiftUI to ignore the OS "Bold Text" accessibility setting so the
5
+ /// kit's typography weight stays fixed and matches the Compose implementation
6
+ /// (which does not honor that OS setting). Apply it wherever a `.font(...)` is set.
7
+ func ignoreBoldTextSetting() -> some View {
8
+ environment(\.legibilityWeight, .regular)
9
+ }
10
+ }
11
+
3
12
  public extension Font {
4
- // Shares the same scaling logic as `scaleSize` so it honors the user's
5
- // font-size preference (follow-OS vs in-app ratio).
6
- // NOTE: the `static let` constants below are evaluated once on first
7
- // access, so they reflect the setting at launch but do not live-update.
8
- // Components that need live updates should use `MomoText` / `scaleSize`.
9
13
  static func appFont(size: CGFloat) -> Font {
10
- return Font.system(size: scaleSize(size))
14
+ let defaultScreenSize: CGFloat = 375
15
+ let maxFontScale: CGFloat = 1.5
16
+ let maxDeviceScale: CGFloat = 5
17
+
18
+ let deviceWidth = UIScreen.main.bounds.width
19
+ let deviceScale = deviceWidth / defaultScreenSize
20
+
21
+ let defaultFont = UIFont.systemFont(ofSize: UIFont.labelFontSize)
22
+ let scaledFont = UIFontMetrics.default.scaledFont(for: defaultFont)
23
+ let fontScale = scaledFont.pointSize / defaultFont.pointSize
24
+
25
+ var fontSize = size
26
+
27
+ if deviceScale > 1 {
28
+ fontSize = min(fontSize * deviceScale, fontSize + maxDeviceScale)
29
+ }
30
+
31
+ if fontScale > 1 {
32
+ fontSize = min(fontSize * fontScale, fontSize * maxFontScale)
33
+ }
34
+
35
+ return Font.system(size: fontSize)
11
36
  }
12
37
 
13
38
  // New supported typography styles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.162.2-beta.1-debug",
3
+ "version": "0.162.2-beta.2-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
@@ -1,32 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- version = "1.3">
4
- <BuildAction>
5
- <BuildActionEntries>
6
- <BuildActionEntry
7
- buildForRunning = "YES">
8
- <BuildableReference
9
- BuildableIdentifier = "primary"
10
- BlueprintIdentifier = "A6A920D22B2ADD1E00C1A11F"
11
- BuildableName = "Example"
12
- BlueprintName = "Example"
13
- ReferencedContainer = "container:Example.xcodeproj">
14
- </BuildableReference>
15
- </BuildActionEntry>
16
- </BuildActionEntries>
17
- </BuildAction>
18
- <LaunchAction
19
- useCustomWorkingDirectory = "NO"
20
- buildConfiguration = "Debug"
21
- allowLocationSimulation = "YES">
22
- <BuildableProductRunnable>
23
- <BuildableReference
24
- BuildableIdentifier = "primary"
25
- BlueprintIdentifier = "A6A920D22B2ADD1E00C1A11F"
26
- BuildableName = "Example"
27
- BlueprintName = "Example"
28
- ReferencedContainer = "container:Example.xcodeproj">
29
- </BuildableReference>
30
- </BuildableProductRunnable>
31
- </LaunchAction>
32
- </Scheme>
@@ -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</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>7</integer>
11
- </dict>
12
- </dict>
13
- </dict>
14
- </plist>
@@ -1,16 +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>BuildLocationStyle</key>
6
- <string>UseAppPreferences</string>
7
- <key>CustomBuildLocationType</key>
8
- <string>RelativeToDerivedData</string>
9
- <key>DerivedDataCustomLocation</key>
10
- <string>DerivedData</string>
11
- <key>DerivedDataLocationStyle</key>
12
- <string>WorkspaceRelativePath</string>
13
- <key>ShowSharedSchemesAutomaticallyEnabled</key>
14
- <true/>
15
- </dict>
16
- </plist>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Bucket
3
- uuid = "6B3C387A-E951-41D1-A42C-FB6E447A46BA"
4
- type = "0"
5
- version = "2.0">
6
- </Bucket>
@@ -1,5 +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
- </plist>
@@ -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,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 = "BF2A15FEC3F3424BBC4B9AD5F86F2D54"
18
- BuildableName = "LottiePrivacyInfo.bundle"
19
- BlueprintName = "lottie-ios-LottiePrivacyInfo"
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 = "0B967D7F8561D42493EE289EC8D450D1"
18
- BuildableName = "Lottie.framework"
19
- BlueprintName = "lottie-ios"
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,60 +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
- <key>lottie-ios-LottiePrivacyInfo.xcscheme</key>
43
- <dict>
44
- <key>isShown</key>
45
- <false />
46
- <key>orderHint</key>
47
- <integer>5</integer>
48
- </dict>
49
- <key>lottie-ios.xcscheme</key>
50
- <dict>
51
- <key>isShown</key>
52
- <false />
53
- <key>orderHint</key>
54
- <integer>6</integer>
55
- </dict>
56
- </dict>
57
- <key>SuppressBuildableAutocreation</key>
58
- <dict />
59
- </dict>
60
- </plist>
@@ -1,36 +0,0 @@
1
- import SwiftUI
2
-
3
- /// Process-wide holder for the user's in-app font-size preference.
4
- ///
5
- /// `momo-native-kits` is a UI library; it does not read persistent storage
6
- /// itself. The host app (momo-app) reads the persisted setting from the shared
7
- /// Observable Storage and pushes it here at launch and on every change via
8
- /// `update(followOSScale:ratio:)`. All native typography (`scaleSize`,
9
- /// `Font.appFont`, `MomoText`) reads from this single source so the three
10
- /// render stacks (RN / Compose / SwiftUI) stay in sync.
11
- ///
12
- /// Live update: `MomoText` observes this object, so changing the setting
13
- /// re-renders typed text immediately. Views built from the `Font.appFont`
14
- /// static constants pick up the value at launch (static `let` is evaluated
15
- /// once); making those live would require turning them into functions.
16
- public final class MomoFontScale: ObservableObject {
17
- public static let shared = MomoFontScale()
18
-
19
- /// When true, follow the OS font scale (capped). `ratio` is ignored.
20
- @Published public private(set) var followOSScale: Bool = false
21
-
22
- /// In-app font-size ratio (e.g. 1.0 / 1.1 / 1.2). Ignored when
23
- /// `followOSScale` is true.
24
- @Published public private(set) var ratio: CGFloat = 1
25
-
26
- private init() {}
27
-
28
- public func update(followOSScale: Bool, ratio: CGFloat) {
29
- if self.followOSScale != followOSScale {
30
- self.followOSScale = followOSScale
31
- }
32
- if self.ratio != ratio {
33
- self.ratio = ratio
34
- }
35
- }
36
- }
package/local.properties DELETED
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Tue Apr 08 11:13:31 ICT 2025
8
- sdk.dir=/Users/sonnguyen/Library/Android/sdk