Skip to content
Commit 7b843abc authored by Bernardo Rufino's avatar Bernardo Rufino
Browse files

Deprecate custom toasts

Deprecating custom toasts as discussed, the reasons are:
* We're blocking background custom toasts for security reasons
(go/toast-abuse).
* This means custom toasts are only possible if the app is in the
foreground. In the foreground the app has control over its own view
hierarchy and is capable of creating any visual elements it would
otherwise use custom toasts for.
* If we were to declare ongoing support for foreground toasts the
developer would be in a situation where they either check for
foreground status of the app before posting a custom toast or they
accept that the information they want to display may not be shown at
all. This is not great.
* There is also a desire to avoid custom toasts altogether since they
hurt UX consistency
(https://docs.google.com/presentation/d/1r5WEofZ_G3B9M65nS37uD4RqA4iV9HUmngyE6ZpBSsw/edit#slide=id.g7b69852da2_0_0).

Also added a recommendation to use Snackbars while the app is in the
foreground.

Bug: 128611929
Bug: 144754526
Test: Builds
Test: atest android.widget.cts.ToastTest
Change-Id: I4ed0bd671e308491590c28ff24087c76d0623f13
parent adb9ce4f
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