Skip to content

Commit

Permalink
Framework: Fix button label toasts when layout is RTL
Browse files Browse the repository at this point in the history
Google have decided to set their gravity "relatively", while they measure only from the left.
The result? Toasts appearing in the wrong side of the screen.

Change-Id: If5e9d5fc2751fbef3eb058b241168fb9d8bf4b98
  • Loading branch information
or150 authored and AndroidRul3z committed Jan 27, 2013
1 parent f2fc295 commit 0c69a15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/java/android/app/MediaRouteButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public boolean performLongClick() {
Toast cheatSheet = Toast.makeText(context, contentDesc, Toast.LENGTH_SHORT);
if (midy < displayFrame.height()) {
// Show along the top; follow action buttons
cheatSheet.setGravity(Gravity.TOP | Gravity.END,
cheatSheet.setGravity(Gravity.TOP | Gravity.RIGHT,
screenWidth - screenPos[0] - width / 2, height);
} else {
// Show along the bottom center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public boolean onLongClick(View v) {
Toast cheatSheet = Toast.makeText(context, mItemData.getTitle(), Toast.LENGTH_SHORT);
if (midy < displayFrame.height()) {
// Show along the top; follow action buttons
cheatSheet.setGravity(Gravity.TOP | Gravity.END,
cheatSheet.setGravity(Gravity.TOP | Gravity.RIGHT,
screenWidth - screenPos[0] - width / 2, height);
} else {
// Show along the bottom center
Expand Down

0 comments on commit 0c69a15

Please sign in to comment.