After trying to restart the Refresh animation in the MapFragment class after multiple clicks of the Refresh icon, it became clear that the proper way to handle it will require architecture changes. One suggestion I found was to use actors in the backend or ViewModel to maintain state and prevent multiple calls to the Refresh action.
Using the CONFLATED property, we can ensure that the latest call is the only call being processed.
After trying to restart the
Refresh
animation in theMapFragment
class after multiple clicks of theRefresh
icon, it became clear that the proper way to handle it will require architecture changes. One suggestion I found was to useactor
s in the backend orViewModel
to maintain state and prevent multiple calls to theRefresh
action.Using the
CONFLATED
property, we can ensure that the latest call is the only call being processed.Helpful Links
actor
documentationactor
to reset animationRetroFit
andRepository
using pre-1.0 Coroutines