ToogleButton align text label on the right
<p>I want to align the text in a <code>ToogleButton</code> on the right of that bar that became green/white when pressing it.</p>

<p>To be more explicit I will post the code and also the result I have now.</p>

<pre><code> &lt;ToggleButton android:id="@+id/ToggleButton01"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  layout_gravity="center_vertical"
                  android:textOff="Off"
              android:textOn="On"/&gt;

 ToggleButton onOffButton = (ToggleButton) findViewById(R.id.ToggleButton01);
 onOffButton.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
 onOffButton.setPadding(0, 0, 5, 0);
</code></pre>

<p>and the result:
<img src="http://i.stack.imgur.com/CDoZ0.png" alt="enter image description here"></p>

<p>I want the bar and the text to not be overlapped.</p>
