m

    mattinger

    2 years ago
    Also struggling to figure out how to load an xml drawable. Apparantly the imageResource function isn’t appropriate for that.
    Ricardo C.

    Ricardo C.

    2 years ago
    Try vectorResource
    Adam Powell

    Adam Powell

    2 years ago
    vectorResource doesn't apply to things like layer list/shape drawables. Those aren't supported today.
    Ricardo C.

    Ricardo C.

    2 years ago
    Ah I thought he meant a vector 😅
    m

    mattinger

    2 years ago
    Yeah, i have a shape file just as a POC for now to house the header image. I tried imageResource and imageFromResource and neither works.
    I can always load it as a Drawable and convert to bitmap. ImageAsset has an extension from to convert from Bitmap to ImageAsset.
    Adam Powell

    Adam Powell

    2 years ago
    might be easier to write it as a vector drawable and use the above
    Nader Jawad

    Nader Jawad

    2 years ago
    I'm curious what Drawables you are interested in using. @mattinger
    The other alternative is to use Modifier.drawBehind and use the corresponding draw calls directly on DrawScope which for a simple shape is a one liner
    m

    mattinger

    2 years ago
    Yeah, this won’t be a simple shape unfortunately. It would be something from an xml file for right now. Eventually it would be a png, but as i’m developing, it would be an xml based drawable, so i wanted to figure out how to make it work.