How do I change the color/s in my styles.xml which looks like this
<?xml version="1.0" encoding="utf-8"?>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">#FF9800</item>
<item name="colorButtonNormal">#FF9800</item>
<item name="android:colorPrimaryDark">#FF9800</item>
<item name="android:navigationBarColor">#FF9800</item>
</style>
when I toggle my ToggleButton in my activity_main.xml, which looks like this
<ToggleButton
android:id="@+id/togglebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="Light Theme"
android:textOff="Dark Theme"
android:onClick="onToggleClicked"
android:layout_above="@+id/button"
android:layout_centerHorizontal="true" />
so far I have done this to make that behavior happen in my MainActivity.java
public void onToggleClicked(View view) {
// check if toggle active
boolean on = ((ToggleButton) view).isChecked();
if (on) {
} else {
}
}
The reason is that I want to make a dark and a light theme for my app:)