Skip to content

Support preferring exact intrinsic size in CrossfadeDrawable.#585

Merged
colinrtwhite merged 4 commits into
masterfrom
colin/crossfade_exact_intrinsic_size
Nov 17, 2020
Merged

Support preferring exact intrinsic size in CrossfadeDrawable.#585
colinrtwhite merged 4 commits into
masterfrom
colin/crossfade_exact_intrinsic_size

Conversation

@colinrtwhite
Copy link
Copy Markdown
Member

@colinrtwhite colinrtwhite commented Nov 15, 2020

Fixes: #223
Fixes: #230

By default, CrossfadeDrawable's intrinsic size is -1 if either of its child drawables have a -1 intrinsic size. This PR adds an option so its intrinsic size will only be -1 if both of its child drawables have an intrinsic size of -1.

This allows a user to use crossfade with PhotoView and CircleImageView since they both require an exact (>0) intrinsic size.

Copy link
Copy Markdown
Member

@Jawnnypoo Jawnnypoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

public fun <init> (Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lcoil/size/Scale;)V
public fun <init> (Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lcoil/size/Scale;I)V
public fun <init> (Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lcoil/size/Scale;IZ)V
public synthetic fun <init> (Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lcoil/size/Scale;IZILkotlin/jvm/internal/DefaultConstructorMarker;)V
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, this is binary incompatible.

@colinrtwhite colinrtwhite force-pushed the colin/crossfade_exact_intrinsic_size branch from 71546a6 to 8fe832a Compare November 17, 2020 20:52
@colinrtwhite colinrtwhite merged commit 1b7604b into master Nov 17, 2020
@colinrtwhite colinrtwhite deleted the colin/crossfade_exact_intrinsic_size branch November 17, 2020 21:29
colinrtwhite added a commit that referenced this pull request Oct 5, 2022
* Support preferring exact intrinsic size in CrossfadeDrawable.

* Update API.

* Fix binary compatibility.

* Docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image not displayed when loading into CircleImageView PhotoView + Coil + crossfade = no pinch-to-zoom

2 participants