Maryam Alhuthayfi [MOD]

    Maryam Alhuthayfi [MOD]

    1 year ago
    Hi! I built an app using Compose completely. It is sort of a simple game though. My question here is: I have multiple cards and those cards are swiped until the end. At the very end, there is a button to play again. I cannot find any samples on how to draw the cards again on the screen. How can I do that?
    j

    Jordi Saumell

    1 year ago
    if you draw cards based on a state like an observable with the list of cards, you would just need to add the cards again to the list.
    Maryam Alhuthayfi [MOD]

    Maryam Alhuthayfi [MOD]

    1 year ago
    I did attach a remember-state to the current item of the list. The list of cards are drawn once the app is launched. The list is full and I can do all sort of operations to each index, even if the cards disappeared from the screen. With that in mind, once the cards are empty (disappeared from the screen) I don’t know how to redraw them again using the onClick event in “play-again” button. I did try your suggestion to make the whole thing recompose itself and it did recompose and the state changed with the values of the list but did not show the cards since I apparently need to draw the cards first.