Methods Summary |
---|
public static void | addAction(Notification.Builder b, NotificationCompatBase.Action action)
Notification.Action.Builder actionBuilder = new Notification.Action.Builder(
action.getIcon(), action.getTitle(), action.getActionIntent());
if (action.getRemoteInputs() != null) {
for (RemoteInput remoteInput : RemoteInputCompatApi20.fromCompat(
action.getRemoteInputs())) {
actionBuilder.addRemoteInput(remoteInput);
}
}
if (action.getExtras() != null) {
actionBuilder.addExtras(action.getExtras());
}
b.addAction(actionBuilder.build());
|
public static NotificationCompatBase.Action | getAction(android.app.Notification notif, int actionIndex, NotificationCompatBase.Action.Factory actionFactory, RemoteInputCompatBase.RemoteInput.Factory remoteInputFactory)
return getActionCompatFromAction(notif.actions[actionIndex], actionFactory, remoteInputFactory);
|
private static NotificationCompatBase.Action | getActionCompatFromAction(Notification.Action action, NotificationCompatBase.Action.Factory actionFactory, RemoteInputCompatBase.RemoteInput.Factory remoteInputFactory)
RemoteInputCompatBase.RemoteInput[] remoteInputs = RemoteInputCompatApi20.toCompat(
action.getRemoteInputs(), remoteInputFactory);
return actionFactory.build(action.icon, action.title, action.actionIntent,
action.getExtras(), remoteInputs);
|
private static Notification.Action | getActionFromActionCompat(NotificationCompatBase.Action actionCompat)
Notification.Action.Builder actionBuilder = new Notification.Action.Builder(
actionCompat.getIcon(), actionCompat.getTitle(), actionCompat.getActionIntent())
.addExtras(actionCompat.getExtras());
RemoteInputCompatBase.RemoteInput[] remoteInputCompats = actionCompat.getRemoteInputs();
if (remoteInputCompats != null) {
RemoteInput[] remoteInputs = RemoteInputCompatApi20.fromCompat(remoteInputCompats);
for (RemoteInput remoteInput : remoteInputs) {
actionBuilder.addRemoteInput(remoteInput);
}
}
return actionBuilder.build();
|
public static NotificationCompatBase.Action[] | getActionsFromParcelableArrayList(java.util.ArrayList parcelables, NotificationCompatBase.Action.Factory actionFactory, RemoteInputCompatBase.RemoteInput.Factory remoteInputFactory)Get a list of notification compat actions by parsing actions stored within a list of
parcelables using the {@link Bundle#getParcelableArrayList} function in the same
manner that framework code would do so. In API20, Using Action parcelable directly
is correct.
if (parcelables == null) {
return null;
}
NotificationCompatBase.Action[] actions = actionFactory.newArray(parcelables.size());
for (int i = 0; i < actions.length; i++) {
Notification.Action action = (Notification.Action) parcelables.get(i);
actions[i] = getActionCompatFromAction(action, actionFactory, remoteInputFactory);
}
return actions;
|
public static java.lang.String | getGroup(android.app.Notification notif)
return notif.getGroup();
|
public static boolean | getLocalOnly(android.app.Notification notif)
return (notif.flags & Notification.FLAG_LOCAL_ONLY) != 0;
|
public static java.util.ArrayList | getParcelableArrayListForActions(NotificationCompatBase.Action[] actions)Get an array list of parcelables, suitable for {@link Bundle#putParcelableArrayList},
that matches what framework code would do to store an actions list in this way. In API20,
action parcelables were directly placed as entries in the array list.
if (actions == null) {
return null;
}
ArrayList<Parcelable> parcelables = new ArrayList<Parcelable>(actions.length);
for (NotificationCompatBase.Action action : actions) {
parcelables.add(getActionFromActionCompat(action));
}
return parcelables;
|
public static java.lang.String | getSortKey(android.app.Notification notif)
return notif.getSortKey();
|
public static boolean | isGroupSummary(android.app.Notification notif)
return (notif.flags & Notification.FLAG_GROUP_SUMMARY) != 0;
|