Bug 872528: Password doorhanger is not shown in GB. [r=margaret]
authorSriram Ramasubramanian <sriram@mozilla.com>
Thu, 05 Sep 2013 22:28:19 -0700
changeset 146211 4d0f4b412d32131bddfb4c47fd158203d285c072
parent 146210 cca2a6def878aa90a9b69160fda4422ef45da250
child 146212 bbddba8cc6e61b6a7a2f04308697b4ce481ddf77
push id25245
push userryanvm@gmail.com
push dateMon, 09 Sep 2013 20:57:55 +0000
treeherdermozilla-central@a468b2e34b04 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs872528
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 872528: Password doorhanger is not shown in GB. [r=margaret]
mobile/android/base/widget/ArrowPopup.java
--- a/mobile/android/base/widget/ArrowPopup.java
+++ b/mobile/android/base/widget/ArrowPopup.java
@@ -5,16 +5,17 @@
 
 package org.mozilla.gecko.widget;
 
 import org.mozilla.gecko.GeckoApp;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.util.HardwareUtils;
 
 import android.graphics.drawable.BitmapDrawable;
+import android.os.Build;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
 import android.widget.RelativeLayout;
@@ -72,17 +73,26 @@ public class ArrowPopup extends PopupWin
     public void show() {
         int[] anchorLocation = new int[2];
         if (mAnchor != null)
             mAnchor.getLocationInWindow(anchorLocation);
 
         // If there's no anchor or the anchor is out of the window bounds,
         // just show the popup at the top of the gecko app view.
         if (mAnchor == null || anchorLocation[1] < 0) {
-            showAtLocation(mActivity.getView(), Gravity.TOP, 0, 0);
+            final View view = mActivity.getView();
+
+            // Bug in android code causes the window layout parameters to be ignored
+            // when using showAtLocation() in Gingerbread phones.
+            if (Build.VERSION.SDK_INT < 11) {
+                setWidth(view.getWidth());
+                setHeight(view.getHeight());
+            }
+
+            showAtLocation(view, Gravity.TOP, 0, 0);
             return;
         }
 
         // Remove padding from the width of the anchor when calculating the arrow offset.
         int anchorWidth = mAnchor.getWidth() - mAnchor.getPaddingLeft() - mAnchor.getPaddingRight();
         // This is the difference between the edge of the anchor view and the edge of the arrow view.
         // We're making an assumption here that the anchor view is wider than the arrow view.
         int arrowOffset = (anchorWidth - mArrowWidth)/2 + mAnchor.getPaddingLeft();