Merge "Arrow popup - adjust margin to account for RTL and LTR." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-30 00:05:27 +00:00
committed by Android (Google) Code Review

View File

@@ -148,6 +148,10 @@ public class ArrowTipView extends AbstractFloatingView {
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) findViewById(
R.id.arrow).getLayoutParams();
lp.gravity = gravity;
if (parent.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
arrowMarginStart = parent.getMeasuredWidth() - arrowMarginStart;
}
if (gravity == Gravity.END) {
lp.setMarginEnd(parent.getMeasuredWidth() - arrowMarginStart);
} else if (gravity == Gravity.START) {