Fix RTL issue in RelativeLayout

A long-standing bug in RelativeLayout meant that items inside a
RelativeLayout with layout centering (layout_centerHorizontal)
and WRAP_CONTENT would cause the surrounding RelativeLayout to be
sized incorrectly, resulting in bad layouts overall (the RelativeLayout
could end up much too large, pushing other layouts out of view). This
artifact was visible in TimePicker in landscape mode, but worked
around in the O release by forcing LTR on the parent layout of the
RelativeLayout.

The problem was that the case of center/wrap would end up positioning
the view on the left of the layout, instead of the RTL-friendly right
side. The fix is to do the correct thing in RTL mode (position relative
to the right side of the layout instead).

Bug: 63003526  TimePicker RTL issue
Bug: 62846484  TimePicker layout is broken in RTL landscape mode
Test: manual (run Clock app in RTL and non-RTL modes and observe layout behavior in
both portrait and landscape modes).

Change-Id: I9033857a39f422e3d6fb6e4d313d1739ae3f5c63
2 files changed