Code Monkey home page Code Monkey logo

Comments (14)

gowthamgts avatar gowthamgts commented on May 11, 2024 9

any updates on chaining requests? would love to have it.

from coil.

appdev avatar appdev commented on May 11, 2024 8

I solved this problem use Gilde 😈

from coil.

Qdafengzi avatar Qdafengzi commented on May 11, 2024 7

so long time never update, lose hope

from coil.

yektasarioglu avatar yektasarioglu commented on May 11, 2024 5

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.

jaswinder01 avatar jaswinder01 commented on May 11, 2024 4

Hi, any update on this enhancement, or If anyone can help how we can transform the error placeholder.

from coil.

Sanaebadi97 avatar Sanaebadi97 commented on May 11, 2024 1
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.

alanleedev avatar alanleedev commented on May 11, 2024

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.

mario avatar mario commented on May 11, 2024

@colinrtwhite do you want this functionality?

from coil.

colinrtwhite avatar colinrtwhite commented on May 11, 2024

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.

Daphne-CoffeeIT avatar Daphne-CoffeeIT commented on May 11, 2024

Any updates?

from coil.

appdev avatar appdev commented on May 11, 2024

Hi, any update on this enhancement, or If anyone can help how we can transform the error placeholder.

from coil.

android-1995 avatar android-1995 commented on May 11, 2024

@colinrtwhite Is this enhancement planned? I really need it

from coil.

OxygenCobalt avatar OxygenCobalt commented on May 11, 2024

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.

smzh369 avatar smzh369 commented on May 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.