lottie-android icon indicating copy to clipboard operation
lottie-android copied to clipboard

Animation with Adobe After Effects files that consist of png images does not support system scale changes

Open AndreyBro48 opened this issue 2 years ago • 2 comments

Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.

If you don't use this template, your issue will be closed. Delete this text once completed.

Checklist

  1. My animation doesn't use any unsupported features.
  2. I know what part of my animation doesn't work.
  3. I have created a simplified version of my animation
  4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn't work.

Describe the bug

Any animations with Adobe After Effects files that consist of png images do not support system scaling

What version of Lottie did you test this on?

lottie-compose:5.2.0

What version of Android did you test this on?

Android 10/13, but I think it doesn't depend on the Android version

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run any animation with Adobe After Effects files that consist of png images (ex: https://lottiefiles.com/131823-investment) screenshot 1
  2. Go to system settings and change the scale settings of user interface screenshot 2
  3. Go back to app screenshot 3
  4. See error

Code

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val animation = "https://assets9.lottiefiles.com/packages/lf20_dnGoCmSHJx.json"
        setContent {
            LottieTestTheme {
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colors.background
                ) {
                    val composition by rememberLottieComposition(
                        spec = LottieCompositionSpec.Url(animation)
                    )
                    LottieAnimation(
                        composition = composition,
                        iterations = LottieConstants.IterateForever,
                        contentScale = ContentScale.FillWidth,
                        alignment = Alignment.TopCenter,
                        modifier = Modifier.fillMaxSize()
                    )
                }
            }
        }
    }
}

AndreyBro48 avatar Dec 27 '22 08:12 AndreyBro48

I'm experiencing the same issue. I'm using version 6.2.0, and after changing the system scale, there's a rendering issue, but force-quitting the app and relaunching it makes it work normally.

Hooooong avatar Dec 15 '23 06:12 Hooooong

@gpeal

It is the same even if you upgrade to 6.3.0.

My code is like this, and the video is attached.

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val animation = "https://lottie.host/8eda8418-db8e-42a7-be06-c6208ffb03b4/3yH617QvMP.json"
        setContent {
            LottieTestTheme {
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colors.background
                ) {
                    val composition by rememberLottieComposition(
                        spec = LottieCompositionSpec.Url(animation)
                    )
                    LottieAnimation(
                        composition = composition,
                        iterations = LottieConstants.IterateForever,
                        contentScale = ContentScale.FillWidth,
                        alignment = Alignment.TopCenter,
                        modifier = Modifier.fillMaxSize()
                    )
                }
            }
        }
    }
}
SAMPLE 1 SAMPLE 2

Hooooong avatar Jan 02 '24 02:01 Hooooong