Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void onFinishInflate()
- {
- super.onFinishInflate();
- this.mHandleView = findViewById(2131230766);
- loadDimens();
- if (this.mHandleView != null)
- this.mHandleView.setOnTouchListener(new View.OnTouchListener()
- {
- public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
- {
- float f1 = paramAnonymousMotionEvent.getY();
- float f2 = paramAnonymousMotionEvent.getRawY();
- PanelView.this.getLocationOnScreen(PanelView.this.mAbsPos);
- switch (paramAnonymousMotionEvent.getAction())
- {
- case 1:
- case 3:
- PanelView.this.mFinalTouchY = f1;
- PanelView.access$502(PanelView.this, false);
- PanelView.access$602(PanelView.this, false);
- PanelView.this.mHandleView.setPressed(false);
- PanelView.this.postInvalidate();
- PanelView.this.mBar.onTrackingStopped(PanelView.this);
- PanelView.this.trackMovement(paramAnonymousMotionEvent);
- PanelView.FlingTracker localFlingTracker = PanelView.this.mVelocityTracker;
- int i = 0;
- float f4 = 0.0F;
- if (localFlingTracker != null)
- {
- PanelView.this.mVelocityTracker.computeCurrentVelocity(1000L);
- float f5 = PanelView.this.mVelocityTracker.getYVelocity();
- if (f5 < 0.0F)
- i = 1;
- else
- i = 0;
- float f6 = PanelView.this.mVelocityTracker.getXVelocity();
- if (f6 < 0.0F)
- f6 = -f6;
- if (f6 > PanelView.this.mFlingGestureMaxXVelocityPx)
- f6 = PanelView.this.mFlingGestureMaxXVelocityPx;
- f4 = (float)Math.hypot(f5, f6);
- if (f4 > PanelView.this.mFlingGestureMaxOutputVelocityPx)
- f4 = PanelView.this.mFlingGestureMaxOutputVelocityPx;
- PanelView.this.mVelocityTracker.recycle();
- PanelView.access$802(PanelView.this, null);
- }
- if ((Math.abs(PanelView.this.mFinalTouchY - PanelView.this.mInitialTouchY) < PanelView.this.mFlingGestureMinDistPx) || (f4 < PanelView.this.mFlingExpandMinVelocityPx))
- f4 = 0.0F;
- if (i != 0)
- f4 = -f4;
- PanelView.this.fling(f4, true);
- break;
- case 2:
- float f3 = f2 - PanelView.this.mAbsPos[1] - PanelView.this.mTouchOffset;
- if (f3 > PanelView.this.mPeekHeight)
- {
- if ((PanelView.this.mPeekAnimator != null) && (PanelView.this.mPeekAnimator.isRunning()))
- PanelView.this.mPeekAnimator.cancel();
- PanelView.access$1202(PanelView.this, false);
- if (PanelView.this.mBrightnessSliderEnabled)
- {
- PanelView.this.mHandler.removeCallbacks(PanelView.this.mSetShouldReact);
- PanelView.access$502(PanelView.this, false);
- }
- }
- if ((PanelView.this.mBrightnessSliderEnabled) && (PanelView.this.mTracking) && (PanelView.this.mShouldReactToBrightnessSlider))
- {
- if (PanelView.this.mPropFactor == null)
- PanelView.this.setPropFactor();
- PanelView.access$2002(PanelView.this, Integer.valueOf(PanelView.this.checkMinMax(Math.round(paramAnonymousMotionEvent.getRawX() * PanelView.this.mPropFactor.floatValue()))));
- PanelView.this.changeBrightness();
- }
- if (!PanelView.this.mJustPeeked)
- {
- PanelView.this.setExpandedHeightInternal(f3);
- PanelView.this.mBar.panelExpansionChanged(PanelView.this, PanelView.this.mExpandedFraction);
- }
- PanelView.this.trackMovement(paramAnonymousMotionEvent);
- break;
- case 0:
- PanelView.access$502(PanelView.this, false);
- PanelView.access$602(PanelView.this, true);
- PanelView.this.mHandleView.setPressed(true);
- PanelView.this.postInvalidate();
- PanelView.this.mInitialTouchY = f1;
- PanelView.access$802(PanelView.this, PanelView.FlingTracker.obtain());
- PanelView.this.trackMovement(paramAnonymousMotionEvent);
- PanelView.this.mTimeAnimator.cancel();
- PanelView.this.mBar.onTrackingStarted(PanelView.this);
- PanelView.access$1002(PanelView.this, f2 - PanelView.this.mAbsPos[1] - PanelView.this.getExpandedHeight());
- if (PanelView.this.mExpandedHeight == 0.0F)
- {
- PanelView.access$1202(PanelView.this, true);
- PanelView.this.runPeekAnimation();
- if (PanelView.this.mBrightnessSliderEnabled)
- PanelView.this.mHandler.postDelayed(PanelView.this.mSetShouldReact, 400L);
- }
- break;
- }
- return true;
- }
- });
- }
- protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
- {
- super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement