Closed lawloretienne closed 6 years ago
@lawloretienne You shouldn't ever need this. All values in your composition get converted to dps. If you want the animation to be a specific size, just set a fixed size on your LottieAnimationView and use scaleType="centerInside"
or centerCrop
But if this ends up clipping the lottie animation it is not what our designers had intended.
@lawloretienne it won't if you use centerInside
centerCrop only works with width="wrap_content" and height="wrap_content" not with fixed width and height.
@waqarv712 it works perfectly with fixed width and height just add lottie_scale="0.1"
.
Is there a similar way in jetpack compose?
@pejman-74 I'm going to add a scaleType parameter soon but you should be able to achieve pretty much whatever you want with the modifier parameter's size modifiers already.
I did not find a way, I want to put an animation in the background with (fillMaxSize) but it does not fill it.
@pejman-74 You'll have to wait for the scaleType update to get it out of the box then. You also use the Compose transform/scale modifiers to add your own scale.
Is it best practice to have a different dimension for the
app:lottie_scale
attribute? Right now i have a dimension declared in adimens.xml
file that is in/values-hdpi
,/values-xhdpi
,/values-xxhdpi
,/values-xxxhdpi
. Is that the right approach?