summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/notification/NotificationItemView.java
Commit message (Collapse)AuthorAgeFilesLines
* Adjust notification paddingsTony Wickham2017-09-061-2/+12
| | | | | | | | | - Reduce main notification height - Increase header height and center "Notifications" - Footer has short height when empty to serve as padding Bug: 65215656 Change-Id: I691d176628b0b51e8d9af030084b8c29837778dc
* Using common fling detection logic for notification and all-appsSunny Goyal2017-07-201-9/+13
| | | | | | | | > Refactoring SwipeDetector to both allow vertical and horizontal swipes > Using SwipeDetector and common overscroll effect for notification swipes instead of a separate logic Change-Id: Ib706ee179811ade59ddb68184e1c202365d147c4
* Keep gutter aligned when removing notification footerTony2017-07-061-2/+18
| | | | | Bug: 63262764 Change-Id: I94e7978dafc04fc2673a9bb8c6d24ff20641416f
* Popup visual changesTony Wickham2017-06-271-0/+3
| | | | | | | | | | | - Don't remove elevation during animation (b/62905720) - Other adjustments (b/35766387) - Add "gutter" between notification and shortcuts - Change shortcuts to always be primary color (e.g. white) - Scale down shortcut icons when notifications present - Apply icon extracted color to "Notifications" header Change-Id: Idf791dc76d15d05d246000ad73810916d7cd1750
* Show more shortcuts when last notification is dimissedTony2017-06-151-3/+8
| | | | | | | | | | | | | | | | We currently only show 2 shortcuts when notifications are present, but support up to 4 otherwise. With this change, the hidden shortcuts are added back after dismissing the notifications, instead of only after closing and reopening the container. To ensure the transition is as elegant as possible, we also separated the shortcuts header from the rest of the shortcuts. That way we can reveal the new shortcuts without removing the header (the shortcuts come out from behind the header). Bug: 38036250 Change-Id: Ie9ab35f9be57cec1d5345e9e70e84e09ea52c9fc
* Generalize findContrastColor() to work for dark backgroundsTony Wickham2017-06-061-1/+1
| | | | | | | Previously it assumed the background was lighter than the foreground. Bug: 62380473 Change-Id: Icd53750a2f9181890c8b9c62721d07946e115e99
* Add support for popup dark themeTony Wickham2017-06-061-1/+2
| | | | | Bug: 62380473 Change-Id: Ib22e9b82841bf10b7f139638f268f0a878e3c6b9
* Remove gap between popup itemsTony2017-05-311-12/+5
| | | | | | | | | | | | | - Unround interior corners - Update colors (shortcuts are gray when next to notifications, notifications always white) - Clean up animation to animate entire popup with simple reveal instead of individual items animating with reveal and icon scale Bug: 35766387 Bug: 36110804 Change-Id: I33685d53e2db3904731676123dc230be4dabb5d4
* Update accessibility for popupTony2017-05-111-0/+4
| | | | | | | | | | | - Content description includes count of notifications. - Notifications have a dismiss action. - All icons that support shortcuts will have action to show shortcut menu, since there will be system shortcuts even if there are no deep shortcuts. Bug: 36564782 Change-Id: I51b085fa26754f2dcd93c7db6548f2edf054f494
* Visual updates for popupTony2017-05-091-1/+9
| | | | | | | | | | | | | | | - Update some dimens - Increase left padding for shortcuts - Adjust arrow and notification ellipsis offset accordingly - Align shortcut dividers to be same width as text - Notification text 14sp instead of 15sp - Increase width of popup by 12dp - Shortcuts text 87% black instead of 54% - Arrow has same color as attached side, so takes on header gray instead of white when appropriate Bug: 37753827 Change-Id: I0844b85995f22218a3b7e605e1653cceaed6cda1
* Handle back-to-back height reduction animationsTony Wickham2017-04-271-0/+5
| | | | | | | | | | | | | We reduce the height of the notification item when the second to last notification is dismissed (to remove the unused footer) and when the last notification is removed (to remove the unused notification item). If the former is runninng when the latter starts, the end result is janky because we weren't properly cleaning up the first animation when the second began. We now cancel the existing animation before starting the second. Bug: 36172954 Change-Id: I742c15b6f59874bc675b4c20a83e9578ac5e5387
* Update popup to match redlinesTony Wickham2017-04-111-4/+17
| | | | | | | | | | | - Update specs in dimens.xml and colors.xml - Move notification count to top right, and keep "Notifications" in left - Also removed NotificationHeaderView and instead use FrameLayout - Limit to 2 shortcuts instead of 3 if there are notifications - Use SP instead of DP for text (b/35869307) Bug: 35766387 Change-Id: I892640933ad6351946af3df6c805b98bb4e7cb50
* Only create one bitmap to clip popup item cornersTony Wickham2017-04-071-14/+1
| | | | | | | | | | | | | | | | Previously we created a bitmap the size of the entire popup item and drew a rounded rect in it to clip the corners. Now we create a bitmap that is only the size of the rounded corner radius, and rotate and translate it to all four corners to achieve the same clipping. Besides the reduced memory of this approach, it also simplifies things when we reduce the item's height (e.g. when the second to last notification is dismissed), because we no longer have to recreate the background bitmap to match the new size; the translation calculations in dispatchDraw() automatically take the current size into account. Bug: 35869307 Change-Id: I938bbc4bd87479580287426b4197516caf1a64d4
* Small cleanup for notificationsTony Wickham2017-03-151-3/+0
| | | | | | | | | - Add null check when collapsing footer, as container could be null if the app is opened - Remove redundant method that always passed mNotificationItemView - Set mNotificationItemView to null when it is removed Change-Id: Ia329815224b213fc688733eaaf6f29ee6888caaf
* Update notification visuals (part 2)Tony Wickham2017-03-021-18/+6
| | | | | | | | | | | | | | - Background is now white, and color beneath and divider color updated accordingly (not from color extraction) - Removed overflow text ("+6") and added it to a header ("6 Notifications"). Use "..." instead if there is an overflow. - Even spaced out icons in notification footer between the far right icon and the ellipsis - Remove code to change arrow tint, since it is always white now. This also fixes the issue where it was drawn as a rect. Bug: 35766387 Change-Id: I03bfda4ff029f23dd8b3dd1b72f534ea0e2c0816
* Merge deep shortcuts in rounded rectTony Wickham2017-03-011-45/+1
| | | | | | | | | | | | | | | | | - DeepShortcutViews are added to ShortcutsItemView, which is in PopupContainerWithArrow - Moved some shortcut-specific logic to ShortcutsItemView (namely, touch/long-click handling for draggin shortcuts) - Moved round-rect clipping to PopupItemView - Removed collapseToIcon() logic, including PillWidthRevealOutlineProvider, which was only used for that purpose. It isn't necessary now that the deep shortcuts have no background themselves. - Replaced focus pill drawable with ripple effect on shortcuts and notification view. Bug: 35766387 Change-Id: I6bc09f1851cfbb806df4bf75a6e435b0f1900c9c
* Update notification view to match newer specsTony Wickham2017-02-241-32/+68
| | | | | | | | | | | - Use smaller radius for notifications round rect background - Remove "Notifications" header, and clip children to round rect path - Flip main notification so that icon shows on the right instead of left; footer is also flipped so animation makes sense - Clean up animations to animate view outline instead of height Bug: 32410600 Change-Id: I6bd1e1f8395b3703f28c3b0056a89e67672368ab
* Remove first icon from notification footer after it animates.Tony Wickham2017-02-221-7/+0
| | | | | | | | | | | | Before, we had a hack where the notifation view would tell the footer to trim its notifications, which is inefficient and ugly since we already know exactly what notification to remove. So now we move the relevant removal logic (keeping things like the overflow text in sync) to a removeViewFromIconRow() that is used after the icon animates as well as when trimming notifications. Bug: 32410600 Change-Id: I19e54e0c28daea869b45649c7f5c74843412bb86
* Ignore touches before notification is populatedTony Wickham2017-02-151-0/+8
| | | | | Bug: 35398757 Change-Id: I24f1b66787af7c7caeb325e9a1f3e6ef86e62b81
* Add logging for notifications.Tony Wickham2017-02-071-5/+11
| | | | | | | | | | | | | - Log notification launches - Log notification swipes - Fix logDragNDrop() to only log if the pre-drag ends (so it doesn't log a long-press that only shows shortcuts without dragging). - Add shortcut rank to logs when launching deep shortcuts, where 0 is the shortcut closest to the app icon (highest rank). Bug: 34770729 Bug: 32410600 Change-Id: I99dcef9b6a71da2ef58e32397702bb137407b10f
* Ensure notification icons have enough contrast with background.Tony Wickham2017-01-271-2/+4
| | | | | | | | | This uses the same color calculations as the system, except that we use the extracted notification background instead of assuming it is white. Bug: 32410600 Change-Id: I7be8b9459ca38d01a6780758898541e69ec42576
* Store notification keys in a List instead of a Set.Tony Wickham2017-01-261-4/+6
| | | | | | | | This will preserve the order when iterating over the notifications to populate the popup container. Bug: 34735689 Change-Id: Ic390ffef140e454566ffc6ab1763950349df25ce
* Add swipe-to-dismiss notifications in popup menu.Tony Wickham2017-01-251-0/+173
- 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