Closed Khaos116 closed 2 years ago
Coil version is 1.1.0 PlaceHolder size is 720*1280
@caiyoufei It's not clear what the bug and expected behaviour here is. Please include a sample app that reproduces the issue. I would also ensure your ConstraintLayout
version is the latest as there have been a number of patch releases with sizing fixes.
I found the cause of this problem, because layer-list was used as a placeholder。Demo url is : https://github.com/khaos116/CoilHolderBug
Thanks for the sample! I'll take a look at it this week.
I am facing this issue as well. After scrolling off the image from the screen and scrolling back to that image shows the correct aspect ratio. For now I have disable placeholder image. Is there any fix planned for this?
Still figuring out the best way to address this without unexpected behaviour changes for existing users. In the meantime to work around the issue set precision(Precision.EXACT)
on either your request or your image loader.
Facing the same issue as well. ImageView with android:adjustViewBounds="true"
and android:scaleType="fitXY"
in a RecyclerView with a placeholder. ImageView keeps the placeholder aspect ratio.
Tried to add size(OriginalSize)
and precision(Precision.EXACT)
but didn't fix.
Works well without a placeholder.
<ImageView
android:layout_marginTop="10dp"
android:adjustViewBounds="true"
android:layout_gravity="center_horizontal"
android:id="@+id/ivGif"
android:scaleType="fitXY"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
view.ivGif.load(File(gifPath)) {
crossfade(true)
size(OriginalSize)
precision(Precision.EXACT)
placeholder(R.drawable.gif_loading_placeholder)
}
I'm experiencing a same issue as well. sadly precision(Precision.EXACT)
didn't help me to fix the issue.
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitXY"
android:id="@+id/view_gif"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
bind:layout_constraintDimensionRatio="@{model.ratio}"
bind:imageURL="@{model.url}"/>
I also set precision(Precision.EXACT)
on Request builder
same problem here using placeholder break final image size (even with imageview with fixed sizes)
I was facing the same problem. My solution was to implement a custom imageview to control the aspect ratio and to stop using constraintDimensionRatio.
This is fixed in Coil 2.0.0.
Use Placeholder No Placeholder