Thread
#compose
    Adriano Celentano

    Adriano Celentano

    1 year ago
    Is it possible to know the ime padding before the ime is shown ? would be cool to use the keyboard as source of truth for animations.
    jim

    jim

    1 year ago
    cc @Sean McQuillan [G]
    Sean McQuillan [G]

    Sean McQuillan [G]

    1 year ago
    Your best bet for accurate information is insets https://github.com/chrisbanes/accompanist/tree/main/insets
    Adriano Celentano

    Adriano Celentano

    1 year ago
    is it possible to know the insets padding of ime before the ime is shown ? so i could interpolate other animation depending on the max ime padding, when the keyboard becomes visible
    Sean McQuillan [G]

    Sean McQuillan [G]

    1 year ago
    Not sure what's possible. maybe @cb ^
    Adriano Celentano

    Adriano Celentano

    1 year ago
    thats a nice blogpost, i didnt see it before. But as i get its also reacting to the changing padding, like the accompanist abstraction. I guess what i had in mind is not possible yet. Maybe one day 🤞
    cb

    cb

    1 year ago
    Can you go into more detail of what you want to do?
    Sounds a bit like you’re trying to implement transition?
    Adriano Celentano

    Adriano Celentano

    1 year ago
    I basically just want a float from 0 to 1, which is updating while the keyboard animates in or out. keyboard completely visible would be 1 and invisible would be 0. My use case is I want to drive this animations based on the state of the keyboard animation.https://twitter.com/SophosAdriano/status/1366418357646483462?s=19
    cb

    cb

    1 year ago
    Ah, well the
    WindowInsetsAnimation
    APIs have exactly that: https://developer.android.com/reference/android/view/WindowInsetsAnimation#getFraction()
    You'll need to do all of wiring up yourself right now, although I could expose this value in Accompanist.
    Thinking about it, I should probably expose both the 'animated' insets, the 'layout' insets, and the animated progress. For this example, you'd only want the 'layout' insets and the progress
    Adriano Celentano

    Adriano Celentano

    1 year ago
    awesome 🎉 looking forward to dig into that, thank you 🙏
    cb

    cb

    1 year ago
    FYI, this landed in Accompanist 0.7.0. You can now fetch the layout insets, animation insets, and the fraction/progress: https://github.com/google/accompanist/pull/242