From 267cf35edbc7757de3d3ea9adcaba1c772e36fba Mon Sep 17 00:00:00 2001 From: David Walsh Date: Thu, 28 May 2020 13:31:05 -0500 Subject: [PATCH] For 11001 - Show close all tabs above tab tray --- .../java/org/mozilla/fenix/browser/BaseBrowserFragment.kt | 5 +++-- app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 31f830558..f7eb36a08 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -261,14 +261,14 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session } viewLifecycleOwner.lifecycleScope.allowUndo( - requireView(), + tabTrayDialog.requireView(), snackbarMessage, getString(R.string.snackbar_deleted_undo), { sessionManager.restore(snapshot) }, operation = { }, - anchorView = view.tabs_header + elevation = SNACKBAR_ELEVATION ) } @@ -1072,5 +1072,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session private const val REQUEST_CODE_DOWNLOAD_PERMISSIONS = 1 private const val REQUEST_CODE_PROMPT_PERMISSIONS = 2 private const val REQUEST_CODE_APP_PERMISSIONS = 3 + private const val SNACKBAR_ELEVATION = 80f } } diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index ccaf1c4b4..c915f4507 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -46,7 +46,6 @@ import com.google.android.material.appbar.AppBarLayout import com.google.android.material.snackbar.Snackbar import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_home.view.* -import kotlinx.android.synthetic.main.tab_header.view.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main @@ -1075,14 +1074,14 @@ class HomeFragment : Fragment() { } viewLifecycleOwner.lifecycleScope.allowUndo( - requireView(), + tabTrayDialog.requireView(), snackbarMessage, getString(R.string.snackbar_deleted_undo), { sessionManager.restore(snapshot) }, operation = { }, - anchorView = view?.tabs_header + elevation = SNACKBAR_ELEVATION ) } @@ -1130,6 +1129,8 @@ class HomeFragment : Fragment() { // Layout private const val HEADER_MARGIN = 60 + + private const val SNACKBAR_ELEVATION = 80f } }