nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
216 stars 80 forks source link

fix(tabs): Android, restore state issue with tabs #432

Closed jcassidyav closed 1 year ago

jcassidyav commented 1 year ago

I was able to reproduce #397 by: Enabling in Developer settings on the phone the setting "Don't Keep activities, Destroy every activity as soon as the user leaves it". which I believe simulates the case that Android will kill an activity in the background due to memory pressure

To reproduce the issue:

  1. Set the above developer setting.
  2. Launch the demo-view app.
  3. Goto Tabs
  4. Send it to the backgound.
  5. Bring it into foreground again.

While this solves particular case, there appears to be similar issues in other scenarios which this does not address,

e.g. ( after this fix is applied)

  1. Launch the demo-view app.
  2. Goto Tabs
  3. Send it to the backgound.
  4. Bring it into foreground again.
  5. navigate back to the menu.
  6. navigate to Tabs again
  7. Send it to the backgound.
  8. Bring it into foreground again.
farfromrefug commented 1 year ago

@jcassidyav thanks for this. Dont really have the time to test it though. I will release it though Will try to take a look at this later. THanks