diff --git a/android/build.gradle b/android/build.gradle index e357696..1fd04ba 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,5 +10,5 @@ dependencies { implementation 'com.airbnb.android:lottie:6.0.0' // https://github.com/rive-app/rive-android - implementation 'app.rive:rive-android:4.2.2' + implementation 'app.rive:rive-android:4.3.2' } diff --git a/android/manifest b/android/manifest index 888d8ba..f357377 100644 --- a/android/manifest +++ b/android/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 4.4.3 +version: 4.4.4 apiversion: 4 architectures: arm64-v8a armeabi-v7a x86 x86_64 description: ti.animation diff --git a/android/src/ti/animation/AnimationView.java b/android/src/ti/animation/AnimationView.java index 6e68617..0a4d5a3 100644 --- a/android/src/ti/animation/AnimationView.java +++ b/android/src/ti/animation/AnimationView.java @@ -10,9 +10,6 @@ import static ti.animation.TiAnimationModule.ANIMATION_LOTTIE; import static ti.animation.TiAnimationModule.ANIMATION_RIVE; -import androidx.annotation.NonNull; -import androidx.startup.AppInitializer; - import android.animation.Animator; import android.animation.ValueAnimator; import android.annotation.SuppressLint; @@ -22,6 +19,8 @@ import android.view.View; import android.widget.ImageView.ScaleType; +import androidx.startup.AppInitializer; + import com.airbnb.lottie.LottieAnimationView; import com.airbnb.lottie.LottieComposition; import com.airbnb.lottie.LottieCompositionFactory; @@ -46,20 +45,15 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import app.rive.runtime.kotlin.RiveAnimationView; -import app.rive.runtime.kotlin.RiveArtboardRenderer; import app.rive.runtime.kotlin.RiveInitializer; import app.rive.runtime.kotlin.core.Alignment; import app.rive.runtime.kotlin.core.Direction; import app.rive.runtime.kotlin.core.Fit; -import app.rive.runtime.kotlin.core.LinearAnimationInstance; import app.rive.runtime.kotlin.core.Loop; -import app.rive.runtime.kotlin.core.PlayableInstance; -import app.rive.runtime.kotlin.core.StateMachineInstance; public class AnimationView extends TiUIView implements LottieOnCompositionLoadedListener { @@ -198,16 +192,21 @@ private void setScaleMode(String smode) { return; } + if (lottieView == null) return; + switch (smode) { case "center": - if (lottieView != null) lottieView.setScaleType(ScaleType.CENTER); + lottieView.setScaleType(ScaleType.CENTER); break; case "centerCrop": - if (lottieView != null) lottieView.setScaleType(ScaleType.CENTER_CROP); + lottieView.setScaleType(ScaleType.CENTER_CROP); + break; + case "stretch": + lottieView.setScaleType(ScaleType.FIT_XY); break; case "centerInside": default: - if (lottieView != null) lottieView.setScaleType(ScaleType.CENTER_INSIDE); + lottieView.setScaleType(ScaleType.CENTER_INSIDE); break; } }