OmniPreferenceTheme: add new switch style for v34
Change-Id: I377948504d729e4bcda4f9139f9744bf2b2049c1
diff --git a/themes/PreferenceTheme/res/color-night-v34/omni_settings_switch_track_outline_color.xml b/themes/PreferenceTheme/res/color-night-v34/omni_settings_switch_track_outline_color.xml
new file mode 100644
index 0000000..9274ae7
--- /dev/null
+++ b/themes/PreferenceTheme/res/color-night-v34/omni_settings_switch_track_outline_color.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Disabled status of thumb -->
+ <item android:state_enabled="false"
+ android:color="@android:color/system_neutral2_400"
+ android:alpha="?android:attr/disabledAlpha" />
+ <!-- Toggle off status of thumb -->
+ <item android:state_checked="false"
+ android:color="@android:color/system_neutral2_400" />
+ <!-- Enabled or toggle on status of thumb -->
+ <item android:color="@color/omni_settings_track_on_color" />
+</selector>
\ No newline at end of file
diff --git a/themes/PreferenceTheme/res/color-v34/omni_settings_switch_thumb_color.xml b/themes/PreferenceTheme/res/color-v34/omni_settings_switch_thumb_color.xml
new file mode 100644
index 0000000..e0b9e41
--- /dev/null
+++ b/themes/PreferenceTheme/res/color-v34/omni_settings_switch_thumb_color.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Disabled status of thumb -->
+ <item android:state_enabled="false"
+ android:color="@color/omni_settings_thumb_disabled_color"
+ android:alpha="?android:attr/disabledAlpha" />
+ <!-- Toggle off status of thumb -->
+ <item android:state_checked="false"
+ android:color="@color/omni_settings_thumb_off_color" />
+ <!-- Enabled or toggle on status of thumb -->
+ <item android:color="@color/omni_settings_thumb_on_color" />
+</selector>
\ No newline at end of file
diff --git a/themes/PreferenceTheme/res/color-v34/omni_settings_switch_track_outline_color.xml b/themes/PreferenceTheme/res/color-v34/omni_settings_switch_track_outline_color.xml
new file mode 100644
index 0000000..cffaafe
--- /dev/null
+++ b/themes/PreferenceTheme/res/color-v34/omni_settings_switch_track_outline_color.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Disabled status of thumb -->
+ <item android:state_enabled="false"
+ android:color="@android:color/system_neutral2_500"
+ android:alpha="?android:attr/disabledAlpha" />
+ <!-- Toggle off status of thumb -->
+ <item android:state_checked="false"
+ android:color="@android:color/system_neutral2_500" />
+ <!-- Enabled or toggle on status of thumb -->
+ <item android:color="@color/omni_settings_track_on_color" />
+</selector>
\ No newline at end of file
diff --git a/themes/PreferenceTheme/res/drawable-v34/omni_settings_switch_track.xml b/themes/PreferenceTheme/res/drawable-v34/omni_settings_switch_track.xml
new file mode 100644
index 0000000..743fdd3
--- /dev/null
+++ b/themes/PreferenceTheme/res/drawable-v34/omni_settings_switch_track.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle"
+ android:width="52dp"
+ android:height="28dp">
+
+ <solid android:color="@color/omni_settings_switch_track_color" />
+ <corners android:radius="35dp" />
+ <stroke android:width="2dp" android:color="@color/omni_settings_track_online_color"/>
+</shape>
diff --git a/themes/PreferenceTheme/res/values-night-v34/colors.xml b/themes/PreferenceTheme/res/values-night-v34/colors.xml
new file mode 100644
index 0000000..344f1f8
--- /dev/null
+++ b/themes/PreferenceTheme/res/values-night-v34/colors.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <!-- Material next state on color-->
+ <color name="omni_settings_state_on_color">@android:color/system_accent1_700</color>
+
+ <!-- Material next state off color-->
+ <color name="omni_settings_state_off_color">@android:color/system_accent1_700</color>
+
+ <!-- Material next thumb disable color-->
+ <color name="omni_settings_thumb_disabled_color">@color/omni_settings_thumb_off_color</color>
+
+ <!-- Material next thumb off color-->
+ <color name="omni_settings_thumb_on_color">@android:color/system_accent1_800</color>
+
+ <!-- Material next thumb off color-->
+ <color name="omni_settings_thumb_off_color">@android:color/system_neutral2_400</color>
+
+ <!-- Material next track on color-->
+ <color name="omni_settings_track_on_color">@android:color/system_accent1_200</color>
+
+ <!-- Material next track off color-->
+ <color name="omni_settings_track_off_color">@android:color/system_surface_container_highest_dark
+ </color>
+</resources>
diff --git a/themes/PreferenceTheme/res/values-v34/colors.xml b/themes/PreferenceTheme/res/values-v34/colors.xml
new file mode 100644
index 0000000..6794608
--- /dev/null
+++ b/themes/PreferenceTheme/res/values-v34/colors.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <!-- Material next state on color-->
+ <color name="omni_settings_state_on_color">@android:color/system_accent1_100</color>
+
+ <!-- Material next state off color-->
+ <color name="omni_settings_state_off_color">@android:color/system_accent1_100</color>
+
+ <!-- Material next thumb disable color-->
+ <color name="omni_settings_thumb_disabled_color">@color/omni_settings_thumb_off_color</color>
+
+ <!-- Material next thumb off color-->
+ <color name="omni_settings_thumb_on_color">@android:color/system_accent1_0</color>
+
+ <!-- Material next thumb off color-->
+ <color name="omni_settings_thumb_off_color">@android:color/system_neutral2_500</color>
+
+ <!-- Material next track on color-->
+ <color name="omni_settings_track_on_color">@android:color/system_accent1_600</color>
+
+ <!-- Material next track off color-->
+ <color name="omni_settings_track_off_color">@android:color/system_surface_container_highest_light</color>
+
+ <!-- Material next track outline color-->
+ <color name="omni_settings_track_online_color">@color/omni_settings_switch_track_outline_color</color>
+</resources>
\ No newline at end of file