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 5, 2023
1 parent 9afde4e commit ef18f4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class AdaptiveModalManager {

var nextSnapPointIndex: Int?;

var modalTransformAnimator: AdaptiveModalKeyframePropertyAnimator?;

var backgroundVisualEffectAnimator: AdaptiveModalRangePropertyAnimator?;
var modalBackgroundVisualEffectAnimator: AdaptiveModalRangePropertyAnimator?;

Expand Down Expand Up @@ -510,36 +508,6 @@ class AdaptiveModalManager {
);
};

func applyInterpolationToModalTransform(
forInputPercentValue inputPercentValue: CGFloat
) {

let animator: AdaptiveModalKeyframePropertyAnimator? = {
if let modalTransformAnimator = self.modalTransformAnimator {
return modalTransformAnimator;
};

guard let interpolationSteps = self.interpolationStepsSorted,
let modalView = self.modalView
else { return nil };

return .init(
interpolationPoints: interpolationSteps,
forComponent: modalView
) {
$0.transform = $1.modalTransform;
};
}();

self.modalTransformAnimator = animator;
animator?.setFractionComplete(forPercent: inputPercentValue);

print(
"applyInterpolationToModalTransform"
+ " - inputPercentValue: \(inputPercentValue)"
);
};

func applyInterpolationToModalBackgroundVisualEffect(
forInputPercentValue inputPercentValue: CGFloat
) {
Expand Down Expand Up @@ -669,10 +637,6 @@ class AdaptiveModalManager {
self.applyInterpolationToModalBackgroundVisualEffect(
forInputPercentValue: inputPercentValue
);

self.applyInterpolationToModalTransform(
forInputPercentValue: inputPercentValue
);
};

func applyInterpolationToModal(forPoint point: CGPoint){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ enum AdaptiveModalConfigTestPresets: CaseIterable {
)
),
animationKeyframe: AdaptiveModalAnimationConfig(
modalRotation: -0.2,
modalScaleX: 1,
modalScaleY: 1,
modalTranslateX: 0,
modalTranslateY: 0
//modalRotation: -0.2,
modalScaleX: 0.5,
modalScaleY: 0.5
//modalTranslateX: 0,
//modalTranslateY: 0
)
),

Expand All @@ -56,11 +56,11 @@ enum AdaptiveModalConfigTestPresets: CaseIterable {
)
),
animationKeyframe: AdaptiveModalAnimationConfig(
modalRotation: 0.1,
//modalRotation: 0.1,
modalScaleX: 0.5,
modalScaleY: 1,
modalTranslateX: 0,
modalTranslateY: 0
modalScaleY: 1
//modalTranslateX: 0,
//modalTranslateY: 0
)
),
// snap point - 2
Expand All @@ -76,11 +76,11 @@ enum AdaptiveModalConfigTestPresets: CaseIterable {
)
),
animationKeyframe: AdaptiveModalAnimationConfig(
modalRotation: 1,
//modalRotation: 1,
modalScaleX: 1,
modalScaleY: 1,
modalTranslateX: 0,
modalTranslateY: 0
modalScaleY: 1
//modalTranslateX: 0,
//modalTranslateY: 0
)
),
],
Expand Down

0 comments on commit ef18f4e

Please sign in to comment.