Thread
#compose
    Colton Idle

    Colton Idle

    1 year ago
    Can we add a "content description" to an image in compose?
    Carson Holzheimer

    Carson Holzheimer

    1 year ago
    Pretty sure that's handled in semantics modifier?
    If you're wanting it for accessibility or testing https://developer.android.com/jetpack/compose/testing. Im not sure if tooltips exist if that's what you want
    Colton Idle

    Colton Idle

    1 year ago
    I just have an image and want to make sure if someone uses an a11y reader like talkback that they can hear my description of the image. This will not be used for testing. I took a look at the Modifier.semantics but couldn't figure out any way to set a content description. There was an accessibilityLabel but it's deprecated.
    Carson Holzheimer

    Carson Holzheimer

    1 year ago
    Seems like that's what you want. Not sure what the replacement is if that's deprecated though https://bryanherbst.com/2020/11/03/compose-semantics-talkback/
    Colton Idle

    Colton Idle

    1 year ago
    Thanks @Carson Holzheimer I'll keep trying it!
    a

    Andrew Neal

    1 year ago
    accessibilityLabel
    was replaced with
    contentDescription
    . Both
    Icon
    and
    Image
    will have a parameter for it either in the next release or the one after. It was merged earlier this week. But still using
    Modifier.semantics
    under the hood. https://android-review.googlesource.com/c/platform/frameworks/support/+/1545989
    Colton Idle

    Colton Idle

    1 year ago
    Thank you! The param for it will be helpful instead of wrapping it with modifier semantics.