[fenix] Bug 1812518 - Show the download dialog as an Android View
commit76bb2c81b667127675c0b2e75e8237601cfcd3ef
authorMugurell <Mugurell@users.noreply.github.com>
Wed, 18 Jan 2023 11:05:39 +0000 (18 13:05 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 26 Jan 2023 14:43:04 +0000 (26 14:43 +0000)
tree57ca6a392077676bf0b5e88aa162dff519044096
parent11404a576be777fe5ef782a59876f364b6033436
[fenix] Bug 1812518 - Show the download dialog as an Android View

Tried to mimic the UX of a modal dialog while using Android Views.
This meant including a scrim that would consume all touches and theming the
navigation bar and status bar.
Avoiding a dialog and a separate window will allow the snackbar to see the
new "dialog" as a sibling in a CoordinatorLayout parent and so be able to
position itself based on the new "dialog".
This patch also added "start_download_dialog_layout" from A-C as it leads to
simpler and less code needed to style the layout - colors / shapes with
everything happening in XML versus calculating the values then setting them
programatically.
12 files changed:
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/FenixSnackbarBehavior.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/downloads/StartDownloadDialog.kt [new file with mode: 0644]
mobile/android/fenix/app/src/main/res/drawable/download_dialog_download_button_background.xml [new file with mode: 0644]
mobile/android/fenix/app/src/main/res/layout/dialog_scrim.xml [new file with mode: 0644]
mobile/android/fenix/app/src/main/res/layout/fragment_browser.xml
mobile/android/fenix/app/src/main/res/layout/start_download_dialog_layout.xml [new file with mode: 0644]
mobile/android/fenix/app/src/main/res/values/colors.xml
mobile/android/fenix/app/src/main/res/values/dimens.xml
mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/FenixSnackbarBehaviorTest.kt
mobile/android/fenix/app/src/test/java/org/mozilla/fenix/downloads/FirstPartyDownloadDialogTest.kt [new file with mode: 0644]
mobile/android/fenix/app/src/test/java/org/mozilla/fenix/downloads/StartDownloadDialogTest.kt [new file with mode: 0644]