Thread
#compose
    c

    Ciprian Grigor

    1 year ago
    I wonder how does compose UI toolkit works internally? Does it have something similar to Flutter RenderObject tree, heavy UI objects which are reused?
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    c

    Ciprian Grigor

    1 year ago
    Hard to get an answer from there
    jim

    jim

    1 year ago
    If you want to understand how it works, you're going to need to dive into the code sooner or later. Zach is correct, we basically create trees of LayoutNodes, which are not widget instances (so unlike flutter) but are lightweight (like flutter) and are updated instead of recreated (which is why we have a compiler to help with tracking/applying those changes optimally).
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    For drawing, it uses Android’s RenderNode for drawing layers, which is also lighter-weight (and lower-level) than android views. However, on older android versions that don’t have RenderNodes, it falls back to Views for layers. https://developer.android.com/reference/android/graphics/RenderNode
    c

    Ciprian Grigor

    1 year ago
    Thanks for clear explanation: kind of similar RenderNode = RenderObject, however is closer to android and android views can be intermixed with compose because of that
    b

    Bsn Net

    1 year ago
    what Android version is considered old?
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    Whichever version is before the first one where RenderNode was introduced