Implemented visual speed-bump for notifications.
The separation between the important and the less important
notifications has now a visual representation.
Bug: 14607473
Change-Id: I8baa0a08924ec041be2884a2834139477313ab40
diff --git a/packages/SystemUI/res/layout/status_bar_notification_speed_bump.xml b/packages/SystemUI/res/layout/status_bar_notification_speed_bump.xml
new file mode 100644
index 0000000..ff8800c
--- /dev/null
+++ b/packages/SystemUI/res/layout/status_bar_notification_speed_bump.xml
@@ -0,0 +1,65 @@
+<!--
+ ~ 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
+ -->
+
+<!-- Extends FrameLayout -->
+<com.android.systemui.statusbar.SpeedBumpView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:focusable="true"
+ android:clickable="true"
+ android:visibility="gone"
+ >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/speed_bump_height_collapsed"
+ android:layout_gravity="top"
+ android:orientation="horizontal">
+ <View
+ android:id="@+id/speedbump_line_left"
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1"
+ android:background="#6fdddddd"
+ android:layout_gravity="center_vertical"/>
+ <com.android.systemui.statusbar.SpeedBumpDotsLayout
+ android:id="@+id/speed_bump_dots_layout"
+ android:layout_width="34dp"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0"/>
+ <View
+ android:id="@+id/speedbump_line_right"
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1"
+ android:background="#6fdddddd"
+ android:layout_gravity="center_vertical"/>
+ </LinearLayout>
+ <TextView
+ android:id="@+id/speed_bump_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|center_horizontal"
+ android:fontFamily="sans-serif-condensed"
+ android:textSize="15sp"
+ android:singleLine="true"
+ android:textColor="#eeeeee"
+ android:visibility="invisible"
+ android:text="@string/speed_bump_explanation"
+ android:paddingTop="4dp" />
+</com.android.systemui.statusbar.SpeedBumpView>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 9582b21..cba13004 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -58,6 +58,18 @@
<!-- Tint color for the content on the notification overflow card. -->
<color name="keyguard_overflow_content_color">#ff666666</color>
+ <!-- The color of the red speed bump dot -->
+ <color name="speed_bump_dot_red">#ffd50000</color>
+
+ <!-- The color of the blue speed bump dot -->
+ <color name="speed_bump_dot_blue">#ff2962ff</color>
+
+ <!-- The color of the yellow speed bump dot -->
+ <color name="speed_bump_dot_yellow">#ffffd600</color>
+
+ <!-- The color of the green speed bump dot -->
+ <color name="speed_bump_dot_green">#ff00c853</color>
+
<!-- The default recents task bar background color. -->
<color name="recents_task_bar_default_background_color">#e6444444</color>
<!-- The default recents task bar text color. -->
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 79612e0..d403bf3 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -260,6 +260,15 @@
<!-- The padding between the individual notification cards. -->
<dimen name="notification_padding">4dp</dimen>
+ <!-- The height of the collapsed speed bump view. -->
+ <dimen name="speed_bump_height_collapsed">24dp</dimen>
+
+ <!-- The padding inset the explanation text needs compared to the collapsed height -->
+ <dimen name="speed_bump_text_padding_inset">10dp</dimen>
+
+ <!-- The height of the speed bump dots. -->
+ <dimen name="speed_bump_dots_height">5dp</dimen>
+
<!-- The total height of the stack in its collapsed size (i.e. when quick settings is open) -->
<dimen name="collapsed_stack_height">94dp</dimen>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index a50a0ac..b3829a3 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -553,6 +553,9 @@
<item quantity="other">%d more</item>
</plurals>
+ <!-- An explanation for the visual speed bump in the notifications, which will appear when you click on it. [CHAR LIMIT=50] -->
+ <string name="speed_bump_explanation">Less urgent notifications below</string>
+
<!-- Shows to explain the double tap interaction with notifications: After tapping a notification on Keyguard, this will explain users to tap again to launch a notification. [CHAR LIMIT=60] -->
<string name="notification_tap_again">Tap again to open</string>