Reputation: 111
code:
fragment:
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/changeDateFormatSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/timeFormat"
android:theme="@style/switchText"
app:layout_constraintEnd_toEndOf="@+id/timePicker"
app:layout_constraintStart_toStartOf="@+id/timePicker"
app:layout_constraintTop_toBottomOf="@+id/timePicker"
app:switchTextAppearance="@style/switchText" />
themes:
(as you can see I tried a lot of things... but none of them has worked... yet?)
<style name="switchText">
<item name="android:textColor">@color/gold</item>
<item name="android:textColorPrimary">@color/gold</item>
<item name="android:editTextColor">@color/gold</item>
<item name="colorControlNormal">@color/gold</item>
<item name="colorControlActivated">@color/gold</item>
</style>
any ideas what should I change to change:
the text color?
Thanks in advance :)
Upvotes: 0
Views: 348
Reputation: 364988
You can use:
<com.google.android.material.switchmaterial.SwitchMaterial
style="@style/Widget.App.CompoundButton.Switch"
../>
with:
<style name="Widget.App.CompoundButton.Switch" parent="@style/Widget.MaterialComponents.CompoundButton.Switch">
<item name="android:textColor">@color/...</item>
</style>
Upvotes: 1