PopupWindow: Be more consistent about Gravity calculation.
am: 798fb79866

Change-Id: Ia7c49dbe2fbe751565d6c8be46586a66c535a148