title: TextView moving out of screen in RTL Layout in RelativeLayout - Android
body: <p>I have a text view inside a RelativeLayout. It's working fine in LTR layout. But when I change it to RTL the view inside a RelativeLayout moves out of visible screen. I was checking it in Layout inspector and I could see it being out of the screen visible area. The view is visible but it's not in the screen.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:fillViewport=&quot;true&quot;
      android:scrollbars=&quot;none&quot;&gt;
  
      &lt;LinearLayout
          android:id=&quot;@+id/empty&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_gravity=&quot;center_vertical&quot;
          android:gravity=&quot;center&quot;
          android:orientation=&quot;vertical&quot;&gt;
  
          &lt;androidx.appcompat.widget.AppCompatImageView
              android:id=&quot;@+id/icon&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;@drawable/ic_empty&quot;
              android:layout_gravity=&quot;center&quot; /&gt;
  
  
          &lt;TextView
              android:id=&quot;@+id/empty_text&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:paddingLeft=&quot;16dp&quot;
              android:paddingTop=&quot;12dp&quot;
              android:paddingRight=&quot;16dp&quot;
              android:textAlignment=&quot;center&quot;
              android:textColor=&quot;@color/data_color&quot;
              android:textSize=&quot;@dimen/text_medium&quot;
              android:gravity=&quot;center_horizontal&quot; /&gt;
  
          &lt;RelativeLayout
              android:id=&quot;@+id/refresh&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;center_horizontal&quot;
              android:clickable=&quot;true&quot;
              android:focusable=&quot;true&quot;
              android:focusableInTouchMode=&quot;true&quot;
              android:minHeight=&quot;40dp&quot;&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/refresh_text&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_centerInParent=&quot;true&quot;
                  android:layout_centerHorizontal=&quot;true&quot;
                  android:layout_centerVertical=&quot;true&quot;
                  android:gravity=&quot;center&quot;
                  android:text=&quot;@string/refresh&quot; /&gt;
  
              &lt;ProgressBar
                  android:id=&quot;@+id/progress&quot;
                  android:layout_width=&quot;@dimen/progressbar_width&quot;
                  android:layout_height=&quot;@dimen/progressbar_height&quot;
                  android:layout_centerInParent=&quot;true&quot;
                  android:indeterminate=&quot;true&quot;
                  android:visibility=&quot;gone&quot; /&gt;
          &lt;/RelativeLayout&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  <p>refresh_text is the TextView which is moving out of the visible region.</p>