diff options
author | Danny Epstein <depstein@google.com> | 2020-05-19 20:48:23 -0700 |
---|---|---|
committer | Danny Epstein <depstein@google.com> | 2020-06-04 21:32:15 -0700 |
commit | 77ffcfd13c0eff5ef307144535e59bf78e1b23a7 (patch) | |
tree | aaef4f7e93d1f907734999bc8e7521a317211348 /RotaryPlayground/res | |
parent | 55340419ca385e12794eacea70eedcb38ffc5450 (diff) | |
download | tests-77ffcfd13c0eff5ef307144535e59bf78e1b23a7.tar.gz |
Add notification fragment to reference app.
The notification fragment has two pairs of buttons, with one pair at
the top where it will be covered by the heads-up notification (HUN)
and one further down where it won’t be covered by the HUN. Each pair
includes a button to post a notification that will appear as a
heads-up notification and a button to clear the previously posted
notification.
Test: manual
Bug: 155681517
Change-Id: If2ac76cece527d7e45756dbf5659fa86cc98ac2a
Diffstat (limited to 'RotaryPlayground/res')
-rw-r--r-- | RotaryPlayground/res/layout/rotary_menu.xml | 4 | ||||
-rw-r--r-- | RotaryPlayground/res/layout/rotary_notification.xml | 79 | ||||
-rw-r--r-- | RotaryPlayground/res/values/colors.xml | 1 | ||||
-rw-r--r-- | RotaryPlayground/res/values/dimens.xml | 2 |
4 files changed, 84 insertions, 2 deletions
diff --git a/RotaryPlayground/res/layout/rotary_menu.xml b/RotaryPlayground/res/layout/rotary_menu.xml index 176d58c..659f119 100644 --- a/RotaryPlayground/res/layout/rotary_menu.xml +++ b/RotaryPlayground/res/layout/rotary_menu.xml @@ -39,11 +39,11 @@ android:layout_weight="1" android:text="Grid" /> <Button - android:id="@+id/menu_item_4" + android:id="@+id/notification" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - android:text="Menu Item 4" /> + android:text="Notification" /> <Button android:id="@+id/scroll" android:layout_width="match_parent" diff --git a/RotaryPlayground/res/layout/rotary_notification.xml b/RotaryPlayground/res/layout/rotary_notification.xml new file mode 100644 index 0000000..998febe --- /dev/null +++ b/RotaryPlayground/res/layout/rotary_notification.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 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. + --> + +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <com.android.car.ui.FocusArea + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true"> + <TextView + android:layout_width="0dp" + android:layout_height="@dimen/button_height" + android:layout_weight="1" + android:gravity="center" + android:text="Under HUN"/> + <Button + android:id="@+id/add_notification_button1" + android:layout_width="0dp" + android:layout_height="@dimen/button_height" + android:layout_weight="1" + android:layout_margin="5dp" + android:background="@color/button_background_color" + android:text="Add Notification"/> + <Button + android:id="@+id/clear_notification_button1" + android:layout_width="0dp" + android:layout_height="@dimen/button_height" + android:layout_weight="1" + android:layout_margin="5dp" + android:background="@color/button_background_color" + android:text="Clear Notification"/> + </com.android.car.ui.FocusArea> + + <com.android.car.ui.FocusArea + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true"> + <TextView + android:layout_width="0dp" + android:layout_height="@dimen/button_height" + android:layout_weight="1" + android:gravity="center" + android:text="Not Under HUN"/> + <Button + android:id="@+id/add_notification_button2" + android:layout_width="0dp" + android:layout_height="@dimen/button_height" + android:layout_weight="1" + android:layout_margin="5dp" + android:background="@color/button_background_color" + android:text="Add Notification"/> + <Button + android:id="@+id/clear_notification_button2" + android:layout_width="0dp" + android:layout_height="@dimen/button_height" + android:layout_weight="1" + android:layout_margin="5dp" + android:background="@color/button_background_color" + android:text="Clear Notification"/> + </com.android.car.ui.FocusArea> + +</RelativeLayout> diff --git a/RotaryPlayground/res/values/colors.xml b/RotaryPlayground/res/values/colors.xml index b49ea51..87480a0 100644 --- a/RotaryPlayground/res/values/colors.xml +++ b/RotaryPlayground/res/values/colors.xml @@ -18,6 +18,7 @@ <color name="card_background_color">#37393d</color> <color name="card_disabled_background_color">#61646b</color> <color name="grid_item_background_color">#006666</color> + <color name="button_background_color">#660000</color> <color name="button_disabled_background_color">#61646b</color> <color name="scroll_text_background_color">#61646b</color> </resources>
\ No newline at end of file diff --git a/RotaryPlayground/res/values/dimens.xml b/RotaryPlayground/res/values/dimens.xml index 77e907f..02a5406 100644 --- a/RotaryPlayground/res/values/dimens.xml +++ b/RotaryPlayground/res/values/dimens.xml @@ -24,4 +24,6 @@ <dimen name="card_width">400dp</dimen> <dimen name="card_padding">20dp</dimen> <dimen name="description_height">200dp</dimen> + <!-- Notification values --> + <dimen name="button_height">70dp</dimen> </resources>
\ No newline at end of file |