public class HeadsUpManager extends Object implements ViewTreeObserver.OnComputeInternalInsetsListener
Modifier and Type | Class and Description |
---|---|
static class |
HeadsUpManager.Clock |
class |
HeadsUpManager.HeadsUpEntry
This represents a notification and how long it is in a heads up mode.
|
static interface |
HeadsUpManager.OnHeadsUpChangedListener |
Constructor and Description |
---|
HeadsUpManager(Context context,
View statusBarWindowView,
NotificationGroupManager groupManager) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(HeadsUpManager.OnHeadsUpChangedListener listener) |
void |
addSwipedOutNotification(String key)
Notifies that a notification was swiped out and will be removed.
|
int |
compare(com.android.systemui.statusbar.NotificationData.Entry a,
com.android.systemui.statusbar.NotificationData.Entry b)
Compare two entries and decide how they should be ranked.
|
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
Collection<HeadsUpManager.HeadsUpEntry> |
getAllEntries() |
PhoneStatusBar |
getBar() |
com.android.systemui.statusbar.NotificationData.Entry |
getEntry(String key) |
HeadsUpManager.HeadsUpEntry |
getTopEntry() |
int |
getTopHeadsUpPinnedHeight() |
boolean |
hasPinnedHeadsUp() |
static boolean |
isClickedHeadsUpNotification(View child) |
boolean |
isHeadsUp(String key) |
boolean |
isSnoozed(String packageName) |
boolean |
isTrackingHeadsUp() |
void |
onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info)
Callback method to be invoked when layout has completed and the
client can compute its interior insets.
|
void |
onExpandingFinished() |
void |
releaseAllImmediately()
Push any current Heads Up notification down into the shade.
|
void |
releaseImmediately(String key) |
boolean |
removeNotification(String key,
boolean ignoreEarliestRemovalTime)
React to the removal of the notification in the heads up.
|
void |
setBar(PhoneStatusBar bar) |
void |
setExpanded(com.android.systemui.statusbar.NotificationData.Entry entry,
boolean expanded)
Set an entry to be expanded and therefore stick in the heads up area if it's pinned
until it's collapsed again.
|
void |
setHeadsUpGoingAway(boolean headsUpGoingAway)
Set that we are exiting the headsUp pinned mode, but some notifications might still be
animating out.
|
static void |
setIsClickedNotification(View child,
boolean clicked) |
void |
setIsExpanded(boolean isExpanded) |
void |
setRemoteInputActive(com.android.systemui.statusbar.NotificationData.Entry entry,
boolean remoteInputActive) |
void |
setTrackingHeadsUp(boolean trackingHeadsUp) |
void |
setUser(int user) |
boolean |
shouldSwallowClick(String key)
Decides whether a click is invalid for a notification, i.e it has not been shown long enough
that a user might have consciously clicked on it.
|
void |
showNotification(com.android.systemui.statusbar.NotificationData.Entry headsUp)
Called when posting a new notification to the heads up.
|
void |
snooze() |
void |
unpinAll() |
void |
updateNotification(com.android.systemui.statusbar.NotificationData.Entry headsUp,
boolean alert)
Called when updating or posting a notification to the heads up.
|
public HeadsUpManager(Context context, View statusBarWindowView, NotificationGroupManager groupManager)
public void setBar(PhoneStatusBar bar)
public void addListener(HeadsUpManager.OnHeadsUpChangedListener listener)
public PhoneStatusBar getBar()
public void showNotification(com.android.systemui.statusbar.NotificationData.Entry headsUp)
public void updateNotification(com.android.systemui.statusbar.NotificationData.Entry headsUp, boolean alert)
public boolean removeNotification(String key, boolean ignoreEarliestRemovalTime)
public boolean isHeadsUp(String key)
public void releaseAllImmediately()
public void releaseImmediately(String key)
public boolean isSnoozed(String packageName)
public void snooze()
public com.android.systemui.statusbar.NotificationData.Entry getEntry(String key)
public Collection<HeadsUpManager.HeadsUpEntry> getAllEntries()
public HeadsUpManager.HeadsUpEntry getTopEntry()
public boolean shouldSwallowClick(String key)
key
- the key of the touched notificationpublic void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info)
ViewTreeObserver.OnComputeInternalInsetsListener
onComputeInternalInsets
in interface ViewTreeObserver.OnComputeInternalInsetsListener
info
- Should be filled in by the implementation with
the information about the insets of the window. This is called
with whatever values the previous OnComputeInternalInsetsListener
returned, if there are multiple such listeners in the window.public void setUser(int user)
public void dump(FileDescriptor fd, PrintWriter pw, String[] args)
public boolean hasPinnedHeadsUp()
public void addSwipedOutNotification(String key)
key
- the notification keypublic void unpinAll()
public void onExpandingFinished()
public void setTrackingHeadsUp(boolean trackingHeadsUp)
public boolean isTrackingHeadsUp()
public void setIsExpanded(boolean isExpanded)
public int getTopHeadsUpPinnedHeight()
public int compare(com.android.systemui.statusbar.NotificationData.Entry a, com.android.systemui.statusbar.NotificationData.Entry b)
public void setHeadsUpGoingAway(boolean headsUpGoingAway)
public static void setIsClickedNotification(View child, boolean clicked)
public static boolean isClickedHeadsUpNotification(View child)
public void setRemoteInputActive(com.android.systemui.statusbar.NotificationData.Entry entry, boolean remoteInputActive)
public void setExpanded(com.android.systemui.statusbar.NotificationData.Entry entry, boolean expanded)