Skip to content

Commit

Permalink
Possible LottiePerformance issue (#7) approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Javinator9889 committed Apr 24, 2020
1 parent 2264a01 commit 1f38ee9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
tools:ignore="LockedOrientationActivity">

<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class LottieAdaptedPerformanceAnimationView : LottieAnimationView,
init {
addLottieOnCompositionLoadedListener(this)
enableMergePathsForKitKatAndAbove(true)
setCacheComposition(true)
}

override fun getDuration(): Long {
return if (isHighPerformingDevice()) super.getDuration() else 100L
}
override fun getDuration(): Long =
if (isHighPerformingDevice()) super.getDuration() else 100L

override fun onCompositionLoaded(composition: LottieComposition?) {
if (!isHighPerformingDevice()) {
Expand Down

0 comments on commit 1f38ee9

Please sign in to comment.