Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3f0c744 authored by Or Harambam's avatar Or Harambam Committed by Ricardo Cerqueira
Browse files

Framework: Fix button label toasts when layout is RTL

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
parent 5bab242a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ public class MediaRouteButton extends View {
        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
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ public class ActionMenuItemView extends TextView
        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