EyeSeeTea / pictureapp

Mobile application designed to report cases of malaria (to a DHIS2 server)
GNU General Public License v3.0
4 stars 4 forks source link

Maintenance show webview timeouts only if tab is visible #2410

Closed xurxodev closed 5 years ago

xurxodev commented 5 years ago

:pushpin: References

:tophat: What is the goal?

Do not show the timeout message if this web view is not visible

:gear: branches

app: Origin: maintenance-show_webview_timeouts_only_if_tab_is_visible Target: v1.4_connect bugshaker-android: Origin: downgrade_gradle_version EyeSeeTea-sdk: Origin: Development

:memo: How is it being implemented?

I have had problems to apply simple solutions for the use of deprecated fragments and our use of fragment and tabs with all fragment loaded.

I have tried several approaches but finally for all the above mentioned I had to use the option to use DashboardActivity in a static way. It is not my preferred solution but it is the only one that has worked.

I save de current fragment when a fragment replacement occurs and then verify from WebViewFragment before to show timeout message against this saved current fragment in DasboardActivity to know if It's visible.

:boom: How can it be tested?

Change web_view_timeout_millis in donottranslate.xml to lower value

Use Case 1: Start the app and timeout message should only appear if the current tab is the WebViewFragment

:floppy_disk: Requires DB migration?

:art: UI changes?