title: Align drawable image inside a text view to center
body: <p>I have a textview which holds an image and some text.</p>
  
  <p>programmatically i have added the drawable image to the left side of text view</p>
  
  <pre><code>txtIDFav.setCompoundDrawablesWithIntrinsicBounds(R.drawable.fav_enabled, 0, 0, 0);
  </code></pre>
  
  <p>i have aligned the text view to center using</p>
  
  <pre><code>txtIDFav.setGravity(Gravity.CENTER);
  </code></pre>
  
  <p>Now the text in the textview is aligned to center. but the image is on the left side.</p>
  
  <p>eg: [image]<strong>_____________________</strong> mytext</p>
  
  <p>used the _ to give space as its not allowed.</p>
  
  <p>I want to align the image to center along with the text.</p>
  
  <p>eg: <strong>_____________________</strong>[image]mytext</p>
  
  <p>Please advice.</p>
  
  <p>Thanks and appreciate.</p>