summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurimas Liutikas <aurimas@google.com>2014-11-14 16:05:43 -0800
committerAurimas Liutikas <aurimas@google.com>2014-11-15 00:07:12 +0000
commit983c03dfc559205670b7b105f49c121a78e697c9 (patch)
tree3aa41b61375d6160e62a2c1a3190eef49a8eeeb3
parentbfaccef74b036c18186ee65acba455569824520f (diff)
downloadchromium_src-983c03dfc559205670b7b105f49c121a78e697c9.zip
chromium_src-983c03dfc559205670b7b105f49c121a78e697c9.tar.gz
chromium_src-983c03dfc559205670b7b105f49c121a78e697c9.tar.bz2
Fix DropdownPopupWindow positioning on Android L.
Android L randomly changed the default vertical offset for ListPopupWindow to -10dp by changing Widget.ListPopupWindow style to set dropDownVerticalOffset to -10dp. This CL sets it explictly to the padding of our background image. BUG=419444 TBR=newt@chromium.org Review URL: https://codereview.chromium.org/723843002 Cr-Commit-Position: refs/heads/master@{#303995} Review URL: https://codereview.chromium.org/728053002 Cr-Commit-Position: refs/branch-heads/2214@{#55} Cr-Branched-From: 03655fd3f6d72165dc3c9bd2c89807305316fe6c-refs/heads/master@{#303346}
-rw-r--r--ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java b/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
index b80de90..c1056b0 100644
--- a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
+++ b/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
@@ -74,6 +74,9 @@ public class DropdownPopupWindow extends ListPopupWindow {
});
setAnchorView(mAnchorView);
+ Rect originalPadding = new Rect();
+ getBackground().getPadding(originalPadding);
+ setVerticalOffset(-originalPadding.top);
}
/**
@@ -111,8 +114,8 @@ public class DropdownPopupWindow extends ListPopupWindow {
setInputMethodMode(INPUT_METHOD_NEEDED);
int contentWidth = measureContentWidth();
- float contentWidthInDip = contentWidth /
- mContext.getResources().getDisplayMetrics().density;
+ float contentWidthInDip = contentWidth
+ / mContext.getResources().getDisplayMetrics().density;
if (contentWidthInDip > mAnchorWidth) {
setContentWidth(contentWidth);
final Rect displayFrame = new Rect();