Dismiss snackbar when user taps outside

VERIFIED FIXED in Firefox 45

Status

()

VERIFIED FIXED
3 years ago
3 years ago

People

(Reporter: Margaret, Assigned: sebastian)

Tracking

(Blocks: 1 bug)

35 Branch
Firefox 46
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox45 verified, firefox46 verified, fennec45+)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Right now the user has to wait for the timeout for the snackbar to go away. Let's make it go away as soon as they start interacting with other parts of the UI, the way our button toasts used to behave.
(Reporter)

Updated

3 years ago
See Also: → bug 1226874

Updated

3 years ago
Blocks: 1157964
(Assignee)

Comment 1

3 years ago
Created attachment 8700043 [details]
MozReview Request: Bug 1233467 - Dismiss snackbar when user taps outside. r?mcomella

Review commit: https://reviewboard.mozilla.org/r/28529/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/28529/
Attachment #8700043 - Flags: review?(michael.l.comella)
(Assignee)

Updated

3 years ago
Assignee: nobody → s.kaspari
Status: NEW → ASSIGNED
Comment on attachment 8700043 [details]
MozReview Request: Bug 1233467 - Dismiss snackbar when user taps outside. r?mcomella

https://reviewboard.mozilla.org/r/28529/#review25603

::: mobile/android/base/java/org/mozilla/gecko/BrowserApp.java:2683
(Diff revision 1)
>      private class HideOnTouchListener implements TouchEventInterceptor {

It looks like this listener occurs on `R.id.main_layout` but there are a few views which do not fall inside of it – `R.id.tabs_panel` and `R.id.tab_history_panel`. Have you tested to ensure SnackBars are dismissable in this fashion when clicking on these views? It's possible the touch events fall through.
Attachment #8700043 - Flags: review?(michael.l.comella) → review+
(Assignee)

Comment 3

3 years ago
(In reply to Michael Comella (:mcomella) from comment #2)
> It looks like this listener occurs on `R.id.main_layout` but there are a few
> views which do not fall inside of it – `R.id.tabs_panel` and
> `R.id.tab_history_panel`. Have you tested to ensure SnackBars are
> dismissable in this fashion when clicking on these views? It's possible the
> touch events fall through.

Yeah, it still works in the tabs panel: The view is not a child of the main layout but the touch event will still be received by main layout because it fills the whole screen. onInterceptTouchEvent() will be called before any other view can handle the touch event in onTouch().

Comment 5

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c0780b68dfcc
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox46: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
(Reporter)

Comment 6

3 years ago
Let's see if we can uplift this to go with the rest of the snackbar changes in 45.
tracking-fennec: --- → 45+
(Assignee)

Comment 7

3 years ago
NI to request uplift
Flags: needinfo?(s.kaspari)
(Assignee)

Comment 8

3 years ago
Comment on attachment 8700043 [details]
MozReview Request: Bug 1233467 - Dismiss snackbar when user taps outside. r?mcomella

Approval Request Comment

[Feature/regressing bug #]: Snackbars have been introduced app-wide in Firefox 45. See bug 1157526 and follow-ups.

[User impact if declined]: In some situations a snackbar covers content inconveniently. Up to now there has been no way to dismiss a snackbar and you had to wait for the timeout (~2-3 seconds). With this patch the snackbar is automatically dismissed if the user taps anywhere else.

[Describe test coverage new/current, TreeHerder]: Manual testing.

[Risks and why]: Low. Code already existed for handling toasts. I just added the call to dismiss the snackbar to this code.

[String/UUID change made/needed]:
Flags: needinfo?(s.kaspari)
Attachment #8700043 - Flags: approval-mozilla-aurora?
Tested using:
Device: Nexus 7 (Android 5.1.1)
Build: Firefox for Android 46.0a1 (2016-01-06)

Snackbar is not dismissed when the user taps outside in these cases:
- bookmark is updated 
- page is removed from home panels 

Snackbar is dismissed when the user taps outside in these cases:
- choosing to open a page in "Open in New Tab" / "Open in Private Tab" 
- downloading/installing an add-on 
- adding/removing a page to reading list 
- unblocking image 
- adding/removing a bookmark 
- a text is copied 
- a download begins 
- a page is printed 
- a search engine is added 
- a link is bookmarked
- an already bookmark is added as bookmark
(Assignee)

Comment 10

3 years ago
(In reply to Teodora Vermesan (:TeoVermesan) from comment #9)
> Tested using:
> Device: Nexus 7 (Android 5.1.1)
> Build: Firefox for Android 46.0a1 (2016-01-06)
> 
> Snackbar is not dismissed when the user taps outside in these cases:
> - bookmark is updated 
> - page is removed from home panels 

This should be fixed after fixing the root cause in bug 1234295 (Some snackbars are created independently from BrowserApp and therefore the code in BrowserApp can't dismiss them).
status-firefox45: --- → affected
Comment on attachment 8700043 [details]
MozReview Request: Bug 1233467 - Dismiss snackbar when user taps outside. r?mcomella

Polish, taking it.
Attachment #8700043 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+

Comment 12

3 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-aurora/rev/1c893036edaa
status-firefox45: affected → fixed
Snackbars are dismissed when the user taps outside, so:
Verified as fixed using:
Device: One A2001 (Android 5.1.1) 
Build: Firefox for Android 46.0a2 (2016-02-16)
status-firefox46: fixed → verified
Snackbars are dismissed when the user taps outside, so:
Verified as fixed using:
Device: Nexus 6 (Android 6.0)
Build: Firefox for Android 45.0b9 build 2
Status: RESOLVED → VERIFIED
status-firefox45: fixed → verified
You need to log in before you can comment on or make changes to this bug.