Skip to content

Commit

Permalink
Add lottie animation extension module (#79)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
himanshu-bb authored Sep 28, 2021
1 parent a58db12 commit 010fc2d
Show file tree
Hide file tree
Showing 37 changed files with 4,143 additions and 1 deletion.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ buildscript {
boolean composeEnabled = Boolean.parseBoolean(project.composeEnabled) && Integer.parseInt(ciApiLevel) >= 21
ext.composeEnabled = composeEnabled

boolean lottieAnimationEnabled = Boolean.parseBoolean(project.lottieAnimationEnabled) && Integer.parseInt(ciApiLevel) >= 16
ext.lottieAnimationEnabled = lottieAnimationEnabled

dependencies {
classpath(libs.android.gradlePlugin)

Expand All @@ -38,6 +41,7 @@ buildscript {

ext {
minSdk = 14
minSdkLottie = 16
minSdkCompose = 21
targetSdk = 30
buildToolsVersion = '30.0.3'
Expand All @@ -49,6 +53,10 @@ apiValidation {
if (composeEnabled) {
ignoredProjects += ["demo-compose"]
}

if(lottieAnimationEnabled) {
ignoredProjects += ["demo-animation-lottie"]
}
}

apply plugin: "org.jetbrains.dokka"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
public abstract interface class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable : com/backbase/deferredresources/DeferredDrawable {
public abstract fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
}

public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Asset : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
public fun <init> (Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
public fun toString ()Ljava/lang/String;
}

public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Constant : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
public fun <init> (Lcom/airbnb/lottie/LottieDrawable;)V
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
public fun toString ()Ljava/lang/String;
}

public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Resource : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
public fun <init> (ILkotlin/jvm/functions/Function2;)V
public synthetic fun <init> (ILkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
public fun toString ()Ljava/lang/String;
}

public final class com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable$Stream : com/backbase/deferredresources/animation/lottie/DeferredLottieDrawable {
public fun <init> (Ljava/io/InputStream;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
public synthetic fun <init> (Ljava/io/InputStream;Ljava/lang/String;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public synthetic fun resolve (Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
public fun resolve (Landroid/content/Context;)Lcom/airbnb/lottie/LottieDrawable;
public fun toString ()Ljava/lang/String;
}

67 changes: 67 additions & 0 deletions deferred-resources-animation-lottie/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2021 Backbase R&D B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'dev.drewhamilton.poko'

ext {
artifactName = 'deferred-resources-animation-lottie'
publishedDescription = 'Lottie based Deferred Resource animation library.'
}
apply from: '../publish.gradle'

android {
compileSdkVersion rootProject.ext.targetSdk
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkLottie
targetSdkVersion rootProject.ext.targetSdk
versionName version

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
release {
minifyEnabled false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
freeCompilerArgs += ['-Xexplicit-api=strict']
}
}

dependencies {
api(project(':deferred-resources'))
api(libs.lottie)

implementation(libs.androidx.annotations)

androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.bundles.androidx.test)
androidTestImplementation(libs.kotlinx.coroutines)
androidTestImplementation(libs.truth)
}
Empty file.
Loading

0 comments on commit 010fc2d

Please sign in to comment.