@momo-kits/native-kits 0.114.2-beta.20 → 0.114.2-beta.21

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.
@@ -138,12 +138,11 @@ public struct Header: View {
138
138
 
139
139
  public var body: some View {
140
140
 
141
- let statusBarHeight = safeAreaTopInset()
142
141
  let tintIconColor = Colors.black17
143
142
  let backgroundButton = Colors.black01.opacity(0.6)
144
143
 
145
144
  if headerType != .none {
146
- VStack(spacing: 0) {
145
+ VStack(spacing: 0) {
147
146
  ZStack {
148
147
  HStack {
149
148
  if let goBack = goBack {
@@ -153,8 +152,7 @@ public struct Header: View {
153
152
  .background(Circle().fill(backgroundButton))
154
153
  .frame(width: 28, height: 28)
155
154
  .overlay(
156
- Image(systemName: "arrow.backward")
157
- .foregroundColor(.black)
155
+ Icon(source: "arrow-back", size: 20, color: Colors.black17)
158
156
  )
159
157
  }
160
158
 
@@ -167,14 +165,11 @@ public struct Header: View {
167
165
  }
168
166
 
169
167
  }
170
- .frame(height: 52)
171
- .padding(.horizontal)
172
-
173
-
168
+ .padding(.horizontal, 12)
174
169
 
175
170
  HStack {
176
171
  if titlePosition == .left, goBack != nil {
177
- Spacer().frame(width: 40)
172
+ Spacer().frame(width: 38)
178
173
  }
179
174
 
180
175
  if inputSearchProps != nil {
@@ -201,20 +196,22 @@ public struct Header: View {
201
196
  }
202
197
  } else {
203
198
  Text(title)
204
- .font(.headline)
199
+ .font(Font.system(size: 17).weight(.bold)) .lineSpacing(22)
205
200
  .foregroundColor(tintIconColor)
206
- .frame(maxWidth: titlePosition == .center ? .infinity : nil, alignment: titlePosition == .center ? .center : .leading)
201
+ .frame(maxWidth: titlePosition == .center ? UIScreen.main.bounds.width - 252 : nil)
202
+ .frame(maxWidth: titlePosition == .center ? .infinity : UIScreen.main.bounds.width - 172, alignment: titlePosition == .center ? .center : .leading)
203
+ .lineLimit(1)
204
+
207
205
  }
208
206
  Spacer()
209
207
  }
210
- .frame(height: 52)
211
208
  .padding(.horizontal)
212
209
  }
213
210
  .background(Color.clear)
214
211
  }
215
- }
212
+ .frame(height: 52)
216
213
  }
217
-
214
+ }
218
215
  }
219
216
 
220
217
 
@@ -34,7 +34,7 @@ public struct Screen<Content: View>: View {
34
34
  verticalAlignment: VerticalAlignment = .top,
35
35
  horizontalAlignment: HorizontalAlignment = .leading,
36
36
  title: String = "Stack",
37
- titlePosition: TitlePosition = .center,
37
+ titlePosition: TitlePosition = .left,
38
38
  goBack: (() -> Void)? = nil,
39
39
  scrollable: Bool = true,
40
40
  onContentLayout: ((CGRect) -> Void)? = nil,
@@ -71,23 +71,25 @@ public struct Screen<Content: View>: View {
71
71
 
72
72
  public var body: some View {
73
73
  GeometryReader { geometry in
74
- let safeAreaInsets = geometry.safeAreaInsets
75
- let statusBarHeight = safeAreaInsets.top
74
+ let topInset = geometry.safeAreaInsets.top
76
75
  let keyboardHeight: CGFloat = 0
77
76
  let keyboardSize: CGFloat = useAvoidKeyboard ? max(keyboardHeight, 0) : 0
77
+ let height = geometry.size.height
78
+ let bottomInset = geometry.safeAreaInsets.bottom
79
+ let screenHeight = height + topInset + bottomInset
78
80
 
79
81
  ZStack {
80
82
  (backgroundColor ?? Color.white).edgesIgnoringSafeArea(.all)
81
83
 
82
84
  VStack(spacing: 0) {
83
- ZStack {
84
- if animatedHeader == nil {
85
- HeaderBackground(headerType: headerType, scrollState: scrollOffset)
86
- } else {
87
- Color.white.opacity(Double(min(scrollOffset / 114, 1)))
88
- .overlay(HeaderBackground(headerType: headerType, scrollState: scrollOffset))
89
-
90
- }
85
+ ZStack(alignment: .top) {
86
+ // if animatedHeader == nil {
87
+ // HeaderBackground(headerType: headerType, scrollState: scrollOffset)
88
+ // } else {
89
+ // Color.white.opacity(Double(min(scrollOffset / 114, 1)))
90
+ // .overlay(HeaderBackground(headerType: headerType, scrollState: scrollOffset))
91
+ //
92
+ // }
91
93
 
92
94
  Header(
93
95
  headerType: headerType,
@@ -99,13 +101,17 @@ public struct Screen<Content: View>: View {
99
101
  animatedHeader: animatedHeader,
100
102
  scrollState: scrollOffset,
101
103
  inputSearchProps: inputSearchProps
102
- ).padding(.bottom, headerType == .extended ? 0 : -safeAreaTopInset())
103
- }.padding(.top, -safeAreaTopInset())
104
+ )
105
+ .background(HeaderBackground(headerType: headerType, scrollState: scrollOffset).edgesIgnoringSafeArea(.top))
106
+ .offset(y: topInset)
107
+
108
+ }
109
+ .offset(y: -topInset)
104
110
 
105
111
 
106
112
  VStack(alignment: horizontalAlignment, spacing: 0) {
107
113
  if animatedHeader != nil {
108
- Spacer().frame(height: statusBarHeight + 52 + layoutOffset)
114
+ Spacer().frame(height: topInset + 52 + layoutOffset)
109
115
  }
110
116
 
111
117
  if scrollable {
@@ -62,7 +62,7 @@ public struct PopupDisplay: View {
62
62
  }
63
63
  .scaledToFill()
64
64
  .frame(maxWidth: .infinity)
65
- .clipShape(RoundedCorner(radius: 8, corners: [.topLeft, .topRight]))
65
+ .clipShape(RoundedCorner(radius: 15, corners: [.topLeft, .topRight]))
66
66
  .aspectRatio(2, contentMode: .fit)
67
67
  }
68
68
  VStack(alignment: .leading) {
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
- #Tue Apr 08 11:13:31 ICT 2025
8
- sdk.dir=/Users/sonnguyen/Library/Android/sdk
7
+ #Wed Aug 21 14:20:12 ICT 2024
8
+ sdk.dir=/Users/huynhdung/Library/Android/sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.114.2-beta.20",
3
+ "version": "0.114.2-beta.21",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},