@momo-kits/native-kits 0.169.11-debug → 0.169.12-beta.1-debug
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +5 -1
- package/gradle.properties +1 -1
- package/ios/Layout/HeaderLayout.swift +6 -1
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -14,6 +14,8 @@ val HEADER_ICON_SIZE = 20.dp
|
|
|
14
14
|
val HEADER_PILL_WIDTH = 72.dp
|
|
15
15
|
val HEADER_SEARCH_HEIGHT = 32.dp
|
|
16
16
|
val HEADER_FRAME_MAX_WIDTH = 600.dp
|
|
17
|
+
// Stretch frame on hold until design confirms it: Stretch lays out like Grid.
|
|
18
|
+
private const val IS_STRETCH_FRAME_ENABLED = false
|
|
17
19
|
// Banner image width on every device: wide windows keep the phone size, centered.
|
|
18
20
|
val HEADER_BANNER_WIDTH = DEFAULT_SCREEN_SIZE.dp
|
|
19
21
|
internal val HEADER_TITLE_GAP = Spacing.S
|
|
@@ -26,6 +28,7 @@ enum class ContentLayout {
|
|
|
26
28
|
// 12 column grid: the header keeps the 12pt side padding.
|
|
27
29
|
Grid,
|
|
28
30
|
// One column of at most HEADER_FRAME_MAX_WIDTH, centered: the header row sits in the same frame.
|
|
31
|
+
// On hold: same as Grid for now.
|
|
29
32
|
Stretch,
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -53,7 +56,8 @@ fun headerLayoutOf(layout: ScreenLayout, contentLayout: ContentLayout): HeaderLa
|
|
|
53
56
|
val isDuo = layout.isIPhoneDuo || layout.isIPhoneDuoDevice
|
|
54
57
|
val isLargeWindow = minOf(layout.width, layout.height) >= FOLDABLE_MIN_WIDTH
|
|
55
58
|
val isWide = !isDuo && isLargeWindow
|
|
56
|
-
val
|
|
59
|
+
val isStretch = IS_STRETCH_FRAME_ENABLED && contentLayout == ContentLayout.Stretch
|
|
60
|
+
val frameInset = if (isWide && isStretch) {
|
|
57
61
|
maxOf(HEADER_SIDE_PADDING, (layout.contentWidth - HEADER_FRAME_MAX_WIDTH) / 2)
|
|
58
62
|
} else {
|
|
59
63
|
HEADER_SIDE_PADDING
|
package/gradle.properties
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
|
+
/// Stretch frame on hold until design confirms it: `.stretch` lays out like `.grid`.
|
|
7
|
+
private let isStretchFrameEnabled = false
|
|
8
|
+
|
|
6
9
|
/// Header spec values, in points. Public so custom header rights and extensions can match them.
|
|
7
10
|
public enum HeaderLayoutMetrics {
|
|
8
11
|
public static let buttonSize: CGFloat = 32
|
|
@@ -23,6 +26,7 @@ public enum ContentLayout: Equatable {
|
|
|
23
26
|
/// 12 column grid: the header keeps the 12pt side padding.
|
|
24
27
|
case grid
|
|
25
28
|
/// One column of at most `HeaderLayoutMetrics.frameMaxWidth`, centered: the header row sits in the same frame.
|
|
29
|
+
/// On hold: same as `.grid` for now.
|
|
26
30
|
case stretch
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -43,7 +47,8 @@ public extension ScreenLayout {
|
|
|
43
47
|
let isLargeWindow = min(width, height) >= ModalMetrics.foldableMinWidth
|
|
44
48
|
let isWide = !isIPhoneDuo && !isDuoDevice && isLargeWindow
|
|
45
49
|
let safeWidth = width - insets.leading - insets.trailing
|
|
46
|
-
let
|
|
50
|
+
let isStretch = isStretchFrameEnabled && contentLayout == .stretch
|
|
51
|
+
let frameInset = isWide && isStretch
|
|
47
52
|
? max(HeaderLayoutMetrics.sidePadding, (safeWidth - HeaderLayoutMetrics.frameMaxWidth) / 2)
|
|
48
53
|
: HeaderLayoutMetrics.sidePadding
|
|
49
54
|
return HeaderLayout(
|
package/ios/native-kits.podspec
CHANGED