I wanted to implement an Switch widget in my app and the function works perfectly. The issue I have with the switch is the off text ("OFF") on the thumb. "OFF" is bigger than the size of the thumb. I want to increase the size of the thumb (or decrease the thumb text), but for some odd reason I am unable to do either. Here is what is looks like:
Close up of the switch
Screen Shot
Here's the XML file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/gameSettingsContainer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
tools:context="com.example.vb1115.multchoicequestion.LaunchScreen">
<LinearLayout
android:id="@+id/lessonModeSliderContainer"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<Switch
android:id="@+id/lessonModeToggleSlider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:showText="true"/>
</LinearLayout>
<ImageView
android:id="@+id/lessonModeAnimatedArrow"
android:src="@mipmap/green_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/lessonModeSliderContainer"/>
</RelativeLayout>
I don't think there is an issue from the code itself. All I am doing in my Activity code is finding the Switch view to modify the setOnCheckedChangeListener method.