Visuals for Inline Reply
Change-Id: I374a7ec82795f95fe2f3ce8c9e6b02c1479433af
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 0b77be3..af990de 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3311,12 +3311,17 @@
tombstone ? getActionTombstoneLayoutResource()
: getActionLayoutResource());
final Icon ai = action.getIcon();
- button.setTextViewCompoundDrawablesRelative(R.id.action0, ai, null, null, null);
button.setTextViewText(R.id.action0, processLegacyText(action.title));
if (!tombstone) {
button.setOnClickPendingIntent(R.id.action0, action.actionIntent);
}
button.setContentDescription(R.id.action0, action.title);
+ if (action.mRemoteInputs != null) {
+ button.setRemoteInputs(R.id.action0, action.mRemoteInputs);
+ }
+ if (mN.color != COLOR_DEFAULT) {
+ button.setTextColor(R.id.action0, mN.color);
+ }
processLegacyAction(action, button);
return button;
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index ca1b211..ce1c108 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -21,6 +21,7 @@
import android.app.ActivityThread;
import android.app.Application;
import android.app.PendingIntent;
+import android.app.RemoteInput;
import android.appwidget.AppWidgetHostView;
import android.content.Context;
import android.content.ContextWrapper;
@@ -153,6 +154,13 @@
};
/**
+ * @hide
+ */
+ public void setRemoteInputs(int viewId, RemoteInput[] remoteInputs) {
+ mActions.add(new SetRemoteInputsAction(viewId, remoteInputs));
+ }
+
+ /**
* Handle with care!
*/
static class MutablePair<F, S> {
@@ -1699,6 +1707,43 @@
}
/**
+ * Helper action to add a view tag with RemoteInputs.
+ */
+ private class SetRemoteInputsAction extends Action {
+
+ public SetRemoteInputsAction(int viewId, RemoteInput[] remoteInputs) {
+ this.viewId = viewId;
+ this.remoteInputs = remoteInputs;
+ }
+
+ public SetRemoteInputsAction(Parcel parcel) {
+ viewId = parcel.readInt();
+ remoteInputs = parcel.readParcelableArray(RemoteInput.class.getClassLoader());
+ }
+
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(TAG);
+ dest.writeInt(viewId);
+ dest.writeParcelableArray(remoteInputs, flags);
+ }
+
+ @Override
+ public void apply(View root, ViewGroup rootParent, OnClickHandler handler) {
+ final TextView target = (TextView) root.findViewById(viewId);
+ if (target == null) return;
+
+ target.setTagInternal(R.id.remote_input_tag, remoteInputs);
+ }
+
+ public String getActionName() {
+ return "SetRemoteInputsAction";
+ }
+
+ final Parcelable[] remoteInputs;
+ public final static int TAG = 18;
+ }
+
+ /**
* Simple class used to keep track of memory usage in a RemoteViews.
*
*/
@@ -1894,6 +1939,9 @@
case TextViewDrawableColorFilterAction.TAG:
mActions.add(new TextViewDrawableColorFilterAction(parcel));
break;
+ case SetRemoteInputsAction.TAG:
+ mActions.add(new SetRemoteInputsAction(parcel));
+ break;
default:
throw new ActionException("Tag " + tag + " not found");
}
diff --git a/core/res/res/layout/notification_material_action.xml b/core/res/res/layout/notification_material_action.xml
index da8b2e7..f4bc918 100644
--- a/core/res/res/layout/notification_material_action.xml
+++ b/core/res/res/layout/notification_material_action.xml
@@ -18,15 +18,11 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
style="@android:style/Widget.Material.Light.Button.Borderless.Small"
android:id="@+id/action0"
- android:layout_width="0dp"
+ android:layout_width="wrap_content"
android:layout_height="48dp"
- android:layout_weight="1"
- android:layout_margin="0dp"
- android:gravity="start|center_vertical"
- android:drawablePadding="8dp"
- android:paddingStart="8dp"
+ android:layout_gravity="center"
+ android:layout_marginStart="8dp"
android:textColor="@color/secondary_text_material_light"
- android:textSize="13sp"
android:singleLine="true"
android:ellipsize="end"
android:background="@drawable/notification_material_action_background"
diff --git a/core/res/res/layout/notification_material_action_list.xml b/core/res/res/layout/notification_material_action_list.xml
index 2a36949..edaf020 100644
--- a/core/res/res/layout/notification_material_action_list.xml
+++ b/core/res/res/layout/notification_material_action_list.xml
@@ -14,14 +14,20 @@
limitations under the License.
-->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/actions"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:visibility="gone"
- android:layout_marginBottom="8dp"
- >
- <!-- actions will be added here -->
-</LinearLayout>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/actions_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <LinearLayout
+ android:id="@+id/actions"
+ android:layout_width="match_parent"
+ android:layout_height="56dp"
+ android:paddingEnd="8dp"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ android:background="#ffeeeeee"
+ >
+ <!-- actions will be added here -->
+ </LinearLayout>
+</FrameLayout>
diff --git a/core/res/res/values/ids.xml b/core/res/res/values/ids.xml
index 9d5e5ac..c03fbeb 100644
--- a/core/res/res/values/ids.xml
+++ b/core/res/res/values/ids.xml
@@ -122,4 +122,6 @@
<!-- Accessibility action identifier for {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction#ACTION_CONTEXT_CLICK}. -->
<item type="id" name="accessibilityActionContextClick" />
+
+ <item type="id" name="remote_input_tag" />
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index e8f6b46..5516360 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2302,6 +2302,9 @@
<java-symbol type="string" name="notification_inbox_ellipsis" />
<java-symbol type="bool" name="config_mainBuiltInDisplayIsRound" />
+ <java-symbol type="id" name="actions_container" />
+ <java-symbol type="id" name="remote_input_tag" />
+
<java-symbol type="attr" name="seekBarDialogPreferenceStyle" />
<java-symbol type="string" name="ext_media_status_removed" />
<java-symbol type="string" name="ext_media_status_unmounted" />