Skip to content

Commit 010fc2d

Browse files
authored
Add lottie animation extension module (#79)
* add lottie animation library * update sample lottie files * add kdocs and revert agp version * set minSdk for lottie module to 16 * create a separate demo app module to showcase lottie animations * nit: update demo app name * nit: add new demo app to ignore list * remove api 15 emulator from ci workflow * chore: resolve review comments * chore: apidump * disable lottie animation for apiLevel < 16
1 parent a58db12 commit 010fc2d

File tree

37 files changed

+4143
-1
lines changed

37 files changed

+4143
-1
lines changed

build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ buildscript {
1818
boolean composeEnabled = Boolean.parseBoolean(project.composeEnabled) && Integer.parseInt(ciApiLevel) >= 21
1919
ext.composeEnabled = composeEnabled
2020

21+
boolean lottieAnimationEnabled = Boolean.parseBoolean(project.lottieAnimationEnabled) && Integer.parseInt(ciApiLevel) >= 16
22+
ext.lottieAnimationEnabled = lottieAnimationEnabled
23+
2124
dependencies {
2225
classpath(libs.android.gradlePlugin)
2326

@@ -38,6 +41,7 @@ buildscript {
3841

3942
ext {
4043
minSdk = 14
44+
minSdkLottie = 16
4145
minSdkCompose = 21
4246
targetSdk = 30
4347
buildToolsVersion = '30.0.3'
@@ -49,6 +53,10 @@ apiValidation {
4953
if (composeEnabled) {
5054
ignoredProjects += ["demo-compose"]
5155
}
56+
57+
if(lottieAnimationEnabled) {
58+
ignoredProjects += ["demo-animation-lottie"]
59+
}
5260
}
5361

5462
apply plugin: "org.jetbrains.dokka"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
public abstract interface class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable : com/backbase/deferredresources/DeferredDrawable {
2+
public abstract fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
3+
}
4+
5+
public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Asset : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
6+
public fun <init> (Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
7+
public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
8+
public fun equals (Ljava/lang/Object;)Z
9+
public fun hashCode ()I
10+
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
11+
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
12+
public fun toString ()Ljava/lang/String;
13+
}
14+
15+
public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Constant : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
16+
public fun <init> (Lcom/airbnb/lottie/LottieDrawable;)V
17+
public fun equals (Ljava/lang/Object;)Z
18+
public fun hashCode ()I
19+
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
20+
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
21+
public fun toString ()Ljava/lang/String;
22+
}
23+
24+
public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Resource : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
25+
public fun <init> (ILkotlin/jvm/functions/Function2;)V
26+
public synthetic fun <init> (ILkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
27+
public fun equals (Ljava/lang/Object;)Z
28+
public fun hashCode ()I
29+
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
30+
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
31+
public fun toString ()Ljava/lang/String;
32+
}
33+
34+
public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Stream : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
35+
public fun <init> (Ljava/io/InputStream;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
36+
public synthetic fun <init> (Ljava/io/InputStream;Ljava/lang/String;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
37+
public fun equals (Ljava/lang/Object;)Z
38+
public fun hashCode ()I
39+
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
40+
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
41+
public fun toString ()Ljava/lang/String;
42+
}
43+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright 2021 Backbase R&D B.V.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'com.android.library'
18+
apply plugin: 'org.jetbrains.kotlin.android'
19+
apply plugin: 'dev.drewhamilton.poko'
20+
21+
ext {
22+
artifactName = 'deferred-resources-animation-lottie'
23+
publishedDescription = 'Lottie based Deferred Resource animation library.'
24+
}
25+
apply from: '../publish.gradle'
26+
27+
android {
28+
compileSdkVersion rootProject.ext.targetSdk
29+
buildToolsVersion rootProject.ext.buildToolsVersion
30+
31+
defaultConfig {
32+
minSdkVersion rootProject.ext.minSdkLottie
33+
targetSdkVersion rootProject.ext.targetSdk
34+
versionName version
35+
36+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
37+
consumerProguardFiles "consumer-rules.pro"
38+
}
39+
40+
buildTypes {
41+
release {
42+
minifyEnabled false
43+
}
44+
}
45+
46+
compileOptions {
47+
sourceCompatibility JavaVersion.VERSION_1_8
48+
targetCompatibility JavaVersion.VERSION_1_8
49+
}
50+
51+
kotlinOptions {
52+
jvmTarget = JavaVersion.VERSION_1_8
53+
freeCompilerArgs += ['-Xexplicit-api=strict']
54+
}
55+
}
56+
57+
dependencies {
58+
api(project(':deferred-resources'))
59+
api(libs.lottie)
60+
61+
implementation(libs.androidx.annotations)
62+
63+
androidTestImplementation(libs.androidx.junit)
64+
androidTestImplementation(libs.bundles.androidx.test)
65+
androidTestImplementation(libs.kotlinx.coroutines)
66+
androidTestImplementation(libs.truth)
67+
}

deferred-resources-animation-lottie/consumer-rules.pro

Whitespace-only changes.

0 commit comments

Comments
 (0)