wordpress-mobile / wordpress-mobile/WordPress-Android

Toasts are not centered since Android 11

Open
#16,074 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Medium [Type] Bug Tech Debt UI
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The toast behavior is referenced in WordPressUtils/src/main/java/org/wordpress/android/util/ToastUtils.java; start there and compare Android's Toast.setGravity behavior on Android 11+. Reproduce on a Pixel 5 with Android 12 and verify that app toasts remain centered without obscuring actionable buttons.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.