opendatacam / opendatacam-mobile

OpenDataCam mobile app for android
https://play.google.com/store/apps/details?id=com.opendatacam
MIT License
12 stars 3 forks source link

Init screen #15

Open tdurand opened 3 years ago

tdurand commented 3 years ago

Note for my future self 😁

I added the loading screen so now we have a much cleaner experience.. the transition is still not very very good when we are loading the localhost:8080 view (the app) once the node.js app has started.. there is a quick flicker of 1 second where we jump from the "fake" loading screen (a simple index.html file) to the "real" one served by node.

the solution for this is to entirely get rid of the "real" loading screen as when node.js has started on Android YOLO has already started so we could directly render the main UI ..

But cause of some shortcut I took in the implementation this is not super straightforward to do.. as we expect that the main UI is rendered on the client and not on the server / or on a static generation.. there is some reliance on the window object that needs to be removed and then we could bypass it.

See some window reliance : https://github.com/opendatacam/opendatacam/blob/master/utils/colors.js#L29

Then we should be able to set true to isListeningToYOLO at init: https://github.com/opendatacam/opendatacam/blob/master/statemanagement/app/AppStateManagement.js#L30 , and it should render the UI : https://github.com/opendatacam/opendatacam/blob/master/components/MainPage.js#L92

tdurand commented 3 years ago