OSDN Git Service

Fix location for ActionMenuItemView cheat sheet
authorChris Banes <chrisbanes@google.com>
Mon, 8 Jun 2015 12:36:24 +0000 (13:36 +0100)
committerChris Banes <chrisbanes@google.com>
Mon, 8 Jun 2015 12:36:24 +0000 (13:36 +0100)
Currently handling does not take the screen position into
account.

BUG: 21690674
Change-Id: I7e957d453bffd5c9bf5ac61a17fcab7d00fec5b6

core/java/com/android/internal/view/menu/ActionMenuItemView.java

index f75b139..8db363d 100644 (file)
@@ -273,7 +273,8 @@ 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, referenceX, height);
+            cheatSheet.setGravity(Gravity.TOP | Gravity.END, referenceX,
+                    screenPos[1] + height - displayFrame.top);
         } else {
             // Show along the bottom center
             cheatSheet.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, height);