m

    Marko Novakovic

    1 year ago
    any ideas on how to prevent this double click navigation?
    Colton Idle

    Colton Idle

    1 year ago
    I'm probably misremembering/misrepresenting this, but I could have sworn that ian lake said that compose nav should make these sorts of double clicks impossible. hmm.
    pepos

    pepos

    1 year ago
    how im handling this: • All user interaction with UI is emitting UiEvents, the class that is receiving this
    UiEvent
    is broadcasting using
    Flow
    to whatever class is interested on the events • I have another class, lets say a navigation manager, that is listening for all the UiEvents coming from UI user interaction, and decides when to perform the navigation action. This class knows that once X navigation is made, it doesn’t need to continue listening for those UiEvents and just ignore the subsequent ones
    Alex Vanyo

    Alex Vanyo

    1 year ago
    One solution (I believe credited to Ian Lake) is checking if the current NavBackStackEntry’s
    Lifecycle
    is resumed, and if not resumed, disregard the request to navigate. Calling
    navController.navigate
    will synchronously update the
    NavBackStackEntry
    to no longer be resumed, which allows handling cases like this where multiple taps happen back-to-back.
    m

    Marko Novakovic

    1 year ago
    @pepos thank you for the suggestion. I has similar idea but it seems a bit off for my usecase
    @Alex Vanyo that is great. thanks