2019-12-06 20:01:08 +00:00
|
|
|
// Copyright 2019 Google LLC.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
2019-12-18 21:26:19 +00:00
|
|
|
#ifndef SkottieViewController_DEFINED
|
|
|
|
#define SkottieViewController_DEFINED
|
|
|
|
|
|
|
|
#include "tools/skottie_ios_app/SkiaViewController.h"
|
2019-12-06 20:01:08 +00:00
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
2019-12-18 21:26:19 +00:00
|
|
|
// An abstraction of the Skottie module into Obective-C.
|
|
|
|
@interface SkottieViewController : SkiaViewController
|
|
|
|
- (void)draw:(CGRect)rect toCanvas:(SkCanvas*)canvas atSize:(CGSize)size;
|
2019-12-06 20:01:08 +00:00
|
|
|
|
2019-12-18 21:26:19 +00:00
|
|
|
// Return the current paused state.
|
|
|
|
- (bool)isPaused;
|
2019-12-06 20:01:08 +00:00
|
|
|
|
|
|
|
// When set, pauses at end of loop.
|
2019-12-18 21:26:19 +00:00
|
|
|
- (void)setStopAtEnd:(bool)stop;
|
2019-12-06 20:01:08 +00:00
|
|
|
|
|
|
|
// Load an animation from a Lottie JSON file. Returns Yes on success.
|
2019-12-18 21:26:19 +00:00
|
|
|
- (bool)loadAnimation:(NSData*)d;
|
2019-12-06 20:01:08 +00:00
|
|
|
|
|
|
|
// Jump to the specified location in the animation.
|
|
|
|
- (void)seek:(float)seconds;
|
|
|
|
|
|
|
|
// Toggle paused mode. Return paused state.
|
2019-12-18 21:26:19 +00:00
|
|
|
- (bool)togglePaused;
|
2019-12-06 20:01:08 +00:00
|
|
|
|
|
|
|
// Return the default size of the Lottie animation.
|
|
|
|
- (CGSize)size;
|
|
|
|
|
|
|
|
// Return the length of the animation loop.
|
|
|
|
- (float)animationDurationSeconds;
|
|
|
|
|
|
|
|
// Return the current position in the animation in seconds (between zero and
|
|
|
|
// animationDurationSeconds).
|
|
|
|
- (float)currentTime;
|
|
|
|
@end
|
|
|
|
|
2019-12-18 21:26:19 +00:00
|
|
|
#endif // SkottieViewController_DEFINED
|