title: android RadioButton button drawable gravity
body: <p>I am generating RadioButtons dynamically with </p>
  
  <pre><code>RadioButton radioButton=new RadioButton(context);  
  
  LayoutParams layoutParams=new LayoutParams(radioWidth,radioHeight);
  layoutParams.gravity=Gravity.CENTER;
  
  radioButton.setLayoutParams(layoutParams);
  radioButton.setGravity(Gravity.CENTER);
  
  BitmapDrawable bitmap = ((BitmapDrawable)drawableResource);
  bitmap.setGravity(Gravity.CENTER);
  
  radioButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.itabs_radio));
  radioButton.setButtonDrawable(bitmap);
  </code></pre>
  
  <p>as you can see I am desperately trying to set gravity of button drawable to center, but without a reason its always center and left aligned, heres the reason- the default style of android radio button:</p>
  
  <pre><code>&lt;style name="Widget.CompoundButton"&gt;
  &lt;item name="android:focusable"&gt;true&lt;/item&gt; 
  &lt;item name="android:clickable"&gt;true&lt;/item&gt;
  &lt;item name="android:textAppearance"&gt;?android:attr/textAppearance&lt;/item&gt; 
  &lt;item name="android:textColor"&gt;?android:attr/textColorPrimaryDisableOnly&lt;/item&gt; 
  &lt;item name="android:gravity"&gt;center_vertical|left&lt;/item&gt; 
  &lt;/style&gt;
  
  &lt;style name="Widget.CompoundButton.RadioButton"&gt;
  &lt;item name="android:background"&gt;@android:drawable/btn_radio_label_background&lt;/item&gt; 
  &lt;item name="android:button"&gt;@android:drawable/btn_radio&lt;/item&gt; 
  &lt;/style&gt;
  </code></pre>
  
  <p><strong>Is there any way I can align button drawable to center?</strong></p>