Bug 764405 - Adjust site identity popup arrow margin to work with new toolbar icon layout. r=sriram

This commit is contained in:
Margaret Leibovic 2012-07-09 15:05:43 -07:00
parent 8f0b4fb245
commit 0c34108df2

View File

@ -39,7 +39,6 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
@ -177,10 +176,12 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
public void onClick(View view) {
int[] lockLocation = new int[2];
view.getLocationOnScreen(lockLocation);
LayoutParams lockLayoutParams = (LayoutParams) view.getLayoutParams();
RelativeLayout.LayoutParams iconsLayoutParams =
(RelativeLayout.LayoutParams) ((View) view.getParent()).getLayoutParams();
// Calculate the left margin for the arrow based on the position of the lock icon.
int leftMargin = lockLocation[0] - lockLayoutParams.rightMargin;
int leftMargin = lockLocation[0] - iconsLayoutParams.rightMargin;
SiteIdentityPopup.getInstance().show(mSiteSecurity, leftMargin);
}
});