SystemUi-Notification 随手指动态显示分析

来源:互联网 发布:拐弯网络大电影 编辑:程序博客网 时间:2024/05/22 01:50
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动态设置了大小。

原创粉丝点击