blonsky95 / TimeStopperAndroid

0 stars 0 forks source link

Create a home screen when no media loaded #16

Closed blonsky95 closed 3 years ago

blonsky95 commented 3 years ago

When no video is loaded (when first opening app) display a fragment over main_activity with just a import video button

To control fragment visibility, when a media is loaded, hide the fragment

Check in on resume if a media is loaded and do fragment

blonsky95 commented 3 years ago

This is working - but at a cost - https://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html I am commiting the start fragment hide transaction with a commitAllowingStateLoss call, meaning that this transaction is not being stored in state, ergo, if the user leaves the app, and it gets destroyed by android, when he navigates back and android tries to restore the saved state, there might be no trace of this transaction, so worst case scenario I would have my start fragment there.

However, in onCreate, I do a check for saved instance state, and if there is (isnt null), it wont place the start fragment there, this also ensures that it doesnt not add fragments on top of each other every time