wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.96k stars 1.31k forks source link

Toasts are not centered since Android 11 #16074

Open antonis opened 2 years ago

antonis commented 2 years ago

Expected behavior

Toasts across the app are centered unless this is defined explicitly.

Actual behavior

Since Android 11 the Toast gravity setter has no effect and the Toasts are positioned at the bottom of the screen. In some cases this may result in actionable buttons being inaccessible for the short time when the Toast is visible.

Before Android 11 After Android 11
154718517-efcaf44c-3e95-4495-841e-274bd0cf2b5a screenshot_20220308-151725

Internal ref p5T066-33e-p2#comment-11570

Tested on Pixel 5, Android 12, WPAndroid 19.4
antonis commented 2 years ago

I did a short research and I don't think there is a clear way to resolve this. This article sums up the options to move forward with an Android Toast. An alternative would be to use a SnackBar and it will also achieve a more consistent UI across the app using the SnackbarSequencer

dangermattic commented 2 months ago

Thanks for reporting! 👍