Merge "PopupWindow: Be more consistent about Gravity calculation." into nyc-mr1-dev