d

    darkmoon_uk

    1 year ago
    Layout Inspector bug? I have an App that starts out using UIView XML layouts, and later navigates to Compose defined screens. Layout inspector works on startup, but as soon as we navigate to the Compose screen, it shows the screen but the Component Tree is blank and no elements are clickable i.e. the inspector breaks. Using
    1.0.1
    and
    ui-tooling
    etc. same on Device / Emulator 🤷. Not even sure if the UIView/Compose mix is significant... inspector just plain doesn't work on Compose. Documentation says it should?
    Just tried BumbleBee; broken in same way as Arctic Fox.
    💡After further investigation, it looks like the limitation is with mixed UIView / Compose Views.
    A pure Compose view (using
    setContent
    extension from within
    Activity.onCreate
    ) results in an inspectable layout.
    For any mixed hierarchy; with ComposeView's nested in a traditional View hierarchy, the ComposeView is opaque and its content can't be inspected. 🙅
    This is even true where the root View is a
    ComposeView
    - interesting because you'd think it might be similar internally, to the
    setContent {}
    case.
    The limitation seems to be undocumented; are there plans to make Layout Inspector 'see' across View/Compose boundaries? Should this work already, @Chris Sinco [G]?
    Nick

    Nick

    1 year ago
    ahhh just ran into this. I created this ticket here: https://issuetracker.google.com/issues/198691447
    I commented out the
    AndroidView
    , and it worked as expected, but then when I ran it again I experienced the same issue 😕
    Chris Sinco [G]

    Chris Sinco [G]

    1 year ago
    I don’t think that is expected. Thanks for creating the ticket! I triaged it to the team for discussion.
    Nick

    Nick

    1 year ago
    Feel free to message me on here for any help
    @darkmoon_uk, I’m unable to reproduce this currently, are you still able to repro it? Can you provide some help on that ticket if you can repro it?
    d

    darkmoon_uk

    1 year ago
    Really happy to say Layout Inspector is now working for me in mixed Compose/View scenarios too. Seems it was either the upgrade to Compose
    1.0.2
    or latest Arctic Fox patch; IDK which, but it seems to be fixed 💪 :compose: