title: How to set gravity for each line in android textview?
body: <p>I have a String that contains English and Persian. I want if a line starts with Persian charachter then this line is displaied right to left in text view and if a line starts with English Character then this line is displaied left to right.</p>
  
  <p>Note: I want to set gravity/direction for each line in text view.</p>
  
  <p>How to implement it in android textview.</p>
  
  <p>this is my textview xml code:</p>
  
  <pre><code>    &lt;TextView
          android:id="@+id/textViewContent"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentRight="true"
          android:autoLink="web"
          android:layoutDirection="rtl"
          android:gravity="start"
          android:layout_gravity="start"
          android:text="My Text"
          android:textColor="#000"
          android:textDirection="rtl" /&gt;
  </code></pre>