Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 2.85 KB

README_en.md

File metadata and controls

90 lines (58 loc) · 2.85 KB

Motion Curve

The Motion Curve SDK consists of a series of dynamic curve functions. In order to solve the problems of high cost of developing dynamic effects and inconsistent effects and design expectations, each dynamic curve function can be applied to any dynamic attribute. Bring a better experience to users by changing the speed and direction in the animation process, currently including linear curve, acceleration curve, deceleration curve, cosine curve, transition curve, expected curve, standard curve (cubic Bezier curve), bounce Curves, elastic curves, etc., currently support iOS and Android;

YuQue

Both iOS and Android are implemented with the same set of motion curve algorithms to ensure the consistency of motion effects at both ends. The upper layer package of iOS uses Core Animation, and Android uses Interpolator.

iOS

Install

pod  'GaiaMotionCurve',     '0.1.0'

Header

#import <GaiaMotionCurve/CALayer+GaiaMotionCurve.h>

Example

#import <GaiaMotionCurve/CALayer+GaiaMotionCurve.h>

NSMutableArray *animationModels = [[NSMutableArray alloc] init];
GMCModel *model1 =[GMCModel modelWithKeyPath:@"opacity"
                                    duration:0.2
                                       delay:0
                                   curveType:MCXCurveTypeStandard
                                   fromValue:[NSValue gmc_valueWithCGFloat:0]
                                     toValue:[NSValue gmc_valueWithCGFloat:0.9]];
[animationModels addObject:model1];
[_tipsImageView.layer gmc_animateWithAnimationModels:animationModels completion:^(BOOL finished) {}];

Android

Install

import compiled aar file

Directory:src/Android/build/outputs

Package

import com.gaia.MotionCurve.*;

Example

TranslateAnimation animation = new TranslateAnimation(0, displaySize.x - maxTextWidth - 2 * margin, 0, 0);
animation.setFillAfter(true);
animation.setDuration(ANIMATION_DURATION);
animation.setInterpolator(new MotionCurveXStandardInterpolator());
view.startAnimation(animation);

Motion Curve Categories

Code of Conduct

Please refer to Alibaba Open Source Code of Conduct.

LICENCE

gaia-motion-curve is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.