Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1082)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java

Issue 2891773003: [Android] Don't increase app menu height when at bottom pre-N (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
index 4631ee96f4f97274facaf241268a7c604d502b86..ef9fc24da524639570a69e0874f0ebad730cde96 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
@@ -440,9 +440,15 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
View anchorView = mPopup.getAnchorView();
anchorView.getLocationInWindow(mTempLocation);
int anchorViewY = mTempLocation[1] - appDimensions.top;
- if (isAnchorAtBottom(anchorView, appDimensions)) {
+
+ // The framework's PopupWindow positioning changed between N and M. Pre-N, increasing the
+ // height here causes the menu to be cut-off in landscape mode. See crbug.com/722105.
+ // TODO(twellington): stop using ListPopupWindow for the app menu.
+ if (isAnchorAtBottom(anchorView, appDimensions)
+ && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
anchorViewY += mPopup.getAnchorView().getHeight();
}
+
int anchorViewImpactHeight = mIsByPermanentButton ? anchorView.getHeight() : 0;
// Set appDimensions.height() for abnormal anchorViewLocation.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698