Post

Replies

Boosts

Views

Activity

Widget loader/redact on fetch from server
I have a widget that displays data which is fetched from the server asynchronously. The widget contains a refresh button. The data is refreshed either when the app goes to the background of when the user taps the refresh button (timeline policy is .never) Since the request may take more than 2 seconds, I would like to display a redact effect until the data is returned. Lets say the timeline entry contains isRedact property. I would like to see the following happen: 1a. user taps refresh button 1b. widget is redrawn with redact state do to entry.isRedact=true 2a. data is fetched asynchronously 2b. on return widget is redrawn without redact state do to entry.isRedact=false From what I understand, the widget is re-drawn only as a result of getTimeline entries, so I don't understand how to make 1b happen, since 1b is an entry that can be created immediately but 2b entry can only happen async Of course there might be another way to redraw a widget that I don't know.
4
0
291
Sep ’24