Chachako

    Chachako

    1 year ago
    This is an exciting thing, I look forward to the moment it is completed 🤩 https://android-review.googlesource.com/c/platform/frameworks/support/+/1704159
    Doris Liu

    Doris Liu

    1 year ago
    🤣 I also look forward to that! This change list depends on
    Transition<*>.AnimatedVisibility
    , which is a new feature introduced in beta-07. (The same release also introduces a new concept
    AnimatedVisibilityScope
    , which I'd love to get feedback on 🙂 ). Once beta07 is out,
    AnimatedContent.kt
    (from the link above) should just work for you if you patch it locally. If anyone is interested in playing with it, feedback would be highly appreciated as always. 🙏
    Shakil Karim

    Shakil Karim

    1 year ago
    I think, it's build on top of Changes in Transition API's, which will hopefully realase in Compose beta07. @Doris Liu
    Chachako

    Chachako

    1 year ago
    Would it work with the navgation?
    Doris Liu

    Doris Liu

    1 year ago
    Would it work with the navgation?
    That's what we are working towards, but it likely won't be done in the linked change. 🙂
    Chachako

    Chachako

    1 year ago
    @Doris Liu I’ll look forward to it and thank you for your work anyway 😉
    m

    Michal Klimczak

    1 year ago
    @Doris Liu I wonder if I'm missing something, if not, there might be something to consider in the design of AnimatedVisibility. Let's assume I have a Row which has two children visible at all times and then two other children under AnimatedVisibility. Those two other children will not have access to RowScope since they are inside AnimatedVisibilityScope. And therefore they are no longer laid out next to each other, but on top of each other like in BoxScope. I'm writing from mobile but if it's too difficult to understand I can prepare a snippet.
    Doris Liu

    Doris Liu

    1 year ago
    Are the two children in the same AnimatedVisibility or each in a separate AnimatedVisibility? The latter will lay them out next to each other
    m

    Michal Klimczak

    1 year ago
    In the same one. You are right, separating them is a sensible solution 😃 I just wonder if it's possible to somehow preserve or pass the original scope so that AnimatedVisibility becomes a drop in replacement for an if statement
    Doris Liu

    Doris Liu

    1 year ago
    I just wonder if it's possible to somehow preserve or pass the original scope so that AnimatedVisibility becomes a drop in replacement for an if statement
    Thanks. That's good feedback. 🙂 The challenge is that
    Row
    can also have its own arrangement logic such as
    spaceEvenly
    that would only work when it has visibility of all the children. By putting the two children in one
    AnimatedVisiblity
    , Row would only see them as one child. The arrangement therefore will become incorrect. Rather than trying to wrestle
    AnimatedVisibility
    to work in that case, I think it may make more sense to create something like an
    AnimatedRow
    , where both persistent items and transient items can be direct children of it. I'll play with that idea some more when I have time. Please feel free to file a feature request in the meantime.
    m

    Michal Klimczak

    1 year ago
    Sure thing 😃