This commit is contained in:
Fabio Nuno 2017-02-24 15:16:18 -03:00
Родитель ec3403b4c4
Коммит 64e6684ae5
7 изменённых файлов: 77 добавлений и 72 удалений

Просмотреть файл

@ -14,7 +14,7 @@ namespace Example.iOS
public override void ViewDidLoad()
{
base.ViewDidLoad();
var lottieView = new LAAnimationView(NSUrl.FromString("https://raw.githubusercontent.com/airbnb/lottie-ios/master/Example/Assets/LottieLogo1.json"));
var lottieView = new LOTAnimationView(NSUrl.FromString("https://raw.githubusercontent.com/airbnb/lottie-ios/master/Example/Assets/LottieLogo1.json"));
lottieView.ContentMode = UIViewContentMode.ScaleAspectFit;
lottieView.AutoresizingMask = UIViewAutoresizing.All;
lottieView.Frame = AnimationView.Frame;

Просмотреть файл

@ -4,70 +4,71 @@ using UIKit;
namespace Airbnb.Lottie
{
// @interface LAAnimationTransitionController : NSObject <UIViewControllerAnimatedTransitioning>
[BaseType (typeof(NSObject))]
interface LAAnimationTransitionController : IUIViewControllerAnimatedTransitioning
{
// -(instancetype)initWithAnimationNamed:(NSString *)animation fromLayerNamed:(NSString *)fromLayer toLayerNamed:(NSString *)toLayer;
[Export ("initWithAnimationNamed:fromLayerNamed:toLayerNamed:")]
IntPtr Constructor (string animation, string fromLayer, string toLayer);
}
// @interface LOTAnimationTransitionController : NSObject <UIViewControllerAnimatedTransitioning>
[BaseType (typeof(NSObject))]
interface LOTAnimationTransitionController : IUIViewControllerAnimatedTransitioning
{
// -(instancetype)initWithAnimationNamed:(NSString *)animation fromLayerNamed:(NSString *)fromLayer toLayerNamed:(NSString *)toLayer;
[Export("initWithAnimationNamed:fromLayerNamed:toLayerNamed:")]
IntPtr Constructor(string animation, string fromLayer, string toLayer);
}
// typedef void (^LAAnimationCompletionBlock)(BOOL);
delegate void LAAnimationCompletionBlock (bool animationFinished);
// typedef void (^LOTAnimationCompletionBlock)(BOOL);
delegate void LOTAnimationCompletionBlock(bool animationFinished);
// @interface LAAnimationView : UIView
[BaseType (typeof(UIView))]
interface LAAnimationView
{
// +(instancetype)animationNamed:(NSString *)animationName;
[Static]
[Export ("animationNamed:")]
LAAnimationView AnimationNamed (string animationName);
/// @interface LOTAnimationView : UIView
[BaseType (typeof(UIView))]
interface LOTAnimationView
{
// +(instancetype)animationNamed:(NSString *)animationName;
[Static]
[Export("animationNamed:")]
LOTAnimationView AnimationNamed(string animationName);
// +(instancetype)animationFromJSON:(NSDictionary *)animationJSON;
[Static]
[Export ("animationFromJSON:")]
LAAnimationView AnimationFromJSON (NSDictionary animationJSON);
// +(instancetype)animationFromJSON:(NSDictionary *)animationJSON;
[Static]
[Export("animationFromJSON:")]
LOTAnimationView AnimationFromJSON(NSDictionary animationJSON);
// -(instancetype)initWithContentsOfURL:(NSURL *)url;
[Export ("initWithContentsOfURL:")]
IntPtr Constructor (NSUrl url);
// -(instancetype)initWithContentsOfURL:(NSURL *)url;
[Export("initWithContentsOfURL:")]
IntPtr Constructor(NSUrl url);
// @property (readonly, nonatomic) BOOL isAnimationPlaying;
[Export ("isAnimationPlaying")]
bool IsAnimationPlaying { get; }
// @property (readonly, nonatomic) BOOL isAnimationPlaying;
[Export("isAnimationPlaying")]
bool IsAnimationPlaying { get; }
// @property (assign, nonatomic) BOOL loopAnimation;
[Export ("loopAnimation")]
bool LoopAnimation { get; set; }
// @property (assign, nonatomic) BOOL loopAnimation;
[Export("loopAnimation")]
bool LoopAnimation { get; set; }
// @property (assign, nonatomic) CGFloat animationProgress;
[Export ("animationProgress")]
nfloat AnimationProgress { get; set; }
// @property (assign, nonatomic) CGFloat animationProgress;
[Export("animationProgress")]
nfloat AnimationProgress { get; set; }
// @property (assign, nonatomic) CGFloat animationSpeed;
[Export ("animationSpeed")]
nfloat AnimationSpeed { get; set; }
// @property (assign, nonatomic) CGFloat animationSpeed;
[Export("animationSpeed")]
nfloat AnimationSpeed { get; set; }
// @property (readonly, nonatomic) CGFloat animationDuration;
[Export ("animationDuration")]
nfloat AnimationDuration { get; }
// @property (readonly, nonatomic) CGFloat animationDuration;
[Export("animationDuration")]
nfloat AnimationDuration { get; }
// -(void)playWithCompletion:(LAAnimationCompletionBlock)completion;
[Export ("playWithCompletion:")]
void PlayWithCompletion (LAAnimationCompletionBlock completion);
// -(void)playWithCompletion:(LOTAnimationCompletionBlock)completion;
[Export("playWithCompletion:")]
void PlayWithCompletion(LOTAnimationCompletionBlock completion);
// -(void)play;
[Export ("play")]
void Play ();
// -(void)play;
[Export("play")]
void Play();
// -(void)pause;
[Export ("pause")]
void Pause ();
// -(void)pause;
[Export("pause")]
void Pause();
// -(void)addSubview:(UIView *)view toLayerNamed:(NSString *)layer;
[Export ("addSubview:toLayerNamed:")]
void AddSubview (UIView view, string layer);
}
// -(void)addSubview:(UIView *)view toLayerNamed:(NSString *)layer;
[Export("addSubview:toLayerNamed:")]
void AddSubview(UIView view, string layer);
}
}

Просмотреть файл

@ -3,7 +3,7 @@ using System.Threading.Tasks;
namespace Airbnb.Lottie
{
partial class LAAnimationView
partial class LOTAnimationView
{
/// <summary>
/// Asynchronously play the animation.

Просмотреть файл

@ -35,7 +35,7 @@
<ItemGroup>
<Compile Include="Linker.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LAAnimationView.cs" />
<Compile Include="LOTAnimationView.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingApiDefinition Include="ApiDefinitions.cs" />

Двоичные данные
Lottie.iOS/lottie_ios.a

Двоичный файл не отображается.

Просмотреть файл

@ -121,9 +121,9 @@ If you use `LottieDrawable` directly, you must call `RecycleBitmaps` when you ar
Lottie supports iOS 8 and above.
Lottie animations can be loaded from bundled JSON or from a URL
The simplest way to use it is with LAAnimationView:
The simplest way to use it is with LOTAnimationView:
```c#
LAAnimationView animation = LAAnimationView.AnimationNamed("LottieLogo1");
LOTAnimationView animation = LOTAnimationView.AnimationNamed("LottieLogo1");
this.View.AddSubview(animation);
animation.PlayWithCompletion((animationFinished) => {
// Do Something
@ -134,7 +134,7 @@ animation.PlayWithCompletion((animationFinished) => {
Or you can load it programmatically from a NSUrl
```c#
LAAnimationView animation = new LAAnimationView(new NSUrl(url));
LOTAnimationView animation = new LOTAnimationView(new NSUrl(url));
this.View.AddSubview(animation);
```
@ -159,12 +159,12 @@ Lottie comes with a `UIViewController` animation-controller for making custom vi
```c#
#region View Controller Transitioning
public class LAAnimationTransitionDelegate : UIViewControllerTransitioningDelegate
public class LOTAnimationTransitionDelegate : UIViewControllerTransitioningDelegate
{
public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForPresentedController(UIViewController presented, UIViewController presenting, UIViewController source)
{
LAAnimationTransitionController animationController =
new LAAnimationTransitionController(
LOTAnimationTransitionController animationController =
new LOTAnimationTransitionController(
animation: "vcTransition1",
fromLayer: "outLayer",
toLayer: "inLayer");
@ -174,8 +174,8 @@ public class LAAnimationTransitionDelegate : UIViewControllerTransitioningDelega
public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForDismissedController(UIViewController dismissed)
{
LAAnimationTransitionController animationController =
new LAAnimationTransitionController(
LOTAnimationTransitionController animationController =
new LOTAnimationTransitionController(
animation: "vcTransition2",
fromLayer: "outLayer",
toLayer: "inLayer");
@ -186,7 +186,7 @@ public class LAAnimationTransitionDelegate : UIViewControllerTransitioningDelega
#endregion
```
If your animation will be frequently reused, `LAAnimationView` has an built in LRU Caching Strategy.
If your animation will be frequently reused, `LOTAnimationView` has an built in LRU Caching Strategy.
## Supported After Effects Features
@ -247,6 +247,16 @@ If your animation will be frequently reused, `LAAnimationView` has an built in L
---
* Rectangle (All properties)
* Ellipse (All properties)
* Polystar (All properties)
* Polygon (All properties. Integer point values only.)
* Path (All properties)
* Anchor Point
* Position
@ -257,14 +267,8 @@ If your animation will be frequently reused, `LAAnimationView` has an built in L
* Opacity
* Path
* Group Transforms (Anchor point, position, scale etc)
* Rectangle (All properties)
* Elipse (All properties)
* Multiple paths in one group
#### Stroke (shape layer)

Просмотреть файл

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Com.Airbnb.iOS.Lottie</id>
<version>1.0.0.7</version>
<version>1.0.5.0</version>
<title>Lottie for Xamarin.iOS</title>
<authors>Martijn van Dijk</authors>
<owners>Martijn van Dijk</owners>