Skip to content

Commit

Permalink
💫 Update: Exp - AdaptiveModal
Browse files Browse the repository at this point in the history
Summary: Update experiment/test - `swift-programmatic-modal/AdaptiveModal`.
  • Loading branch information
dominicstop committed Jun 9, 2023
1 parent d4ee43c commit 084b844
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
19 changes: 1 addition & 18 deletions experiments/swift-programmatic-modal/RNILayout/RNILayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ public struct RNILayout {
preferredSizeKey: \.height
);

print(
"computeRawRectSize"
+ "\n - computedWidth: \(computedWidth)"
+ "\n - computedHeight: \(computedHeight)"
);

return CGSize(
width : computedWidth ?? 0,
height: computedHeight ?? 0
Expand Down Expand Up @@ -213,18 +207,7 @@ public struct RNILayout {

let computedMargiVertical =
(computedMarginTop ?? 0) + (computedMarginBottom ?? 0);

print(
"computeRect"
+ "\n - computedMarginLeft: \(computedMarginLeft)"
+ "\n - computedMarginRight: \(computedMarginRight)"
+ "\n - computedMarginTop: \(computedMarginTop)"
+ "\n - computedMarginBottom: \(computedMarginBottom)"
+ "\n - computedMarginHorizontal: \(computedMarginHorizontal)"
+ "\n - computedMargiVertical: \(computedMargiVertical)"
);



// Margin - X-Axis
switch self.horizontalAlignment {
case .left:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ public struct RNILayoutValue {
toValue: computedValueRaw ?? 0
);

print(
"RNILayoutValue.computeValue"
+ "\n - computedValueRaw: \(computedValueRaw)"
+ "\n - computedValueWithOffsets: \(computedValueWithOffsets)"
);

return self.clampValue(
usingLayoutValueContext: context,
forValue: computedValueWithOffsets ?? 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class RNILayoutTestViewController : UIViewController {
),
height: RNILayoutValue(
mode: .constant(100)
)
),
marginLeft: .safeAreaInsets(insetKey: \.left),
marginTop: .safeAreaInsets(insetKey: \.top)
),
// 1 B
RNILayout(
Expand All @@ -42,7 +44,9 @@ class RNILayoutTestViewController : UIViewController {
),
height: RNILayoutValue(
mode: .constant(100)
)
),
marginRight: .safeAreaInsets(insetKey: \.right),
marginTop: .safeAreaInsets(insetKey: \.top)
),
// 2 C
RNILayout(
Expand Down Expand Up @@ -381,11 +385,6 @@ class RNILayoutTestViewController : UIViewController {
usingLayoutValueContext: layoutValueContext
);

print(
"updateFloatingView"
+ "\n - computedRect: \(computedRect)"
);

let floatingView = self.floatingView;
floatingView.frame = computedRect;

Expand Down

0 comments on commit 084b844

Please sign in to comment.