Closer to notification model & updates on bubbles
* Introduces BadgedImageView / BadgeRenderer for icon & badging
-> These are both semi-temporary until I move things over to using
icon library
* Introduces "shouldShowInShade" bit on NotificationData, this is used
to indicate whether a bubble's notification should display in the
shade or not
* BubbleController uses NotificationEntryListener to annotate notifs
bubble state & add / update / remove bubbles
* Cleans up expansion / dismissing / visibility in BubbleController
General notif / dot / bubble behaviour:
* When a bubble is posted, the notification is also in the shade and
the bubble displays a 'dot' a la notification dots on the launcher
* When the bubble is opened the dot goes away and the notif goes away
* When the notif is dismissed the dot will also go away
* If the bubble is dismissed with unseen notif, we keep the notif in shade
go/bubbles-notifs-manual has more detailed behavior / my manual tests
Bug: 111236845
Test: manual (go/bubbles-notifs-manual) and atest BubbleControllerTests
Change-Id: Ie30f1666f2fc1d094772b0dc352b798279ea72de
This commit is contained in:
38
packages/SystemUI/res/layout/bubble_view.xml
Normal file
38
packages/SystemUI/res/layout/bubble_view.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2018 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.bubbles.BubbleView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/bubble_view">
|
||||
|
||||
<com.android.systemui.bubbles.BadgedImageView
|
||||
android:id="@+id/bubble_image"
|
||||
android:layout_width="@dimen/bubble_size"
|
||||
android:layout_height="@dimen/bubble_size"
|
||||
android:padding="@dimen/bubble_view_padding"
|
||||
android:clipToPadding="false"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="@dimen/bubble_message_min_width"
|
||||
android:maxWidth="@dimen/bubble_message_max_width"
|
||||
android:padding="@dimen/bubble_message_padding"/>
|
||||
|
||||
</com.android.systemui.bubbles.BubbleView>
|
||||
@@ -981,14 +981,16 @@
|
||||
|
||||
<!-- How much a bubble is elevated -->
|
||||
<dimen name="bubble_elevation">8dp</dimen>
|
||||
<!-- Padding around a collapsed bubble -->
|
||||
<dimen name="bubble_view_padding">0dp</dimen>
|
||||
<!-- Padding between bubbles when displayed in expanded state -->
|
||||
<dimen name="bubble_padding">8dp</dimen>
|
||||
<!-- Padding around the view displayed when the bubble is expanded -->
|
||||
<dimen name="bubble_expanded_view_padding">8dp</dimen>
|
||||
<!-- Size of the collapsed bubble -->
|
||||
<dimen name="bubble_size">56dp</dimen>
|
||||
<!-- Size of an icon displayed within the bubble -->
|
||||
<dimen name="bubble_icon_size">24dp</dimen>
|
||||
<!-- How much to inset the icon in the circle -->
|
||||
<dimen name="bubble_icon_inset">16dp</dimen>
|
||||
<!-- Padding around the view displayed when the bubble is expanded -->
|
||||
<dimen name="bubble_expanded_view_padding">8dp</dimen>
|
||||
<!-- Default height of the expanded view shown when the bubble is expanded -->
|
||||
<dimen name="bubble_expanded_default_height">400dp</dimen>
|
||||
<!-- Height of the triangle that points to the expanded bubble -->
|
||||
@@ -1001,4 +1003,10 @@
|
||||
<dimen name="bubble_expanded_header_height">48dp</dimen>
|
||||
<!-- Left and right padding applied to the header. -->
|
||||
<dimen name="bubble_expanded_header_horizontal_padding">24dp</dimen>
|
||||
<!-- Max width of the message bubble-->
|
||||
<dimen name="bubble_message_max_width">144dp</dimen>
|
||||
<!-- Min width of the message bubble -->
|
||||
<dimen name="bubble_message_min_width">32dp</dimen>
|
||||
<!-- Interior padding of the message bubble -->
|
||||
<dimen name="bubble_message_padding">4dp</dimen>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user