Switch only support text on the left side.
You need to use TextView
to show Switch
text on the right.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Switch
android:id="@+id/publishSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/publishTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Publish?" />
</LinearLayout>