Skip to content

Releases: alexzhirkevich/compottie

2.0.0-rc02

29 Oct 20:50
Compare
Choose a tag to compare
  • Compose updated to 1.7.0
  • Ktor updated to 3.0.0

Features

  • Added support for slottable properties

Fixes

  • FIxed a bug when some animations can become corrupted after the first loop
  • Fixed possible Kotlin incompatibilities

2.0.0-rc01

17 Sep 01:20
Compare
Choose a tag to compare

Changes since 2.0.0-beta02:

Features

  • Added support for 3d rotation (X, Y) on Android. Now all the targets support this type of transform
  • Added wildcard support for dynamic properties (#9) by @sergeys-opera
  • Added HTTP client independent network-core module that allows to use custom client to load animations. Default network module is now using Ktor3.

Fixes

  • Fixed wasm dotLottie decoding
  • Fixed font ascent isn't applied when calculating text Y
  • Fixed stroke skew isn't applied correctly
  • Fixed a bug when the first animation frame is not rendered (when the progress is zero) (#12)
  • Added synchronization for dotLottie assets decoding. It fixes a bug when dotLottie assets may fail to load when there are a lot of them (such as gif-like animations where each frame is a separate image)
  • Fixed multiple JSON decoding issues
  • Fixed a bug when precomposition layer effects were applied to all precomposition layers of a single source
  • Fixed Round Shape that wasn't working as expected and was causing memory leaks
  • Improved blending. It is now applied directly to the layer and should be more accurate

2.0.0-beta02

10 Jul 07:18
Compare
Choose a tag to compare
2.0.0-beta02 Pre-release
Pre-release

Changes since 2.0.0-beta01:

Highlights

After Effects Expressions are JS scripts that you can use together with keyframes and dynamic properties to animate objects.

Compottie now has it's own lightweight ECMAScript / JS interpreter and supports most of commonly-used After Effects expressions (such as math, random, wiggle, looping, properties, time manipulation, etc).
Expressions are enabled by default under the enableExpressions LottiePainter feature flag . You can disable it if your animation doesn't work as expected or displays warnings.

Fixes

  • Fixed a bug when animations with precompositions would not display without assets manager provided (#8)
  • LottieImage was renamed to LottieImageSpec (to match LottieFontSpec). It may affect you if you were implementing custom LottieAssetsManager
  • Improved content scale for LottiePainter. It is now correctly scaled when you use ContentScale like FillBounds,FillWidth,FillHeight for Image that draws the painter.

Features

  • LottiePainter now has extra parameter called enableTextGrouping. It allows to correctly render words in some unusual/RTL locales such as Arabic, but adds some limitations. Text positioning may become broken

2.0.0-beta01

29 Jun 15:31
Compare
Choose a tag to compare
2.0.0-beta01 Pre-release
Pre-release

Compottie 2.0 - brand new standalone multiplatform renderer, images, fonts, dotLottie (zip), URL loading, dynamic properties and more

New rendering engine

Compottie is no longer a simple wrapper over the platform renderers but standalone rendering engine.
It implies seamless integration with compose environment, consistent animation behaviour across platforms, consistent list of supported animation features and many new features that weren't possible before.

Note

The new renderer is implemented from scratch and therefore may have bugs.
Please report if you find any, preferably with a reproducible animation.

Images and Fonts

Compottie now supports embedded base64 images as well as images from any kind of resources on all platforms.
Embedded images work by default, you don't have to do anything. Other images as well as fonts can be provided using the new interfaces called LottieAssetsManager and LottieFontManager. New compottie module compottie-resources provides managers implementation backed by official compose resources.

dotLottie

Compottie now has a new module - compottie-dot. It brings the new type of composition spec - LottieCompositionSpec.DotLottie.

dotLottie is an open-source file format that aggregates one or more Lottie files and their associated resources into a single file. They are ZIP archives compressed with the Deflate compression method and carry the file extension of ".lottie".

dotLottie animations are up to 10x smaller in size and can have auto-linked bundled assets (as well as external assets).

You can also use DotLottie composition spec even without making a .lottie file just by ZIPping your animation with assets using deflate algorithm. The only limitation - animation can't be named as "manifest.json" and should contain exactly one .json file.

URL loading

Another new Compottie module compottie-network brings one more type of composition spec - LottieCompositionSpec.Url and NetworkAssetsManager. It provides configurable Ktor remote animation loading as well as local file system cache

Dynamic properties

You can now dynamically configure various animation properties at runtime. For example, you can change animation color when your app theme changes, or adjust position/scale of any layer in responce for a click.

Migration from 1.x

There shouldn't be serious breaking changes, but some of the APIs were deprecated in favour of new more flexible and convenient features. All deprecated declarations will be removed in v2.0 RC. All migrations can be performed with IDEA auto-replace feature.

  1. LottieAnimation composable was deprecated. The preferred way of rendering animations is now Lottie Painter that can be created using rememberLottiePainter. Lottie painter is also available in Compottie 1.x .

Before:

LottieAnimation(
    composition = ...
)

Now:

Image(
   painter = rememberLottiePainter(
    composition = ...
   ),
   contentDescription = "My awesome lottie animation'
)

It provides better semantics and allows you to draw lottie animations inside the Canvas, Modifier.drawBehind or in any other place that provides a DrawScope.

  1. LottieCompositionSpec.JsonString is no longer a class, but companion object function. It returns interface so if you were using the class jsonString property, you are no longer able to.

  2. rememberLottieComposition is now have an overload with suspend lambda composition loader. It will also automatically remember your spec instance to avoid recreations. Old declaration was deprecated. With the new override you can load animation from resources much easier:

Before:

var string by remember {
    mutableStateOf<String?>(null)
}

LaunchedEffect(Unit) {
    string = Res.readBytes("files/anim.json").decodeToString()
}

val composition = if (string != null) {
    rememberLottieComposition(CompositionSpec.JsonString(string!!)).value
} else null

Now:

val composition by rememberLottieComposition {
    // this is suspend IO context
    LottieCompositionSpec.JsonString(
        Res.readBytes("files/anim.json").decodeToString()
    )
}

1.1.2

09 Apr 06:24
Compare
Choose a tag to compare

Versions update

  • Compose 1.6.1
  • Kotlin 1.9.23
  • lottie-android 6.4.0

Fixes JS compilation in the above config

1.1.1

29 Feb 11:44
Compare
Choose a tag to compare

Compose 1.6 with wasmJs

1.1.0

13 Jan 15:56
Compare
Choose a tag to compare
  • Bump aribnb\lottie-compose to 6.3.0
  • Support more features of LottieAnimation
  • Added LottiePainter

1.0.0

12 Dec 21:47
d2a4f77
Compare
Choose a tag to compare

Initial release