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 20, 2023
1 parent c71d6a7 commit 695dd1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ enum AdaptiveModalConfigTestPresets: CaseIterable {
backgroundVisualEffectIntensity: 0.04
)
),

// snap point - 2
AdaptiveModalSnapPointConfig(
snapPoint: RNILayout(
Expand Down Expand Up @@ -809,7 +810,7 @@ enum AdaptiveModalConfigTestPresets: CaseIterable {
horizontalAlignment: .center,
verticalAlignment: .bottom,
width: .percent(percentValue: 0.85),
height: .percent(percentValue: 0.4),
height: .percent(percentValue: 0.5),
marginBottom: .init(
mode: .safeAreaInsets(insetKey: \.bottom),
minValue: .constant(15)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ fileprivate class TestModalViewController: UIViewController, AdaptiveModalEventN

weak var modalManager: AdaptiveModalManager?;

var showDismissButton = false;
var showCustomSnapPointButton = true;
var showDismissButton = true;
var showCustomSnapPointButton = false;

lazy var floatingViewLabel: UILabel = {
let label = UILabel();
Expand Down Expand Up @@ -109,6 +109,17 @@ fileprivate class TestModalViewController: UIViewController, AdaptiveModalEventN
.safeAreaInsets(insetKey: \.bottom),
.constant(15),
])
),
animationKeyframe: .init(
modalCornerRadius: 15,
modalMaskedCorners: [
.layerMaxXMaxYCorner,
.layerMaxXMinYCorner,
.layerMinXMaxYCorner,
.layerMinXMinYCorner,
],
modalBackgroundOpacity: 0.9,
backgroundOpacity: 0
)
);

Expand Down Expand Up @@ -284,6 +295,13 @@ class AdaptiveModalPresentationTestViewController : UIViewController {
@objc func onPressButtonPresentViewController(_ sender: UIButton) {
let testVC = TestModalViewController();

switch self.currentModalConfigPreset {
case .demo08, .demo07:
testVC.showCustomSnapPointButton = true;

default: break;
};

self.adaptiveModalManager.eventDelegate = testVC;
testVC.modalManager = self.adaptiveModalManager;

Expand Down

0 comments on commit 695dd1b

Please sign in to comment.