b

    bodo

    1 year ago
    Is it possible to load network images in the compose preview?
    Nathan Castlehow

    Nathan Castlehow

    1 year ago
    I’m thinking no. I wasn’t able to get it to load so instead had it show a placeholder image in preview mode.
    if (LocalInspectionMode.current || state !is ImagePainter.State.Empty ) {
        placeholder()
    }
    b

    bodo

    1 year ago
    that is sad, but thanks for the little workaround for placeholders in preview mode
    Nathan Castlehow

    Nathan Castlehow

    1 year ago
    I should say that I remember it working when you deploy the preview to device. I just had issues when using Preview in android studio (which is where its most useful for me).
    cb

    cb

    1 year ago
    The preview in Android Studio doesn't (generally) have access to the network, so no way to load images.