Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b5c5b16 authored by Justin Klaassen's avatar Justin Klaassen
Browse files

Use R.attr.colorAccent instead of R.color.hot_pink

Bug: 21952435

- To support basic theming of the background and accent colors, refactor
  our usage of the hot_pink color resource where possible to instead
  resolve the colorAccent attribute against the current theme.
- Use BroadcastListener in BaseActivity to update the background color
  whenever the system time / time-zone changes.

Change-Id: I9c736801eb8017cca305fd377628380fef40bfab
parent 7cd60432
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@

        <android.support.v7.widget.SwitchCompat
            android:id="@+id/onoff"
            android:theme="@style/AlarmSwitchTheme"
            android:theme="@style/ControlAccentThemeOverlay"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/touch_target_min_size"
            android:layout_gravity="center_vertical|end" />
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
<ListView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/cities_list"
    android:theme="@style/CitiesListViewThemeOverlay"
    android:theme="@style/ControlAccentThemeOverlay"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:divider="@null"
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
            android:layout_width="wrap_content"
            android:text="@string/time_picker_cancel"
            android:textAllCaps="true"
            android:textColor="@color/hot_pink"
            android:textColor="?attr/colorAccent"
            android:textSize="@dimen/dialog_button_font_size" />

        <Button
@@ -69,7 +69,7 @@
            android:layout_width="wrap_content"
            android:text="@string/time_picker_set"
            android:textAllCaps="true"
            android:textColor="@color/hot_pink"
            android:textColor="?attr/colorAccent"
            android:textSize="@dimen/dialog_button_font_size" />

    </LinearLayout>

res/values-v19/styles.xml

deleted100644 → 0
+0 −25
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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>

    <style name="AppCompatTranslucentDecorTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
    </style>

</resources>
+3 −8
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@
    <style name="TimePickerTheme" parent="Theme.AppCompat.Dialog">
        <item name="android:background">@color/time_picker_gray</item>
        <item name="android:timePickerStyle">@style/TimePickerStyle</item>
        <item name="android:textColorPrimaryInverse">@color/hot_pink</item>
        <item name="android:textColorPrimaryInverse">?attr/colorAccent</item>

        <!-- Propagates to android:colorAccent via the appcompat theme. -->
        <!-- Attributes from support.v7.appcompat -->
        <item name="colorAccent">@color/hot_pink</item>
    </style>

@@ -56,7 +56,7 @@
        <item name="android:fontFamily">sans-serif-medium</item>
    </style>

    <style name="CitiesTheme" parent="DeskClockParentTheme">
    <style name="CitiesTheme" parent="BaseActivityTheme">
        <item name="android:fastScrollPreviewBackgroundLeft">
            @drawable/fastscroll_preview_left
        </item>
@@ -77,9 +77,4 @@
        <item name="android:textSize">32sp</item>
    </style>

    <!-- This is to control the FastScroll background color -->
    <style name="CitiesListViewThemeOverlay">
        <item name="android:colorControlActivated">@color/hot_pink</item>
    </style>

</resources>
Loading