summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
Commit message (Collapse)AuthorAgeFilesLines
* Add content fade to notification dismissalJohannes Gallmann2022-10-071-3/+17
| | | | | | Test: Manual and NotificationSwipeHelperTest Bug: 202138492 Change-Id: I9833e9d434cc32bbc0d128f608ab62adb24b1b09
* Break pipeline re-entrant call due to dismiss animSteve Elliott2022-05-131-2/+4
| | | | | | | | | | | Fixes: 224606120 Test: manual 1. Have one clearable notification in the shade 2. Tap "Clear All" 3. Receive an update to the notification before the animation has completed 4. Verify no crash Change-Id: Iefd021ac6bf6ca9c959a6f410ca96f51e77142cd
* Fix notification drag and drop flagJeff DeCew2022-02-041-2/+7
| | | | | Test: manual Change-Id: I296cf64e76e82486353f2ea3f3b34cfa474677f2
* Add CUJ_NOTIFICATION_SHADE_ROW_SWIPE CUJMilton Wu2021-11-111-0/+14
| | | | | | | | | | | Add CUJ_NOTIFICATION_SHADE_ROW_SWIPE for recording during a notification is being swiped by user. Bug: 199715431 Test: atest com.android.systemui.statusbar.notification.stack.NotificationSwipeHelperTest Change-Id: I5f4f751766906d87c91ff81cba22094deba3caf3
* Update clear all animationLyn Han2021-08-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fade out clear all button on tap - Fade out silent label once there are no silent notifs - Fade out footer once there are no notifs - Round corners of dismissing notifs - Pause to show "no notifications" before closing shade Timing - Remove wait before clear all swipe animations start - Wait less between individual swipe animations - Faster swipe animation Bug: 172065269 Test: clear all with scroll, silent notifs, no ongoing notifs => clear button fades out on tap => clearable notifs swipe out with new delay, timing => silent header fades => no scroll change => show "no notifications" at top of shade => close shade Test: clear all with no scroll, ongoing silent notifs => clearable silent notifs swipe out => ongoing silent notifs stay => silent header "x" fades => show "no notifications" at top of shade => close shade Test: clear a lot of notifications => pause same amount of time after swipe animations before closing shade Test: press "x" to clear silent notifications => silent notifications animate away => shade stays open if there are other clearable notifs Change-Id: I4db85068f46b95a34e71abb6428d3c2ae757cf0a
* [SystemUI] Add notification to window feature.e.min2021-08-061-26/+76
| | | | | | | | | | | | | | | | | | | Start apps intent through notification drag and drop. When user click the notification, its app activity was launched as a new task, but through this notification to window feature, user can launch app activity to popup(or split) window. Test: When get a HeadsUp notification > Long press it > open GUTS > drag beyond threshold Test: > start drag and drop > launch app as popup or split. Test: Open quick panel > long press any notification > open GUTS > drag beyond threshold Test: > start drag and drop > launch app as popup or split. Design doc : https://docs.google.com/document/d/1nr1-Wj3DLvOMZGP8X6hCekk7pbB2furvHML-gYormdc/edit?ts=6090accb#heading=h.1t3h5sf Bug: b/187095469 Signed-off-by: e.min <e.min@samsung.com> Change-Id: Id7cd114e1afb7f484a4fa3db615a82d92d01a645
* When swiping notifications it doesn't clip early anymoreSelim Cinek2021-06-161-2/+11
| | | | | | | | | | | | | | Previously notifications started to clip before reaching the edge. We're now changinging the flags to dismiss with translation instead of clipping the contents. This is change 1/2 as the notification container should clip the notification now, which is especially noticeable in split shade. Bug: 181887261 Test: dismiss notifications, visually observe no clipping Change-Id: I003b1486ce64dd127a90ca2d9f982230eba79f60
* Move ActivityLaunchAnimator in its own lib. (1/n)Jordan Demeulenaere2021-04-081-0/+1
| | | | | | Bug: 184121838 Test: Manual Change-Id: Ib979fed2f59d9dbf5f0696edb5fcb4956600e6e0
* Round adjacent corners when swiping notificationLyn Han2021-03-091-11/+5
| | | | | | | | | | | | | | | | | | Unround corners instantly when notification starts to snap back, which feels more responsive. Fix bug where fast consecutive swipes are ignored because we did not set mTouchedView to the latest MotionEvent's view. Bug: 171817112 Test: swiped sandwiched notification => rounds bottom corners of notification before => rounds top corners of notification after (in the same section; other sections not affected) Test: swipe multiple notifications quickly => no jank Change-Id: I1a808dd92f9e46df4767681d861ea73530d732a8
* Fix race condition that skips corner updates on half swipeLyn Han2020-11-231-1/+1
| | | | | | | | | | | Set mIsSwiping true before calling SwipeHelper#Callback#onBeginDrag; otherwise onBeginDrag may use an outdated false and mistakenly include the swiped view as part of a rounded section. Fixes: 173753021 Bug: 171817112 Test: half swipe first and last notifs in section; corners always update Change-Id: I115d30b10657b6edbf94d4d444058bdeeaf9000e
* Consolidate swipe state in SwipeHelperLyn Han2020-11-191-47/+64
| | | | | | | | | - Move state from AmbientState (unneeded for StackScrollerAlgorithm) - Remove repeated state from NSSL Bug: 171817112 Test: half-swipe, full-swipe, longpress a lot, no regressions Change-Id: I6a4e00d69124c44c119ee10057b43185739a8ea3
* Decouple DividerView from SystemUIJerry Chang2020-09-011-1/+1
| | | | | | | | | | | | | | Moves FlingAnimationUtils to wm shell library as a common utils for both wm shell and SystemUI. There are some basic interpolators needed for wm shell library. Since they are relative basic and already been put into different packages, duplicates them directly to wm shell library. Bug: 161116823 Test: atest SystemUITests Test: manual check divider animation Change-Id: Iffabb7eff829cad69ef3d273b803f8fbd3ab6685
* Pass interaction type to FalsingManager.isFalseDave Mankoff2020-08-241-3/+6
| | | | | | | | | | | | This ensures that the falsing manager always is testing against the correct interaction type when it is asked. Prior to this change, we could end up in states where a user was swiping down (opening the quick settings) but the falsing manager believed the user was trying to unlock the phone. Fixes: 160967364 Test: atest SystemUITests && manual Change-Id: I176f54a768622dec3e758a7f01ed8aec26223648
* Move NotificationSwipeHelper out of NSSLDave Mankoff2020-08-191-10/+9
| | | | | | | | | | | | | | Move NotificationSwipeHelper out of NotificationStackScrollLayout and into NotificationStackScrollLayoutController. The swipe helper now has an injectable builder as well. SwipeHelper also no longer takes a context, but instead takes a Resource and a ViewConfiguration. Bug: 147245740 Test: atest SystemUITests && manual Change-Id: I511cc9d7e7739282bcbb2a29bb00ebd276c17b21
* Support deep press on notifications.Philip Quinn2020-03-231-30/+39
| | | | | | | | | | In addition to handling CLASSIFICATION_DEEP_PRESS in SwipeHelper, touch slop calculations are updated for scroll/flick interactions that may be performed on notifications or the notification panel. Fixes: 148172385 Test: notifications expand when deep pressed Change-Id: I49f71f919d762ce1a5da145a9377c70422a66c87
* Disable falsing when resting on a Dock.Dave Mankoff2020-01-031-1/+1
| | | | | | | | | | | | Fix typo: Classifer -> Classifier. Use Executor instead of Handler in falsing related code. Show a dump of BrightLingFalsing related information. Bug: 139785197 Test: atest SystemUITests && manual. Change-Id: I3be68cb9f27ccfb5a686947cc85aae74f21f099c
* FlingAnimationUtils now takes DisplayMetrics, not Context.Dave Mankoff2019-12-181-3/+2
| | | | | | Bug: 146496319 Test: atestSystemUITests && manual Change-Id: I5a400d2ac500d044d50a878a5b2e5aa7f304628a
* Pass FalsingManager down through more classes.Dave Mankoff2019-07-081-3/+3
| | | | | | | | | | | | | | | | This is the first step in getting the code to inject FalsingManager into more places via Dagger. This removes FalsingManagerFactory, replacing it with calls to Depedency.get() and pushes those calls further up the stack in hopes that the FalsingManager can be directly injected where it's needed in the future. Contains a few random lint cleanups. Bug: 136279712 Test: atest SystemUITests Change-Id: Ie24acd33b0d81ae2112aead0c0d5a8658e04994e
* Add support for FalsingPlugin to supply a replacement FalsingManager.Dave Mankoff2019-05-101-1/+1
| | | | | | Bug: 130256776 Test: Manual Change-Id: Icdf150e6e23d216f04a9243fe57919aa622706d5
* Change FalsingManager to an interface for easier swapping.Dave Mankoff2019-05-031-2/+3
| | | | | | | | | | | | | This is a refactor. It touches a lot of files, but zero functionality. The primary change is changing FalsingManager.getInstance() into FalsingManagerFactory.getInstance(); chaning FalsingManager into an interface, and then turning the existing FalsingManager into FalsingManagerImpl, an implementation of that interface. Other changes are merely references to those classes. Bug: 130256776 Test: atest SystemUITests Change-Id: I5d64a7673e4efc554105dd841b27807361ed3828
* Expose notification guts on menu shownEvan Laird2019-04-041-1/+11
| | | | | | | | | | | | | | | | This change adds a few methods to NotificationMenuRowPlugin so that a menu row can tell the stack scroller to expose the notification guts when the menu is fully exposed. TODO: fix the menu close animation so it happens after the guts open, and if you close the guts by swiping you can trigger a flicker. Also there are some things to make lint happy and lots of null checks. Bug: 127998765 Test: swipe RTL on any notification Change-Id: I46f7c7dc90032a1914f7b5513bc57e089887c722 (cherry picked from commit 9272fd2f57e57475cb7ce9967e60946d0770d879)
* Use fling animation utils for snapChildMady Mellor2019-02-211-2/+3
| | | | | | | | Test: manual - swipe open and close the menu beneath the notification shade ensure the motion follows finger Bug: 124097982 Change-Id: I446932d52ccd0d0055d0e37641d9c40c1bd61bd2
* Applies friction to non-dismiss drag only after the snap point.Gus Prevas2019-01-171-2/+16
| | | | | | | | | | | | | This change modifies SwipeHelper such that the friction applied to a constrained gesture (i.e. one that won't dismiss the swiped object) is only applied once the object has been dragged past a threshold defined by the callback object. The callback provided by NotificationStackScrollLayout is modified to set this threshold at the snap point of the active menu row. Change-Id: Ide9261682963d3cfaeb470e08393c182d6fa06c6 Fixes: 123021652 Test: atest SystemUITests, manual
* Fix regression where drag down could start during swipe.Aaron Heuckroth2018-11-151-9/+0
| | | | | | | Test: Automated tests pass, manual testing for swipe behavior on lockscreen. Change-Id: Id9c9b9ccb9102bbdaa9a9ebe76b96beb4060933b Fixes: 118786971
* Merge "Create a way to turn off unlocking on a phone."Dave Mankoff2018-11-071-0/+1
|\
| * Create a way to turn off unlocking on a phone.Dave Mankoff2018-10-261-1/+3
| | | | | | | | | | | | | | | | | | This helps collect "True Falsing" data on phones to know when they should not be unlocked. Bug: 117600098 Change-Id: I07ecc00e2189300eff48c599572f7fa3f9dccdd7 Test: manual testing.
* | Disables dismissing notification on leftward swipe.Gus Prevas2018-11-071-4/+18
|/ | | | | | | | | | | This change modifies SwipeHelper to pass the direction of a swipe to the provided callback when determining whether the swipe represents a valid dismiss gesture, and modifies the callback defined by NotificationStackScrollLayout to allow dismiss gestures only to the right. Test: manually Change-Id: I7ff1e8f92e7da9ed36520195d823f9a62f9a64ba
* Clean up interfaces for StackScrollLayout.Aaron Heuckroth2018-10-181-0/+9
| | | | | Test: Automated tests should pass. Change-Id: Ibf2718bfaacff0adcfca7ef8ca2f3eb2b867debf
* Extract NotificationSwipeHelper and related state from NSSL.Aaron Heuckroth2018-09-271-1/+2
| | | | | Change-Id: Ic0a1178e4f3d6f2addd9bae1c31ec57dffee8eba Test: Automated tests should pass. Manual testing should also show that notifications behave the same as before (swiping, tapping, dismissing, snapping/unsnapping menu, etc.)
* Organize notification classes in row/stackRohan Shah2018-07-181-2/+1
| | | | | | | | | | | No functional changes. Reorganized logic under either row, stack, logging, or row/wrapper. Haven't moved all classes over since there's some classes that create conflicts due to weird use of package-private/protected (primarily waiting for HUN and shelf classes). Test: built, ran, used notifications Bug: 110802404 Change-Id: Ia2152603bdbeb12c522360193511946c843b9266
* Add canChildBeDraggable() method to SwipeHelper's callbackyoshiki iguchi2018-01-151-4/+12
| | | | | | | | | | | | | This callback checks the given child is actually draggable or not. This method is need for ARC, since a child may not be draggable in some cases. FYI: ag/3244118 is the CL for NYC ARC. Bug: 63874929 Bug: 62602530 Test: Compile and ran 'runtest systemui' Change-Id: I085f1c1c72240529a19e0dcb1f543e7cb36899f0
* Handle Keyboard long-presses and Talkback shortcut on notificationsGeoffrey Pitsch2017-10-111-42/+20
| | | | | | | | | | | | An incremental improvement to keyboard support on the status bar. SwipeHelper calls a method on ExpandableNotificationRow, which it then manually invokes from keydown/ups and the AccessibilityAction shortcut. Regular clicks on the lockscreen still do not activate the notification. Bug: 34840327 Test: manual Change-Id: I5b59dec26c5e20237c4136820fff902ff8221371
* Revert "Support keyboard long-press on notifications"Selim Cinek2017-08-251-29/+44
| | | | | | | This reverts commit 2ca798932ea2945184df1c5500b5b9f08af9af55. Fixes: 65061056 Change-Id: I88bcb549b9e76958d280625a96796791b6f29060
* Support keyboard long-press on notificationsGeoffrey Pitsch2017-08-241-44/+29
| | | | | | | | | | | | ExpandableNotificationRow now handles long-clicks for keyboard support. SwipeHelper calls performLongClick to trigger the listener on the row. Now that the View listens to long clicks, SwipeHelper cancels long-presses on the View when it see touch down events, so the event doesn't get duped in the touch case. Bug: 34840327 Test: manual Change-Id: Ibeb93507781443d6b2dac209afd889b1d8d54aeb
* Fixed a bug where a removed notification would stick aroundSelim Cinek2017-08-181-1/+6
| | | | | | | | | | Because we going back to the keyguard, the translation was reset and the callback would not be called, leaving us with a stuck notification. Test: have only 1 notification in shade locked an swipe it away after doing a half-swipe first Change-Id: Iea2db4ff7efa2e84aa36cd13cfa8cfa1859d6892 Fixes: 64762751
* Fixing typo in swipe helper causing views not to be faded when swiped.Winson Chung2017-08-101-1/+1
| | | | | | Bug: 63516235 Test: Enable flag to fade when swiped and verify it fades Change-Id: I49e7840d5423d018c1f88a02e8b272c80d0143a2
* 1. Replace use of java.util.HashMap with android.util.ArrayMap inRajeev Kumar2017-06-221-17/+16
| | | | | | | | | SwipeHelper class 2. Make few instance variables final ArrayMap is more memory efficient than a traditional HashMap, see: https://developer.android.com/reference/android/util/ArrayMap.html Change-Id: I8bb2a4f5386d0c9dd6a802ee87e3adf8c3a59805
* Updates to NotificationMenuRowPlugin so that long press may be capturedMady Mellor2017-06-121-5/+15
| | | | | | | | | | | | | | | This will allow the NotificationMenuRow plugin to do something else rather than showing a menu when the view is long pressed. - Allow menu to intercept touch events - If the menu item provided to long press is null, don’t show it - Also passes the status bar notification when the menu is created or updated Bug: 62534409 Test: manual, have no plugin and long press -> see notification info have a plugin that returns null for long press -> nothing happens Change-Id: I384c5217d5343e990f4c3506eb2477b015705e5c
* Merge "Check for false touches when determining if the notif menu should be ↵Mady Mellor2017-05-261-3/+7
|\ | | | | | | | | | | | | | | shown" into oc-dev am: 70739fb812 am: 2cd3e9c500 Change-Id: I393a87e48487ec51fc563cc1cb9f50d604970dc0
| * Check for false touches when determining if the notif menu should be shownMady Mellor2017-05-251-3/+7
| | | | | | | | | | | | | | | | | | | | If it's a false touch don't show the menu. Test: manual: try swiping things away on the lockscreen (fast + long) try showing notification menu on the lockscreen Bug: 38208094 Change-Id: I16ceedd90a5fbc80156a9495d6cfd6fa02771886
* | Merge "Improve swipe to show notification menu gesture" into oc-dev am: ↵Mady Mellor2017-04-271-6/+9
|\| | | | | | | | | | | | | | | aa94a61c56 am: b4809f27e7 Change-Id: Iab5388ffe09840d66aea0f4914582466cac44000
| * Merge "Improve swipe to show notification menu gesture" into oc-devMady Mellor2017-04-271-6/+9
| |\
| | * Improve swipe to show notification menu gestureMady Mellor2017-04-141-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Increases minimum velocity for dismiss (100->500 dp/sec) - Increases minimum distance for dismiss (40->60% of notification width) - Alters logic when menu was already showing and notification gets moved (if it doesn't move enough sticks to menu, else it looks for dismiss or snap back into position) - Changes swipe helper so that the dismiss direction takes the translation into account Test: manual / had some people play with the gesture Bug: 28693375 Change-Id: Ibe4c51627a78b9c3b7d889cf7e06a63da7113072
* | | Allow notifications to be smaller in width than its container.Anthony Chen2017-04-201-10/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Add a width dimension that the children of the NotificationStackScrollLayout can use to make a separate MeasureSpec for its children. Also, adjust the translation of the row so that the row can be swiped off screen without any clipping if the width is smaller than the notification panel itself. Test: booted on phone and Android Auto headunit Bug: 36692077 Change-Id: Ic8bb8a707c4d91f4e38d5ee3461b406bf14d0042
* / Fix issue where the notification could snap to the menu while its invisibleMady Mellor2017-04-171-2/+11
|/ | | | | | | | | | | | | | | 1) If the snap back animation is cancelled, the menu shouldn't be reset because it hasn't actually been snapped back -- this could happen when the menu was being shown and then the icon alpha would get set to 0 resulting in notification snapped to menu but no menu visible 2) Cancel the callback to fade the menu in on dismiss to match original behavior before refactor of NMR Test: manual - no clear repro steps for this, I could get it by violently moving a notification back and forth, with this patch I haven't been able to repro it. Bug: 37320279 Change-Id: I4eea37e3c454e7324d0e295b0ec2fe022d219253
* Add plugin interfaces to control notification menu / swipe behaviorMady Mellor2017-03-221-9/+14
| | | | | | | | | | | | | | 1) Updates the notification menu plugin to do more: - The plugin can now supply the view it wants to display behind a notification as the menu - Touch interaction (i.e. notification translating on top) is piped through to the plugin so it can update the view behind the notification 2) Makes NotificationMenuRow an implementor of the plugin which moves a bunch of that logic out of NotificationStackScroller Test: runtest systemui Change-Id: I8723b96c195ff7311317d5523418cfcbe2a79b52
* Add snooze to notification menu rowMady Mellor2017-01-251-1/+1
| | | | | | | | Moves the snooze plugin code into system UI. Does not include assistant suggestions. Test: manual Change-Id: Ie2c51d65381530c9a72cd8a871efdbf0d63da490
* Rename notification settings icon row / gear to notification menu rowMady Mellor2017-01-251-3/+2
| | | | | Test: manual Change-Id: I3a84c5ea180bd1e53495c5a44a93fa1982056174
* Create + implement plugin for NotificationSettingsIconRowMady Mellor2017-01-251-2/+15
| | | | | | | | | | | This will allow plugins to supply additional menu options to the menu "behind" a notification. This CL does not include behavior for when one of these new menu items is tapped, this will be added in a separate CL. Test: manual Change-Id: I322f9f39d33b043bd23dcbede5dd15e6afa73fc1
* Merge "Fix gear being covered on notification update" into nyc-devMady Mellor2016-04-251-2/+10
|\