Skip to content

Commit

Permalink
Add custom car theme and adapt to new Auto guidelines
Browse files Browse the repository at this point in the history
Bug: 19500175
Change-Id: I8be6bd631b97e50066df2be7200b3813e2596251
  • Loading branch information
mangini committed Mar 10, 2015
1 parent e783e7d commit 8c0cd35
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
9 changes: 9 additions & 0 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@
android:name="com.google.android.gms.car.notification.SmallIcon"
android:resource="@drawable/ic_notification" />

<!--
(OPTIONAL) use this meta data to override the theme from which Android Auto will
look for colors. If you don't set this, Android Auto will look
for color attributes in your application theme.
-->
<meta-data
android:name="com.google.android.gms.car.application.theme"
android:resource="@style/CarTheme" />

<!-- Main music service, provides media browsing and media playback services to
consumers through MediaBrowserService and MediaSession. Consumers connect to it through
MediaBrowser (for browsing) and MediaController (for play session control) -->
Expand Down
23 changes: 17 additions & 6 deletions mobile/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,27 @@
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowContentTransitions">true</item>

<!-- colorPrimary is used for Notification icon and bottom facet bar icons
and overflow actions -->
<item name="colorPrimary">#ffff5722</item>
<item name="colorPrimaryDark">#ffbf360c</item>
<item name="colorAccent">#ffff5722</item>
</style>

<!-- colorPrimaryDark is used for background -->

<style name="CarTheme" parent="UAmpAppTheme">
<!-- colorPrimaryDark is currently used in Android Auto for:
- App background
- Drawer right side ("more" custom actions) background
- Notification icon badge tinting
- Overview “now playing” icon tinting
-->
<item name="colorPrimaryDark">#ffbf360c</item>

<!-- colorAccent is sparingly used for accents, like floating action button highlight,
progress on playbar-->
<item name="colorAccent">#ffff5722</item>
<!-- colorAccent is used in Android Auto for:
- Spinner
- progress bar
- floating action button background (Play/Pause in media apps)
-->
<item name="colorAccent">@color/bt_accent</item>
</style>

</resources>

0 comments on commit 8c0cd35

Please sign in to comment.