Smart Action look similar to Smart Replies with an icon next to the button text. Smart Actions can be added either by an app, or by the framework itself (through NotificationAssistantService). The idea is that Smart Actions are really actions relating to the content in the notification message. The priority order of smart replies vs. actions will be dealt with in a follow-up CL (i.e. whether we should prioritize showing smart actions over smart replies). Example notifications: System generated: https://screenshot.googleplex.com/f6p8uOMygeT.png App generated: https://screenshot.googleplex.com/VR6On1eh4CW.png 2 app generated actions: https://screenshot.googleplex.com/QuM5e792xhb.png Bug: 111406942 Test: manual tests = add custom actions directly in sys ui and ensure they're shown in message notifications. Test: atest SystemUITests Change-Id: I0ce959b74e89bcabc69b76c50c1877e70d6f06df
35 lines
1.6 KiB
XML
35 lines
1.6 KiB
XML
<!--
|
|
~ 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
|
|
-->
|
|
|
|
<!-- android:paddingHorizontal is set dynamically in SmartReplyView. -->
|
|
<Button xmlns:android="http://schemas.android.com/apk/res/android"
|
|
style="@android:style/Widget.Material.Button"
|
|
android:stateListAnimator="@null"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="match_parent"
|
|
android:minWidth="0dp"
|
|
android:minHeight="@dimen/smart_reply_button_min_height"
|
|
android:paddingVertical="@dimen/smart_reply_button_padding_vertical"
|
|
android:background="@drawable/smart_reply_button_background"
|
|
android:gravity="center"
|
|
android:fontFamily="roboto-medium"
|
|
android:textSize="@dimen/smart_reply_button_font_size"
|
|
android:lineSpacingExtra="@dimen/smart_reply_button_line_spacing_extra"
|
|
android:textColor="@color/smart_reply_button_text"
|
|
android:drawablePadding="@dimen/smart_action_button_icon_padding"
|
|
android:textStyle="normal"
|
|
android:ellipsize="none"/>
|