Luca Nicoletti

    Luca Nicoletti

    2 years ago
    Is it possible that
    imageFromResource
    does not work in
    repo
    ?
    I added a drawable but that always return
    null
    Adam Powell

    Adam Powell

    2 years ago
    is it a bitmap or a vector? at the moment it only does bitmaps
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    the old fashioned 5 .png files 😄
    Oh, actually, it also has a
    xml
    for
    anyDp
    Can this be the problem?
    Adam Powell

    Adam Powell

    2 years ago
    Could be
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    It was
    Adam Powell

    Adam Powell

    2 years ago
    I'm agitating for something
    Drawable
    -like in compose but without Drawable's regrets
    not there yet though 🙂
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    Removing the
    xml
    files now won’t crash the app 😄
    Adam Powell

    Adam Powell

    2 years ago
    the current situation with vectors being handled at composition time makes things awkward
    r

    romainguy

    2 years ago
    @Adam Powell Drawables without all the things that make them more like widgets would be fine
    Adam Powell

    Adam Powell

    2 years ago
    Yeah exactly
    Model observation should give us nearly everything we need in terms of smarts where it's needed
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    🤔
    Adam Powell

    Adam Powell

    2 years ago
    Invalidation for changes stays implicit, if something in a drawable is backed by
    @Model
    then that value changing will trigger redraw
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    how is this related to getting a
    null
    value when there’s also a
    xml
    for
    anyDp
    ?
    Adam Powell

    Adam Powell

    2 years ago
    Same with any kind of preferred size being read by the composable that lays out and draws it
    Just that we can unify vectors and bitmaps so you don't have to see this distinction
    One resource load that just works
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    Oh, I see, it was an internal discussion 😄
    Adam Powell

    Adam Powell

    2 years ago
    Yeah, just giving a view inside 🙂
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    👀
    r

    romainguy

    2 years ago
    imageResource
    blindly tries to decode a bitmap which is why you get null
    An XML is not a bitmap
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    Yeah I know that
    My question was more: why is it retrieving the
    xml
    file alongside all the ones available
    Adam Powell

    Adam Powell

    2 years ago
    It was the variant of that drawable selected for your current configuration
    Android resources treat the two as equivalent in terms of identity
    And compose isn't currently set up to play as nicely with that as it needs to be