summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
AgeCommit message (Collapse)Author
2022-03-15Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: Idfdd94e902f656ac65a2a75dfdd199f6f85ba472
2021-08-20Update clear all animationLyn Han
- 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 Merged-In: I4db85068f46b95a34e71abb6428d3c2ae757cf0a
2021-06-16When swiping notifications it doesn't clip early anymoreSelim Cinek
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
2021-04-08Move ActivityLaunchAnimator in its own lib. (1/n)Jordan Demeulenaere
Bug: 184121838 Test: Manual Change-Id: Ib979fed2f59d9dbf5f0696edb5fcb4956600e6e0
2021-03-09Round adjacent corners when swiping notificationLyn Han
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
2020-11-23Fix race condition that skips corner updates on half swipeLyn Han
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
2020-11-19Consolidate swipe state in SwipeHelperLyn Han
- 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
2020-09-01Decouple DividerView from SystemUIJerry Chang
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
2020-08-24Pass interaction type to FalsingManager.isFalseDave Mankoff
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
2020-08-19Move NotificationSwipeHelper out of NSSLDave Mankoff
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
2020-03-23Support deep press on notifications.Philip Quinn
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
2020-01-03Disable falsing when resting on a Dock.Dave Mankoff
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
2019-12-18FlingAnimationUtils now takes DisplayMetrics, not Context.Dave Mankoff
Bug: 146496319 Test: atestSystemUITests && manual Change-Id: I5a400d2ac500d044d50a878a5b2e5aa7f304628a
2019-07-08Pass FalsingManager down through more classes.Dave Mankoff
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
2019-05-10Add support for FalsingPlugin to supply a replacement FalsingManager.Dave Mankoff
Bug: 130256776 Test: Manual Change-Id: Icdf150e6e23d216f04a9243fe57919aa622706d5
2019-05-03Change FalsingManager to an interface for easier swapping.Dave Mankoff
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
2019-04-04Expose notification guts on menu shownEvan Laird
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)
2019-02-21Use fling animation utils for snapChildMady Mellor
Test: manual - swipe open and close the menu beneath the notification shade ensure the motion follows finger Bug: 124097982 Change-Id: I446932d52ccd0d0055d0e37641d9c40c1bd61bd2
2019-01-17Applies friction to non-dismiss drag only after the snap point.Gus Prevas
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
2018-11-15Fix regression where drag down could start during swipe.Aaron Heuckroth
Test: Automated tests pass, manual testing for swipe behavior on lockscreen. Change-Id: Id9c9b9ccb9102bbdaa9a9ebe76b96beb4060933b Fixes: 118786971
2018-11-07Merge "Create a way to turn off unlocking on a phone."Dave Mankoff
2018-11-07Disables dismissing notification on leftward swipe.Gus Prevas
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
2018-10-26Create a way to turn off unlocking on a phone.Dave Mankoff
This helps collect "True Falsing" data on phones to know when they should not be unlocked. Bug: 117600098 Change-Id: I07ecc00e2189300eff48c599572f7fa3f9dccdd7 Test: manual testing.
2018-10-18Clean up interfaces for StackScrollLayout.Aaron Heuckroth
Test: Automated tests should pass. Change-Id: Ibf2718bfaacff0adcfca7ef8ca2f3eb2b867debf
2018-09-27Extract NotificationSwipeHelper and related state from NSSL.Aaron Heuckroth
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.)
2018-07-18Organize notification classes in row/stackRohan Shah
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
2018-01-15Add canChildBeDraggable() method to SwipeHelper's callbackyoshiki iguchi
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
2017-10-11Handle Keyboard long-presses and Talkback shortcut on notificationsGeoffrey Pitsch
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
2017-08-25Revert "Support keyboard long-press on notifications"Selim Cinek
This reverts commit 2ca798932ea2945184df1c5500b5b9f08af9af55. Fixes: 65061056 Change-Id: I88bcb549b9e76958d280625a96796791b6f29060
2017-08-24Support keyboard long-press on notificationsGeoffrey Pitsch
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
2017-08-18Fixed a bug where a removed notification would stick aroundSelim Cinek
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
2017-08-10Fixing typo in swipe helper causing views not to be faded when swiped.Winson Chung
Bug: 63516235 Test: Enable flag to fade when swiped and verify it fades Change-Id: I49e7840d5423d018c1f88a02e8b272c80d0143a2
2017-06-221. Replace use of java.util.HashMap with android.util.ArrayMap inRajeev Kumar
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
2017-06-12Updates to NotificationMenuRowPlugin so that long press may be capturedMady Mellor
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
2017-05-26Merge "Check for false touches when determining if the notif menu should be ↵Mady Mellor
shown" into oc-dev am: 70739fb812 am: 2cd3e9c500 Change-Id: I393a87e48487ec51fc563cc1cb9f50d604970dc0
2017-05-25Check for false touches when determining if the notif menu should be shownMady Mellor
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
2017-04-27Merge "Improve swipe to show notification menu gesture" into oc-dev am: ↵Mady Mellor
aa94a61c56 am: b4809f27e7 Change-Id: Iab5388ffe09840d66aea0f4914582466cac44000
2017-04-27Merge "Improve swipe to show notification menu gesture" into oc-devMady Mellor
2017-04-20Allow notifications to be smaller in width than its container.Anthony Chen
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
2017-04-17Fix issue where the notification could snap to the menu while its invisibleMady Mellor
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
2017-04-14Improve swipe to show notification menu gestureMady Mellor
- 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
2017-03-22Add plugin interfaces to control notification menu / swipe behaviorMady Mellor
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
2017-01-25Add snooze to notification menu rowMady Mellor
Moves the snooze plugin code into system UI. Does not include assistant suggestions. Test: manual Change-Id: Ie2c51d65381530c9a72cd8a871efdbf0d63da490
2017-01-25Rename notification settings icon row / gear to notification menu rowMady Mellor
Test: manual Change-Id: I3a84c5ea180bd1e53495c5a44a93fa1982056174
2017-01-25Create + implement plugin for NotificationSettingsIconRowMady Mellor
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
2016-04-25Merge "Fix gear being covered on notification update" into nyc-devMady Mellor
2016-04-18Making the dismiss animation feel smoother.Winson
Bug: 27154882 Change-Id: Idbabfe396bc75b598861fd12b78c846f08243a90
2016-04-18Fix gear being covered on notification updateMady Mellor
If a notification is updated to be non clearable but is in the middle of being dismissed then it is snapped back into place. Part of the ways to check if it was being dismissed is by checking the translation of the notification. In the case that the notification was translated to display the gear, then when it was updated it would be snapped back over the gear. This CL fixes this issue by snapping back to the gear instead of 0 in this situation. Bug: 28019486 Change-Id: Ic6c4c29b0adee15d7b358fcdbc8446e8a4cd9f82
2016-04-06Fix dismiss all clipping for tablet / landscapeMady Mellor
Shouldn't animate the whole view, use the translatable views so that they get clipped on tablet / landscape. Additionally this changes the behavior in the case where the gear might be showing, previously that would hide prior to the dismiss all animation, UX prefers this to just have the notification cover the gear and slide away or the gear fade away depending on the side it's showing. Bug: 28006639 Change-Id: I43027cb29410496de5b6e09c4a0c57a69484295c
2016-04-04Merge "Fix slow dismiss animation" into nyc-devMady Mellor