mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Add swipe-to-dismiss notifications in popup menu.
- Next secondary icon animates up to replace dismissed main notification - Add padding around main notification so it always aligns with the straight edges of the view (not the rounded corners); looks more dismissable - Notification view collapses as notifications are dismissed - To mimic system notification behavior, we copy SwipeHelper, FlingAnimationUtils, and Interpolators. We also apply elevation to notifications and reveal a darker color beneath when dismissing. Bug: 32410600 Change-Id: I9fbf10e73bb4996f17ef061c856efb013967d972
This commit is contained in:
@@ -129,10 +129,7 @@ public class FastBitmapDrawable extends Drawable {
|
||||
mBadgeInfo = badgeInfo;
|
||||
mBadgeRenderer = badgeRenderer;
|
||||
if (wasBadged || isBadged) {
|
||||
if (mBadgeInfo != null && mIconPalette == null) {
|
||||
mIconPalette = IconPalette.fromDominantColor(Utilities
|
||||
.findDominantColorByHue(mBitmap, 20));
|
||||
}
|
||||
mIconPalette = getIconPalette();
|
||||
invalidateSelf();
|
||||
}
|
||||
}
|
||||
@@ -161,6 +158,14 @@ public class FastBitmapDrawable extends Drawable {
|
||||
}
|
||||
}
|
||||
|
||||
public IconPalette getIconPalette() {
|
||||
if (mIconPalette == null) {
|
||||
mIconPalette = IconPalette.fromDominantColor(Utilities
|
||||
.findDominantColorByHue(mBitmap, 20));
|
||||
}
|
||||
return mIconPalette;
|
||||
}
|
||||
|
||||
private boolean hasBadge() {
|
||||
return mBadgeInfo != null && mBadgeInfo.getNotificationCount() != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user