Methods Summary |
---|
public boolean | onFling(android.view.MotionEvent e1, android.view.MotionEvent e2, float velocityX, float velocityY)
float absVelX = Math.abs(velocityX);
float absVelY = Math.abs(velocityY);
boolean isValidFling = absVelX > mMinFlingVelocity &&
mIsVertical ? (absVelY > absVelX) : (absVelX > absVelY);
if (isValidFling) {
boolean showNext;
if (!mIsRTL) {
showNext = mIsVertical ? (velocityY < 0) : (velocityX < 0);
} else {
// In RTL, vertical is still the same, but horizontal is flipped
showNext = mIsVertical ? (velocityY < 0) : (velocityX > 0);
}
if (showNext) {
mBar.showNextAffiliatedTask();
} else {
mBar.showPreviousAffiliatedTask();
}
}
return true;
|
public boolean | onInterceptTouchEvent(android.view.MotionEvent event)
// If we move more than a fixed amount, then start capturing for the
// task switcher detector
mTaskSwitcherDetector.onTouchEvent(event);
int action = event.getAction();
boolean intercepted = false;
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN: {
mTouchDownX = (int) event.getX();
mTouchDownY = (int) event.getY();
break;
}
case MotionEvent.ACTION_MOVE: {
int x = (int) event.getX();
int y = (int) event.getY();
int xDiff = Math.abs(x - mTouchDownX);
int yDiff = Math.abs(y - mTouchDownY);
boolean exceededTouchSlop = !mIsVertical
? xDiff > mScrollTouchSlop && xDiff > yDiff
: yDiff > mScrollTouchSlop && yDiff > xDiff;
if (exceededTouchSlop) {
return true;
}
break;
}
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return intercepted;
|
public boolean | onTouchEvent(android.view.MotionEvent event)
return mTaskSwitcherDetector.onTouchEvent(event);
|
public void | setBar(com.android.systemui.statusbar.BaseStatusBar phoneStatusBar)
mBar = phoneStatusBar;
|
public void | setBarState(boolean isVertical, boolean isRTL)
mIsVertical = isVertical;
mIsRTL = isRTL;
|