[fenix] For 5092 - Show a Snackbar with retry option if sharing to devices fails...
commit78412583d56bf6a8b15393cdc3ff9dca176972ef
authorMugurell <Mugurell@users.noreply.github.com>
Thu, 26 Sep 2019 19:30:28 +0000 (26 22:30 +0300)
committerSawyer Blatz <sdblatz@gmail.com>
Thu, 26 Sep 2019 19:30:28 +0000 (26 12:30 -0700)
tree0a0a44686a4a11ba853dacb5f33d253caba9d1ed
parentdf318f9470211afa0bae5dbe13f258d1c7f725cd
[fenix] For 5092 - Show a Snackbar with retry option if sharing to devices fails (https://github.com/mozilla-mobile/fenix/pull/5158)

* For https://github.com/mozilla-mobile/fenix/issues/5092 - Show a Snackbar with retry option if sharing to devices fails

ShareController will contain all the business logic for checking the result
status of the `share to device` operations. When this fails it will show a
snackbar which also offer the possibility to retry the just failed operation.
To allow this even in the event the user has closed the share fragment we'll
use a GlobalScope's coroutine.
Refactored out the TabsSharedCallback from ShareFragment because otherwise we
would have neede to sent through that the just failed operation. After the
refactor the ShareController is solely responsable for showing the right
snackbar and handling the retry actions.

* For https://github.com/mozilla-mobile/fenix/issues/5092 - Refactor ShareControllerTest

* For https://github.com/mozilla-mobile/fenix/issues/5092: Adds color theming of snackbars
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/share/ShareController.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/share/ShareFragment.kt
mobile/android/fenix/app/src/main/res/drawable/fenix_snackbar_error_background.xml [new file with mode: 0644]
mobile/android/fenix/app/src/main/res/layout/fenix_snackbar.xml
mobile/android/fenix/app/src/main/res/values/colors.xml
mobile/android/fenix/app/src/main/res/values/strings.xml
mobile/android/fenix/app/src/test/java/org/mozilla/fenix/share/ShareControllerTest.kt