Handle swipe down on taskbar to stash

- Moved all touch-to-stash logic to new TaskbarStashViaTouchController
  (handles both tap outside to stash instantly as well as swipe down
  inside to stash after letting go)
- This is a TouchController on TaskbarDragLayer, so it intercepts
  touches from TaskbarView before icons can be dragged during swipe down

Test: swipe up to invoke transient taskbar in an app, swipe down or
touch outside to stash
Flag: ENABLE_TRANSIENT_TASKBAR=true
Fixes: 246631710

Change-Id: I5cf64848bba34ad32fcc80a93fb4f79ebd2c10a7
This commit is contained in:
Tony Wickham
2023-03-17 23:49:09 +00:00
parent fad8c1c449
commit c73db73a79
10 changed files with 162 additions and 153 deletions
@@ -69,6 +69,10 @@ public class StashedHandleView extends View {
*/
public void updateSampledRegion(Rect stashedHandleBounds) {
getLocationOnScreen(mTmpArr);
// Translations are temporary due to animations, remove them for the purpose of determining
// the final region we want sampled.
mTmpArr[0] -= Math.round(getTranslationX());
mTmpArr[1] -= Math.round(getTranslationY());
mSampledRegion.set(stashedHandleBounds);
mSampledRegion.offset(mTmpArr[0], mTmpArr[1]);
}