-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added animated controls and switches
- Loading branch information
brandon_withrow
committed
Aug 28, 2017
1 parent
3ee5856
commit adc7b9a
Showing
21 changed files
with
1,219 additions
and
754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
Example/Pods/Target Support Files/lottie-ios-iOS/lottie-ios-iOS-umbrella.h
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"assets":[],"layers":[{"ddd":0,"ind":0,"ty":4,"nm":"Checkmark Outlines 2","parent":3,"ks":{"o":{"k":100},"r":{"k":0},"p":{"k":[14.403,24.469,0]},"a":{"k":[17,13,0]},"s":{"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[12,-8],[-4.001,8],[-12,0]],"c":false}},"nm":"Path 1","mn":"ADBE Vector Shape - Group"},{"ty":"tm","s":{"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0_1_0p167_0"],"t":94,"s":[100],"e":[0]},{"t":121}],"ix":1},"e":{"k":[{"i":{"x":[0],"y":[0]},"o":{"x":[0.167],"y":[0.167]},"n":["0_0_0p167_0p167"],"t":94,"s":[100],"e":[100]},{"t":121}],"ix":2},"o":{"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"st","fillEnabled":true,"c":{"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":94,"s":[0.76,0.76,0.76,1],"e":[0,0.65,0.6,1]},{"t":121}]},"o":{"k":100},"w":{"k":3},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tr","p":{"k":[17,13],"ix":2},"a":{"k":[0,0],"ix":1},"s":{"k":[100,100],"ix":3},"r":{"k":0,"ix":6},"o":{"k":100,"ix":7},"sk":{"k":0,"ix":4},"sa":{"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"mn":"ADBE Vector Group"}],"ip":94,"op":151,"st":1,"bm":0,"sr":1},{"ddd":0,"ind":1,"ty":4,"nm":"X Outlines","parent":3,"ks":{"o":{"k":100},"r":{"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.52],"y":[0]},"n":["0_1_0p52_0"],"t":15,"s":[0],"e":[-90]},{"t":56}]},"p":{"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.5,"y":0},"n":"0p833_0p833_0p5_0","t":88,"s":[15.346,24.665,0],"e":[2.449,24.665,0],"to":[0,0,0],"ti":[0,0,0]},{"t":94}]},"a":{"k":[11.313,11.759,0]},"s":{"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[7.391,7.84],[-7.493,-7.049]],"c":false}},"nm":"Path 1","mn":"ADBE Vector Shape - Group"},{"ty":"st","fillEnabled":true,"c":{"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":22,"s":[0,0.65,0.6,1],"e":[0.76,0.76,0.76,1]},{"t":36}]},"o":{"k":100},"w":{"k":3},"lc":2,"lj":1,"ml":10,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tr","p":{"k":[11.364,11.364],"ix":2},"a":{"k":[0,0],"ix":1},"s":{"k":[100,100],"ix":3},"r":{"k":0,"ix":6},"o":{"k":100,"ix":7},"sk":{"k":0,"ix":4},"sa":{"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"mn":"ADBE Vector Group"},{"ty":"tm","s":{"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0_1_0p167_0p167"],"t":25,"s":[50],"e":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":46,"s":[0],"e":[0]},{"i":{"x":[0.801],"y":[0.738]},"o":{"x":[0.5],"y":[0]},"n":["0p801_0p738_0p5_0"],"t":86,"s":[0],"e":[43.795]},{"i":{"x":[0.708],"y":[0.786]},"o":{"x":[0.376],"y":[0.437]},"n":["0p708_0p786_0p376_0p437"],"t":94,"s":[43.795],"e":[50]},{"t":95}],"ix":1},"e":{"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0_1_0p167_0p167"],"t":25,"s":[50],"e":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":46,"s":[100],"e":[100]},{"i":{"x":[0.801],"y":[0.743]},"o":{"x":[0.5],"y":[0]},"n":["0p801_0p743_0p5_0"],"t":86,"s":[100],"e":[55.405]},{"i":{"x":[0.708],"y":[0.755]},"o":{"x":[0.376],"y":[0.501]},"n":["0p708_0p755_0p376_0p501"],"t":94,"s":[55.405],"e":[50]},{"t":95}],"ix":2},"o":{"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"}],"ip":0,"op":95,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":4,"nm":"Checkmark Outlines","parent":1,"ks":{"o":{"k":100},"r":{"k":0},"p":{"k":[10.359,11.571,0]},"a":{"k":[17,13,0]},"s":{"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"k":[{"i":{"x":0,"y":1},"o":{"x":0.52,"y":0},"n":"0_1_0p52_0","t":19,"s":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[12,-8],[-4.001,8],[-12,0]],"c":false}],"e":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[9.332,-8],[-6.669,8],[-14.668,0]],"c":false}]},{"t":35}]},"nm":"Path 1","mn":"ADBE Vector Shape - Group"},{"ty":"tm","s":{"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.52],"y":[0]},"n":["0_1_0p52_0"],"t":19,"s":[0],"e":[3.4]},{"i":{"x":[0],"y":[0]},"o":{"x":[0.167],"y":[0.167]},"n":["0_0_0p167_0p167"],"t":35,"s":[3.4],"e":[3.4]},{"i":{"x":[0.731],"y":[0.776]},"o":{"x":[0.5],"y":[0]},"n":["0p731_0p776_0p5_0"],"t":86,"s":[3.4],"e":[31.013]},{"i":{"x":[0.756],"y":[-0.33]},"o":{"x":[0.414],"y":[2.535]},"n":["0p756_-0p33_0p414_2p535"],"t":94,"s":[31.013],"e":[31.482]},{"t":95}],"ix":1},"e":{"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.52],"y":[0]},"n":["0_1_0p52_0"],"t":19,"s":[100],"e":[65.2]},{"i":{"x":[0],"y":[0]},"o":{"x":[0.167],"y":[0.167]},"n":["0_0_0p167_0p167"],"t":35,"s":[65.2],"e":[65.2]},{"i":{"x":[0.731],"y":[0.794]},"o":{"x":[0.5],"y":[0]},"n":["0p731_0p794_0p5_0"],"t":88,"s":[65.2],"e":[38.107]},{"i":{"x":[0.756],"y":[0.887]},"o":{"x":[0.414],"y":[0.216]},"n":["0p756_0p887_0p414_0p216"],"t":94,"s":[38.107],"e":[31.482]},{"t":95}],"ix":2},"o":{"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"st","fillEnabled":true,"c":{"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":22,"s":[0,0.65,0.6,1],"e":[0.76,0.76,0.76,1]},{"t":36}]},"o":{"k":100},"w":{"k":3},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tr","p":{"k":[17,13],"ix":2},"a":{"k":[0,0],"ix":1},"s":{"k":[100,100],"ix":3},"r":{"k":0,"ix":6},"o":{"k":100,"ix":7},"sk":{"k":0,"ix":4},"sa":{"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"mn":"ADBE Vector Group"}],"ip":0,"op":95,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":3,"ty":4,"nm":"White BG Outlines","ks":{"o":{"k":100},"r":{"k":0},"p":{"k":[{"i":{"x":0,"y":1},"o":{"x":0.52,"y":0},"n":"0_1_0p52_0","t":15,"s":[70.347,49.429,0],"e":[49.428,49.429,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0,"y":0},"o":{"x":0.167,"y":0.167},"n":"0_0_0p167_0p167","t":56,"s":[49.428,49.429,0],"e":[49.428,49.429,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.18,"y":1},"o":{"x":0.5,"y":0},"n":"0p18_1_0p5_0","t":86,"s":[49.428,49.429,0],"e":[70.347,49.429,0],"to":[0,0,0],"ti":[0,0,0]},{"t":106}]},"a":{"k":[24.25,24.25,0]},"s":{"k":[99.867,99.925,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"k":{"i":[[-17.673,0],[0,17.673],[17.673,0],[0,-17.673]],"o":[[17.673,0],[0,-17.673],[-17.673,0],[0,17.673]],"v":[[8.544,32.018],[40.544,0.018],[8.544,-31.982],[-23.456,0.018]],"c":true}},"nm":"Path 1","mn":"ADBE Vector Shape - Group"},{"ty":"fl","fillEnabled":true,"c":{"k":[1,1,1,1]},"o":{"k":100},"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"k":[7.125,24.25],"ix":2},"a":{"k":[0,0],"ix":1},"s":{"k":[93,93],"ix":3},"r":{"k":0,"ix":6},"o":{"k":100,"ix":7},"sk":{"k":0,"ix":4},"sa":{"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"mn":"ADBE Vector Group"}],"ip":0,"op":150,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":4,"ty":4,"nm":"Switch Outline Outlines","ks":{"o":{"k":100},"r":{"k":0},"p":{"k":[58.858,49.696,0]},"a":{"k":[42,34,0]},"s":{"k":[99.867,99.925,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"k":{"i":[[0,17.677],[-17.652,0],[0,0],[0,-17.677],[17.652,0],[0,0]],"o":[[0,-17.673],[0,0],[17.671,0],[0,17.673],[0,0],[-17.671,0]],"v":[[-50.46,-0.154],[-18.463,-32.154],[1.544,-32.154],[33.54,-0.154],[1.544,31.846],[-18.463,31.846]],"c":true}},"nm":"Path 1","mn":"ADBE Vector Shape - Group"},{"ty":"tr","p":{"k":[42,34],"ix":2},"a":{"k":[0,0],"ix":1},"s":{"k":[100,100],"ix":3},"r":{"k":0,"ix":6},"o":{"k":100,"ix":7},"sk":{"k":0,"ix":4},"sa":{"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":1,"mn":"ADBE Vector Group"},{"ty":"fl","fillEnabled":true,"c":{"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":22,"s":[0,0.65,0.6,1],"e":[0.76,0.76,0.76,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":36,"s":[0.76,0.76,0.76,1],"e":[0.76,0.76,0.76,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":93,"s":[0.76,0.76,0.76,1],"e":[0,0.65,0.6,1]},{"t":106}]},"o":{"k":100},"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"}],"ip":0,"op":150,"st":0,"bm":0,"sr":1}],"v":"4.5.0","ddd":0,"ip":0,"op":150,"fr":60,"w":100,"h":100} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// LAControlsViewController.h | ||
// lottie-ios | ||
// | ||
// Created by brandon_withrow on 8/28/17. | ||
// Copyright © 2017 Brandon Withrow. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface LAControlsViewController : UIViewController | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// LAControlsViewController.m | ||
// lottie-ios | ||
// | ||
// Created by brandon_withrow on 8/28/17. | ||
// Copyright © 2017 Brandon Withrow. All rights reserved. | ||
// | ||
|
||
#import "LAControlsViewController.h" | ||
#import <Lottie/Lottie.h> | ||
|
||
@interface LAControlsViewController () | ||
|
||
@end | ||
|
||
@implementation LAControlsViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
self.view.backgroundColor = [UIColor whiteColor]; | ||
|
||
UIButton *closeButton_ = [UIButton buttonWithType:UIButtonTypeSystem]; | ||
[closeButton_ setTitle:@"Close" forState:UIControlStateNormal]; | ||
[closeButton_ addTarget:self action:@selector(close) forControlEvents:UIControlEventTouchUpInside]; | ||
[self.view addSubview:closeButton_]; | ||
CGSize buttonSize = [closeButton_ sizeThatFits:self.view.bounds.size]; | ||
closeButton_.frame = CGRectMake(10, 30, buttonSize.width, 50); | ||
|
||
/// An animated toggle with different ON and OFF animations. | ||
|
||
LOTAnimatedSwitch *toggle1 = [LOTAnimatedSwitch switchNamed:@"Switch"]; | ||
|
||
/// Off animation is 0 to 0.5 progress. | ||
/// On animation is 0.5 to 1 progress. | ||
[toggle1 setProgressRangeForOnState:0.5 toProgress:1]; | ||
[toggle1 setProgressRangeForOffState:0 toProgress:0.5]; | ||
|
||
[toggle1 addTarget:self action:@selector(switchToggled:) forControlEvents:UIControlEventValueChanged]; | ||
toggle1.center = CGPointMake(CGRectGetMidX(self.view.bounds), 90); | ||
[self.view addSubview:toggle1]; | ||
|
||
/// An animated 'like' or 'heart' button. | ||
/// Clicking toggles the Like or Heart state. | ||
/// The animation runs from 0-1, progress 0 is off, progress 1 is on | ||
LOTAnimatedSwitch *heartIcon = [LOTAnimatedSwitch switchNamed:@"TwitterHeart"]; | ||
heartIcon.bounds = CGRectMake(0, 0, 200, 200); | ||
heartIcon.center = CGPointMake(CGRectGetMidX(self.view.bounds), CGRectGetMaxY(toggle1.frame) + (heartIcon.bounds.size.height * 0.5)); | ||
[heartIcon addTarget:self action:@selector(switchToggled:) forControlEvents:UIControlEventValueChanged]; | ||
[self.view addSubview:heartIcon]; | ||
|
||
} | ||
|
||
- (void)switchToggled:(LOTAnimatedSwitch *)animatedSwitch { | ||
NSLog(@"The switch is %@", (animatedSwitch.on ? @"ON" : @"OFF")); | ||
} | ||
|
||
- (void)close { | ||
[self.presentingViewController dismissViewControllerAnimated:YES completion:NULL]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.