Comments (14)
any updates on chaining requests? would love to have it.
from coil.
I solved this problem use Gilde 😈
from coil.
so long time never update, lose hope
from coil.
This enhancement would be great. For those who look for a basic workaround see below;
sampleImageView.load(imageUrl) {
target(
onSuccess = {
sampleImageView.load(imageUrl) {
crossfade(true)
transformations(RoundedCornersTransformation(30f))
}
},
onError = {
handleError(it)
}
)
}
I know, it looks ugly as hell 🤮
from coil.
Hi, any update on this enhancement, or If anyone can help how we can transform the error placeholder.
from coil.
fun ImageView.loadImage(url: String?) {
load(url) {
transformations(RoundedCornersTransformation(context.getDp(R.dimen.radius_image))).placeholder(
R.drawable.profile_avatar_logo
).error(R.drawable.profile_avatar_logo)
}
}
fun ImageView.loadCircleImage(url: String?) {
load(url) {
transformations(CircleCropTransformation()).placeholder(R.drawable.profile_avatar_logo)
.error(R.drawable.profile_avatar_logo)
}
}
fun ImageView.loadImage(id: Int) {
load(id) {
transformations(RoundedCornersTransformation(context.getDp(R.dimen.radius_image))).placeholder(
R.drawable.profile_avatar_logo
).error(R.drawable.profile_avatar_logo)
}
}
fun ImageView.loadCircleImage(id: Int) {
load(id) {
transformations(CircleCropTransformation()).placeholder(R.drawable.profile_avatar_logo)
.error(R.drawable.profile_avatar_logo)
}
}
from coil.
I'm running into the same problem, trying to set a placeholder image that is circle cropped. I'm getting a square placeholder image then the circle cropped image that is loaded. Is this issue still not resolved?
[UPDATE] Learned that Glide may not support this as well. For a simple workaround, created circle cropped placeholder image which for my purposes is probably better.
from coil.
@colinrtwhite do you want this functionality?
from coil.
I'd like to add this eventually as part of supporting chaining requests (similar to this issue #27). I haven't settled on an API yet, though.
from coil.
Any updates?
from coil.
Hi, any update on this enhancement, or If anyone can help how we can transform the error placeholder.
from coil.
@colinrtwhite Is this enhancement planned? I really need it
from coil.
Seconding here that this I also really need this. I use rounded corners on my AppWidget images and using the RoundedCornersTransformation
with coil is the only feasible way I can send a rounded error drawable to the widget.
from coil.
Currently I think using oval shape is the best choice:
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="1dp" android:color="#ffffffff" />
<solid android:color="#ff7be0dd" />
</shape>
fun ImageView.loadCircleImage(image: Any?) = load(image) {
crossfade(true)
transformations(CircleCropTransformation())
placeholder(R.drawable.round_7be0dd_stroke_white)
error(R.drawable.round_ff8bff_stroke_white)
}
from coil.
Related Issues (20)
- [Coil 3]: Support NSURL mapper for native HOT 1
- Coil is Not working with compose web (Js) HOT 2
- Inconsistencies in SVG Image Sizing and Blurriness When Loaded from URLs Using Coil in Jetpack Compose HOT 4
- SSLHandshakeException HOT 1
- [Coil 3] Add Cache-Control implementation of CacheStrategy
- [Coil 3] Use Call.Factory rather than OkHttpClient when creating OkHttpNetworkFetcher HOT 1
- DrawablePainter ClassNotFoundException for Gif support
- Support Compose Multiplatform image resources HOT 2
- Different image size between Image and AsyncImage component HOT 1
- Coil doesn't load some images from disk, version 2.1.0 HOT 1
- ImageLoader in Compose HOT 3
- Add a test to ensure Android's Storage Access framework works with Coil 3.0's new Uri class
- Can't resolve depends HOT 1
- Consider adding workaround for U + gainmap + hardware bitmap bug HOT 2
- Update Roborazzi tests to also run on desktop JVM
- LazyColumn + AsyncImage loads the image, and when an error occurs during fast scrolling HOT 5
- Asynchronous initialization of ImageLoader HOT 8
- Unable to sync coil3:coil-gif while using cocoapods to include a pod HOT 2
- Update ContentPainterModifier with ModifierNodeElement to allow reuse on LazyList
- [Coil 3] AsyncImage does not respect default placeholder/error/fallback
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coil.