sthewissen / MVP

Unofficial app to help MVPs manage their community activities
GNU General Public License v3.0
111 stars 31 forks source link

Move RefreshView up in view hierarchy to avoid crashes on Android #132

Closed krdmllr closed 2 years ago

krdmllr commented 3 years ago

Fixes #123 (or atleast gives a clue what the issue is)

After some investigation, I found that the crash is caused by the

<xct:StateView StateKey="Loading"
                                       RepeatCount="3"
                                       Template="{StaticResource contribution_item_loading}" />

beeing toggled during the refresh task. I dont know exactly why it causes a crash in the RefreshView, I suspect since it changes the view tree while the refresh view is active.

I found that simply moving the refresh view to be the parent of both the collection and stateview mitgates this issue (only tested on a hardware pixel 3a).

This will ofcouse stop the StateView from overlapping the RefreshView, I'm not sure if thats okay or destroys the desired UI. If not, I hope this atleast helps in identifing the underlying issue.