title: Android RTL Text Direction
body: <p>I am attempting support RTL locales in my application however I ran into the following issue. Now I say issue but it might not even be an issue due to my unfamiliarity of RTL locales so here it goes. </p>
  
  <p>Below are 3 text views. Note the following outputs have been made with RTL forced on via the dev option.</p>
  
  <p><strong>Test In English LTR</strong></p>
  
  <p><a href="https://i.stack.imgur.com/StKdN.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/StKdN.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Test In English RTL Forced</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Q8tz1.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Q8tz1.jpg" alt="enter image description here"></a></p>
  
  <p>I found it strange that it didn't align to the right even though I said <code>android:gravity="start"</code> like how it works with padding and margin etc. so I looked at other answers and came across <code>android:textDirection="locale"</code>.</p>
  
  <p><strong>Test In English RTL Forced Using Text Direction Locale</strong></p>
  
  <p><a href="https://i.stack.imgur.com/i7dzO.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/i7dzO.jpg" alt="enter image description here"></a></p>
  
  <p>Now this is mirroring correctly on both LTR and RTL but then I noticed the following behaviour with the punctuation. This raised a eyebrow whether or not this is correct because I was comparing with Google Play Store, Facebook and Whats App with RTL forced and I did not see this when looking at paragraphs with punctuation which makes me believe I did something wrong.</p>
  
  <p><strong>Full Layout Code</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context=".MainActivity"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:gravity="start"
          android:text="@string/test_one"
          android:textColor="@android:color/black"
          android:textDirection="locale"
          android:textSize="24sp" /&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="10dp"
          android:gravity="start"
          android:text="@string/test_two"
          android:textColor="@android:color/black"
          android:textDirection="locale"
          android:textSize="24sp" /&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="10dp"
          android:gravity="start"
          android:text="@string/test_three"
          android:textColor="@android:color/black"
          android:textDirection="locale"
          android:textSize="24sp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Other code</strong></p>
  
  <p>The following is set in my manifest file</p>
  
  <pre><code> android:supportsRtl="true"
  </code></pre>
  
  <p>And this is my strings</p>
  
  <pre><code>&lt;string name="test_one"&gt;Good Job. You did well!&lt;/string&gt;
  &lt;string name="test_two"&gt;3 hours ago&lt;/string&gt;
  &lt;string name="test_three"&gt;Select Option:&lt;/string&gt;
  </code></pre>
  
  <p>Please forgive how naive this might be sounding and enlighten me! I wish to provide comfortable RTL support!</p>