Commit b8fba63b authored by ekager's avatar ekager Committed by Emily Kager
Browse files

For #9890 - Do not display full screen snackbar with toolbar padding

parent ac3a557d
......@@ -29,7 +29,7 @@ internal fun showSnackBar(view: View, text: String) {
FenixSnackbar.make(
view = view,
duration = FenixSnackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(text)
.show()
......
......@@ -313,7 +313,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
FenixSnackbar.make(
view = view,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(context.getString(R.string.mozac_feature_downloads_could_not_open_file))
.show()
......@@ -785,7 +785,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
FenixSnackbar.make(
view = view,
duration = FenixSnackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(getString(R.string.bookmark_saved_snackbar))
.setAction(getString(R.string.edit_bookmark_snackbar_action)) {
......@@ -837,10 +837,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
private fun fullScreenChanged(inFullScreen: Boolean) {
if (inFullScreen) {
FenixSnackbar.make(
view = view!!,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
)
view = view!!,
duration = Snackbar.LENGTH_SHORT,
isDisplayedWithBrowserToolbar = false
)
.setText(getString(R.string.full_screen_notification))
.show()
activity?.enterToImmersiveMode()
......
......@@ -216,7 +216,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
FenixSnackbar.make(
view = view,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(view.context.getString(R.string.create_collection_tab_saved))
.show()
......
......@@ -22,7 +22,7 @@ class FenixSnackbarDelegate(val view: View) :
FenixSnackbar.make(
view = view,
duration = FenixSnackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(view.context.getString(text))
.setAction(view.context.getString(action)) { listener.invoke(view) }
......@@ -30,7 +30,7 @@ class FenixSnackbarDelegate(val view: View) :
} else {
FenixSnackbar.make(view,
duration = FenixSnackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(view.context.getString(text))
.show()
......
......@@ -100,7 +100,7 @@ class FenixSnackbar private constructor(
view: View,
duration: Int = LENGTH_LONG,
isError: Boolean = false,
isDisplayedOnBrowserFragment: Boolean
isDisplayedWithBrowserToolbar: Boolean
): FenixSnackbar {
val parent = findSuitableParent(view) ?: run {
throw IllegalArgumentException(
......@@ -130,7 +130,7 @@ class FenixSnackbar private constructor(
0,
0,
if (
isDisplayedOnBrowserFragment &&
isDisplayedWithBrowserToolbar &&
shouldUseBottomToolbar &&
// If the view passed in is a ContentFrameLayout, it does not matter
// if the user has a dynamicBottomToolbar or not, as the Android system
......
......@@ -170,7 +170,7 @@ class DefaultBrowserToolbarController(
FenixSnackbar.make(
view = swipeRefresh,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(
swipeRefresh.context.getString(R.string.snackbar_added_to_top_sites)
......@@ -266,7 +266,7 @@ class DefaultBrowserToolbarController(
FenixSnackbar.make(
view = v,
duration = Snackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(v.context.getString(R.string.deleting_browsing_data_in_progress))
}
......
......@@ -111,7 +111,7 @@ class BrowserToolbarView(
FenixSnackbar.make(
view = view,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(view.context.getString(R.string.browser_toolbar_url_copied_to_clipboard_snackbar))
.show()
......
......@@ -89,7 +89,7 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
FenixSnackbar.make(
view = view.swipeRefresh,
duration = FenixSnackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
).apply {
setText(resources.getString(R.string.unknown_scheme_error_message))
setAppropriateBackground(true)
......
......@@ -388,7 +388,7 @@ class HomeFragment : Fragment() {
view?.let {
FenixSnackbar.make(view = it,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(it.context.getString(R.string.onboarding_firefox_account_sync_is_on))
.setAnchorView(toolbarLayout)
......@@ -663,7 +663,7 @@ class HomeFragment : Fragment() {
lifecycleScope,
view?.let { view -> FenixSnackbar.make(
view = view,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
}
)
......@@ -894,7 +894,7 @@ class HomeFragment : Fragment() {
}
FenixSnackbar.make(view = view,
duration = Snackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(view.context.getString(stringRes))
.setAnchorView(snackbarAnchorView)
......@@ -909,7 +909,7 @@ class HomeFragment : Fragment() {
FenixSnackbar.make(
view = view,
duration = Snackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(string)
.setAnchorView(snackbarAnchorView)
......
......@@ -42,7 +42,7 @@ class OnboardingAutomaticSignInViewHolder(private val view: View) : RecyclerView
FenixSnackbar.make(
view = it,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
).setText(
it.context.getString(R.string.onboarding_firefox_account_automatic_signin_failed)
).show()
......
......@@ -91,7 +91,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
snackbar = FenixSnackbar.make(
view = view,
duration = FenixSnackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
),
deleteBookmarkNodes = ::deleteMulti,
invokePendingDeletion = ::invokePendingDeletion
......
......@@ -166,7 +166,7 @@ class EditBookmarkFragment : Fragment(R.layout.fragment_edit_bookmark) {
bookmarkNode?.let { bookmark ->
FenixSnackbar.make(
view = activity.getRootView()!!,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(
getString(
......
......@@ -67,7 +67,7 @@ class HistoryFragment : LibraryPageFragment<HistoryItem>(), UserInteractionHandl
FenixSnackbar.make(
view = view,
duration = FenixSnackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
),
activity?.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager,
::openItem,
......
......@@ -315,7 +315,7 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
FenixSnackbar.make(
view = view!!,
duration = FenixSnackbar.LENGTH_LONG,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(getString(R.string.empty_device_name_error))
.show()
......
......@@ -84,7 +84,7 @@ class TurnOnSyncFragment : Fragment(), AccountObserver {
FenixSnackbar.make(
view = requireView(),
duration = snackbarLength,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(snackbarText)
.show()
......@@ -92,7 +92,7 @@ class TurnOnSyncFragment : Fragment(), AccountObserver {
FenixSnackbar.make(
view = requireView(),
duration = snackbarLength,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(snackbarText)
.show()
......
......@@ -139,7 +139,7 @@ class DeleteBrowsingDataFragment : Fragment(R.layout.fragment_delete_browsing_da
FenixSnackbar.make(
view = requireView(),
duration = FenixSnackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
)
.setText(resources.getString(R.string.preferences_delete_browsing_data_snackbar))
.show()
......
......@@ -184,7 +184,7 @@ class SavedLoginSiteInfoFragment : Fragment(R.layout.fragment_saved_login_site_i
FenixSnackbar.make(
view = it,
duration = Snackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
).setText(copiedItem).show()
}
}
......
......@@ -210,7 +210,7 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen
view?.also {
FenixSnackbar.make(view = it,
duration = FenixSnackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(successMessage)
.show()
......
......@@ -157,7 +157,7 @@ class EditCustomSearchEngineFragment : Fragment(R.layout.fragment_add_search_eng
FenixSnackbar.make(
view = it,
duration = FenixSnackbar.LENGTH_SHORT,
isDisplayedOnBrowserFragment = false
isDisplayedWithBrowserToolbar = false
)
.setText(successMessage)
.show()
......
......@@ -74,7 +74,7 @@ class ShareFragment : AppCompatDialogFragment() {
shareData = shareData,
snackbar = FenixSnackbar.make(
view = requireActivity().getRootView()!!,
isDisplayedOnBrowserFragment = true
isDisplayedWithBrowserToolbar = true
),
navController = findNavController(),
sendTabUseCases = SendTabUseCases(accountManager),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment