-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
play-services-core: Use M3 theme on Android 12+ devices
* Also use primary and accent color from system Signed-off-by: Aayush Gupta <[email protected]> Change-Id: Id0d2f0b4d990c99b9a930198e747cb78caa1c86c
- Loading branch information
1 parent
b62f089
commit 4fc5b75
Showing
7 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
play-services-core/src/main/res/color/preference_material_switch_color.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:color="@android:color/white" android:state_checked="true" /> | ||
<item android:color="@android:color/darker_gray"/> | ||
</selector> |
11 changes: 11 additions & 0 deletions
11
play-services-core/src/main/res/layout/preference_material_switch.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Derived from https://github.com/androidx/androidx/blob/8cb282cc/preference/preference/res/layout/preference_widget_switch_compat.xml --> | ||
<com.google.android.material.materialswitch.MaterialSwitch xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/switchWidget" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:background="@null" | ||
android:clickable="false" | ||
android:focusable="false" | ||
app:thumbTint="@color/preference_material_switch_color" /> |
13 changes: 13 additions & 0 deletions
13
play-services-core/src/main/res/values-night-v31/themes.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="Theme.App" parent="Theme.Base.M3"> | ||
<item name="colorPrimary">@android:color/system_accent1_200</item> | ||
<item name="colorAccent">@android:color/system_accent1_200</item> | ||
<item name="android:windowLightStatusBar">false</item> | ||
<item name="android:windowLightNavigationBar">false</item> | ||
<item name="android:statusBarColor">?android:colorBackground</item> | ||
<item name="android:navigationBarColor">?android:colorBackground</item> | ||
</style> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="Theme.App" parent="Theme.Base.M3"> | ||
<item name="colorPrimary">@android:color/system_accent1_500</item> | ||
<item name="colorAccent">@android:color/system_accent1_500</item> | ||
<item name="android:windowLightStatusBar">true</item> | ||
<item name="android:windowLightNavigationBar">true</item> | ||
<item name="android:statusBarColor">?android:colorBackground</item> | ||
<item name="android:navigationBarColor">?android:colorBackground</item> | ||
</style> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters