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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java

Issue 421173002: Paste PopupMenu gets cropped by StatusBar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified line indentations Created 6 years, 5 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java b/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java
index 0745d207edb7da317513c811b2d5eafad3224367..b2127709b32de3fe024bd79f46e2eb7e17280e3f 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/PastePopupMenu.java
@@ -27,6 +27,7 @@ public class PastePopupMenu implements OnClickListener {
private int mRawPositionY;
private int mPositionX;
private int mPositionY;
+ private int mStatusBarHeight;
private final View[] mPasteViews;
private final int[] mPasteViewLayouts;
private final int mLineOffsetY;
@@ -81,6 +82,13 @@ public class PastePopupMenu implements OnClickListener {
5.0f, mContext.getResources().getDisplayMetrics());
mWidthOffsetX = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
30.0f, mContext.getResources().getDisplayMetrics());
+
+ final int statusBarHeightResourceId =
+ mContext.getResources().getIdentifier("status_bar_height", "dimen", "android");
+ if (statusBarHeightResourceId > 0) {
+ mStatusBarHeight =
+ mContext.getResources().getDimensionPixelSize(statusBarHeightResourceId);
+ }
}
/**
@@ -131,8 +139,13 @@ public class PastePopupMenu implements OnClickListener {
coords[0] += mPositionX;
coords[1] += mPositionY;
+ int minOffsetY = 0;
+ if (mParent.getSystemUiVisibility() == View.SYSTEM_UI_FLAG_VISIBLE) {
+ minOffsetY = mStatusBarHeight;
+ }
+
final int screenWidth = mContext.getResources().getDisplayMetrics().widthPixels;
- if (coords[1] < 0) {
+ if (coords[1] < minOffsetY) {
updateContent(false);
// Update dimensions from new view
contentView = mContainer.getContentView();
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698