ImageView not getting `onSuccess` call if it's in `GONE` state and have one of settings `layout_width`/`layout_height` set as `match_parent`
See original GitHub issueDescribe the bug
ImageView not getting onSuccess
call if it’s in GONE
state and have one of settings layout_width
/layout_height
set as match_parent
.
Expected behavior Listener should get this call 😃
To Reproduce Layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/message_image_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:visibility="gone"
android:layout_centerInParent="true"/>
</RelativeLayout>
Load:
findViewById<ImageView>(R.id.message_image_view).apply {
load("https://media.tenor.com/images/07897c06242f1329ef7c37878b6bed94/tenor.png") {
listener(
onStart = {
Log.e("ZXC", "onStart")
},
onSuccess = { _, _ ->
Log.e("ZXC", "onSuccess")
visibility = View.VISIBLE
}
)
}
}
Version 1.2.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
android - ImageView - have height match width?
Set the ImageView width to 0dp and constrain its start and end to the parent. I'm not sure if setting the width to...
Read more >Displaying Images with the Picasso Library
For any given Picasso call, we can fix this by one or more of the following approaches: Add an explicit width or height...
Read more >ImageView - Android Developers
android:duplicateParentState, When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather ...
Read more >A guide for Android ImageView ScaleType and ...
When we set adjustViewBounds to true we are telling the ImageView (not the drawable) to adjust its bounds to preserve the aspect ratio...
Read more >Image Processing with Coil in Android - Section.io
Deploy Containers Close to Your Users. This Engineering Education (EngEd) Program is supported by Section. Instantly deploy containers globally.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@colinrtwhite https://github.com/admund/coil_issue_740
Can confirm. Using
wrap_content
works. Usingmatch_parent
or an equivalent constraint layout does not work.The
onSuccess
callback is never called for me. (NeitheronError
). It does not matter if you set the image view to gone before the request or inside theonStart
callback.Somehow the
onStart
callback is called twice for me. Dont know if related though.