NotificationPanelView 的父类 PanelView 有下面一段,其中mHandleView为notification最下面那个条
mHandleView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
case MotionEvent.ACTION_MOVE:
final float h = rawY - mAbsPos[1] - mTouchOffset;
if (h > mPeekHeight) {
if (mPeekAnimator != null && mPeekAnimator.isRunning()) {
mPeekAnimator.cancel();
}
mJustPeeked = false;
}
if (!mJustPeeked) {
PanelView.this.setExpandedHeightInternal(h);
mBar.panelExpansionChanged(PanelView.this, mExpandedFraction);
}
trackMovement(event);
break;
}
上面PanelView.this.setExpandedHeightInternal(h); //当move时panelView动态设置了大小。
mHandleView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
case MotionEvent.ACTION_MOVE:
final float h = rawY - mAbsPos[1] - mTouchOffset;
if (h > mPeekHeight) {
if (mPeekAnimator != null && mPeekAnimator.isRunning()) {
mPeekAnimator.cancel();
}
mJustPeeked = false;
}
if (!mJustPeeked) {
PanelView.this.setExpandedHeightInternal(h);
mBar.panelExpansionChanged(PanelView.this, mExpandedFraction);
}
trackMovement(event);
break;
}
上面PanelView.this.setExpandedHeightInternal(h); //当move时panelView动态设置了大小。