Merge "Merge \"Add colorSecondary theme attribute.\" into nyc-mr1-dev am: ddb980de05" into nyc-mr1-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
cd10a1fce1
@@ -397,6 +397,7 @@ package android {
|
||||
field public static final int colorPressedHighlight = 16843661; // 0x101038d
|
||||
field public static final int colorPrimary = 16843827; // 0x1010433
|
||||
field public static final int colorPrimaryDark = 16843828; // 0x1010434
|
||||
field public static final int colorSecondary = 16844080; // 0x1010530
|
||||
field public static final int columnCount = 16843639; // 0x1010377
|
||||
field public static final int columnDelay = 16843215; // 0x10101cf
|
||||
field public static final int columnOrderPreserved = 16843640; // 0x1010378
|
||||
|
||||
@@ -504,6 +504,7 @@ package android {
|
||||
field public static final int colorPressedHighlight = 16843661; // 0x101038d
|
||||
field public static final int colorPrimary = 16843827; // 0x1010433
|
||||
field public static final int colorPrimaryDark = 16843828; // 0x1010434
|
||||
field public static final int colorSecondary = 16844080; // 0x1010530
|
||||
field public static final int columnCount = 16843639; // 0x1010377
|
||||
field public static final int columnDelay = 16843215; // 0x10101cf
|
||||
field public static final int columnOrderPreserved = 16843640; // 0x1010378
|
||||
|
||||
@@ -397,6 +397,7 @@ package android {
|
||||
field public static final int colorPressedHighlight = 16843661; // 0x101038d
|
||||
field public static final int colorPrimary = 16843827; // 0x1010433
|
||||
field public static final int colorPrimaryDark = 16843828; // 0x1010434
|
||||
field public static final int colorSecondary = 16844080; // 0x1010530
|
||||
field public static final int columnCount = 16843639; // 0x1010377
|
||||
field public static final int columnDelay = 16843215; // 0x10101cf
|
||||
field public static final int columnOrderPreserved = 16843640; // 0x1010378
|
||||
|
||||
@@ -1048,6 +1048,9 @@ i
|
||||
the status bar (via statusBarColor) and navigation bar (via navigationBarColor). -->
|
||||
<attr name="colorPrimaryDark" format="color" />
|
||||
|
||||
<!-- The secondary branding color for the app. -->
|
||||
<attr name="colorSecondary" format="color" />
|
||||
|
||||
<!-- Bright complement to the primary branding color. By default, this is the color applied
|
||||
to framework controls (via colorControlActivated). -->
|
||||
<attr name="colorAccent" format="color" />
|
||||
|
||||
@@ -2741,5 +2741,6 @@
|
||||
<public type="attr" name="contextUri" />
|
||||
<public type="attr" name="contextDescription" />
|
||||
<public type="attr" name="showMetadataInPreview" />
|
||||
<public type="attr" name="colorSecondary" />
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -57,6 +57,7 @@ please see themes_device_defaults.xml.
|
||||
|
||||
<item name="colorPrimaryDark">@color/legacy_primary_dark</item>
|
||||
<item name="colorPrimary">@color/legacy_primary</item>
|
||||
<item name="colorSecondary">?attr/colorPrimary</item>
|
||||
<item name="colorControlActivated">@color/legacy_control_activated</item>
|
||||
<item name="colorControlNormal">@color/legacy_control_normal</item>
|
||||
<item name="colorControlHighlight">@color/legacy_button_pressed</item>
|
||||
|
||||
@@ -730,13 +730,26 @@ easier.
|
||||
<!-- Color palette -->
|
||||
<item name="colorPrimary">@color/primary_device_default_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_device_default_settings</item>
|
||||
<item name="colorAccent">@color/accent_device_default_light</item>
|
||||
</style>
|
||||
|
||||
<!-- DeviceDefault theme for a window that should use Settings theme colors but has
|
||||
a full dark palette (instead of Light with dark action bar like
|
||||
Theme.DeviceDefault.Settings. -->
|
||||
<style name="Theme.DeviceDefault.Settings.Dark" parent="Theme.Material">
|
||||
<!-- Color palette -->
|
||||
<item name="colorPrimary">@color/primary_device_default_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_device_default_settings</item>
|
||||
<item name="colorAccent">@color/accent_device_default_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.DeviceDefault.Settings.DialogWhenLarge" parent="Theme.Material.Settings.DialogWhenLarge">
|
||||
<!-- Color palette -->
|
||||
<item name="colorPrimary">@color/primary_device_default_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_device_default_settings</item>
|
||||
<item name="colorAccent">@color/accent_device_default_light</item>
|
||||
</style>
|
||||
|
||||
@@ -744,6 +757,7 @@ easier.
|
||||
<!-- Color palette -->
|
||||
<item name="colorPrimary">@color/primary_device_default_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_device_default_settings</item>
|
||||
<item name="colorAccent">@color/accent_device_default_light</item>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1305,6 +1305,7 @@ please see themes_device_defaults.xml.
|
||||
<style name="Theme.Material.Settings" parent="Theme.Material.Light.DarkActionBar">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
|
||||
<item name="presentationTheme">@style/Theme.Material.Settings.Dialog.Presentation</item>
|
||||
<item name="searchDialogTheme">@style/Theme.Material.Settings.SearchBar</item>
|
||||
@@ -1315,6 +1316,7 @@ please see themes_device_defaults.xml.
|
||||
<style name="Theme.Material.Settings.NoActionBar" parent="Theme.Material.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
|
||||
<item name="presentationTheme">@style/Theme.Material.Settings.Dialog.Presentation</item>
|
||||
<item name="searchDialogTheme">@style/Theme.Material.Settings.SearchBar</item>
|
||||
@@ -1324,6 +1326,7 @@ please see themes_device_defaults.xml.
|
||||
<style name="Theme.Material.Settings.BaseDialog" parent="Theme.Material.Light.BaseDialog">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Material.Settings.Dialog" parent="Theme.Material.Settings.BaseDialog" />
|
||||
@@ -1331,6 +1334,7 @@ please see themes_device_defaults.xml.
|
||||
<style name="Theme.Material.Settings.Dialog.BaseAlert" parent="Theme.Material.Light.Dialog.BaseAlert">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Material.Settings.Dialog.Alert" parent="Theme.Material.Settings.Dialog.BaseAlert" />
|
||||
@@ -1338,25 +1342,30 @@ please see themes_device_defaults.xml.
|
||||
<style name="Theme.Material.Settings.DialogWhenLarge" parent="Theme.Material.Light.DialogWhenLarge.DarkActionBar">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Material.Settings.DialogWhenLarge.NoActionBar" parent="Theme.Material.Light.DialogWhenLarge.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Material.Settings.Dialog.Presentation" parent="Theme.Material.Light.Dialog.Presentation">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Material.Settings.SearchBar" parent="Theme.Material.Light.SearchBar">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Material.Settings.CompactMenu" parent="Theme.Material.Light.CompactMenu">
|
||||
<item name="colorPrimary">@color/primary_material_settings</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
|
||||
<item name="colorSecondary">@color/secondary_material_settings</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2014 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
|
||||
-->
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight" >
|
||||
<item android:drawable="@color/system_secondary_color"/>
|
||||
</ripple>
|
||||
@@ -16,6 +16,6 @@
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:drawable="@color/system_secondary_color" />
|
||||
<item android:drawable="?android:attr/colorSecondary" />
|
||||
</ripple>
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright 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.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_background_primary"
|
||||
android:paddingBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/notification_header_bg"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:id="@android:id/icon"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp" />
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:paddingStart="10dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical" />
|
||||
</LinearLayout>
|
||||
|
||||
<GridLayout
|
||||
android:id="@+id/tile_grid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:columnCount="4" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,47 +0,0 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<com.android.systemui.tuner.AutoScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/system_secondary_color" >
|
||||
<LinearLayout
|
||||
android:id="@+id/all_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:background="@color/qs_tile_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/remove_target"
|
||||
android:layout_width="105dp"
|
||||
android:layout_height="@dimen/qs_tile_height" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/add_target"
|
||||
android:layout_width="105dp"
|
||||
android:layout_height="@dimen/qs_tile_height" />
|
||||
</LinearLayout>
|
||||
</com.android.systemui.tuner.AutoScrollView>
|
||||
@@ -30,10 +30,6 @@
|
||||
<color name="batterymeter_charge_color">#FFFFFFFF</color>
|
||||
<color name="batterymeter_bolt_color">#FFFFFFFF</color>
|
||||
<color name="qs_batterymeter_frame_color">#FF404040</color>
|
||||
|
||||
<!-- TODO: use a theme color for this and delete it -->
|
||||
<color name="system_secondary_color">#ff37474F</color><!-- blue grey 800 -->
|
||||
|
||||
<color name="system_warning_color">#fff4511e</color><!-- deep orange 600 -->
|
||||
<color name="qs_text">#FFFFFFFF</color>
|
||||
<color name="qs_tile_divider">#29ffffff</color><!-- 16% white -->
|
||||
@@ -156,14 +152,10 @@
|
||||
<color name="qs_tile_tint_inactive">#4dffffff</color>
|
||||
<color name="qs_tile_tint_active">#ffffffff</color>
|
||||
|
||||
<color name="switch_bar_background">#ff37474f</color>
|
||||
|
||||
<!-- Keyboard shortcuts colors -->
|
||||
<color name="ksh_application_group_color">#fff44336</color>
|
||||
<color name="ksh_keyword_color">#d9000000</color>
|
||||
<color name="ksh_key_item_color">@color/material_grey_600</color>
|
||||
<color name="ksh_key_item_background">@color/material_grey_100</color>
|
||||
|
||||
<!-- Background color of edit overflow -->
|
||||
<color name="qs_edit_overflow_bg">#455A64</color>
|
||||
</resources>
|
||||
|
||||
@@ -355,8 +355,8 @@
|
||||
<item name="android:textColor">?android:attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="edit_theme" parent="@android:style/Theme.Material">
|
||||
<item name="android:colorBackground">@color/qs_edit_overflow_bg</item>
|
||||
<style name="edit_theme" parent="@*android:style/Theme.DeviceDefault.Settings.Dark">
|
||||
<item name="android:colorBackground">?android:attr/colorSecondary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -19,6 +19,7 @@ import android.app.AlertDialog.Builder;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Handler;
|
||||
@@ -71,6 +72,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
private final Handler mHandler = new Handler();
|
||||
private final List<TileInfo> mTiles = new ArrayList<>();
|
||||
private final ItemTouchHelper mItemTouchHelper;
|
||||
private final ItemDecoration mDecoration;
|
||||
private final AccessibilityManager mAccessibilityManager;
|
||||
private int mEditIndex;
|
||||
private int mTileDividerIndex;
|
||||
@@ -88,6 +90,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
mContext = context;
|
||||
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
|
||||
mItemTouchHelper = new ItemTouchHelper(mCallbacks);
|
||||
mDecoration = new TileItemDecoration(context);
|
||||
}
|
||||
|
||||
public void setHost(QSTileHost host) {
|
||||
@@ -459,9 +462,16 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
}
|
||||
};
|
||||
|
||||
private final ItemDecoration mDecoration = new ItemDecoration() {
|
||||
// TODO: Move this to resource.
|
||||
private final ColorDrawable mDrawable = new ColorDrawable(0xff384248);
|
||||
private class TileItemDecoration extends ItemDecoration {
|
||||
private final ColorDrawable mDrawable;
|
||||
|
||||
private TileItemDecoration(Context context) {
|
||||
TypedArray ta =
|
||||
context.obtainStyledAttributes(new int[]{android.R.attr.colorSecondary});
|
||||
mDrawable = new ColorDrawable(ta.getColor(0, 0));
|
||||
ta.recycle();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, State state) {
|
||||
|
||||
Reference in New Issue
Block a user