Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void onFinishInflate()
- {
- super.onFinishInflate();
- this.mHandleView = findViewById(2131230766);
- this.notificationLayout = ((NotificationRowLayout)findViewById(2131230838));
- if (this.DEBUG_INTERNAL == true)
- Log.i("PanelView", "notificationLayout:" + this.notificationLayout);
- if (this.notificationLayout != null)
- this.notificationLayout.setLayoutTransitionsEnabled(false);
- loadDimens();
- if (DEBUG)
- LOG("handle view: " + this.mHandleView, new Object[0]);
- 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();
- if (PanelView.DEBUG)
- {
- PanelView localPanelView2 = PanelView.this;
- Object[] arrayOfObject2 = new Object[4];
- arrayOfObject2[0] = MotionEvent.actionToString(paramAnonymousMotionEvent.getAction());
- arrayOfObject2[1] = Float.valueOf(f1);
- arrayOfObject2[2] = Float.valueOf(f2);
- arrayOfObject2[3] = Float.valueOf(PanelView.this.mTouchOffset);
- localPanelView2.LOG("handle.onTouch: a=%s y=%.1f rawY=%.1f off=%.1f", arrayOfObject2);
- }
- PanelView.this.getLocationOnScreen(PanelView.this.mAbsPos);
- switch (paramAnonymousMotionEvent.getAction())
- {
- case 1:
- case 3:
- PanelView.this.mFinalTouchY = f1;
- PanelView.access$702(PanelView.this, false);
- PanelView.this.mHandleView.setPressed(false);
- PanelView.this.postInvalidate();
- PanelView.this.mBar.onTrackingStopped(PanelView.this);
- PanelView.this.trackMovement(paramAnonymousMotionEvent);
- if ((paramAnonymousMotionEvent.getAction() == 1) && (PanelView.this.mStatusBarViewPressed == true))
- {
- Intent localIntent = new Intent("com.htc.intent.action.STATUS_BAR_TAP_EVENT");
- PanelView.this.mContext.sendBroadcast(localIntent);
- }
- PanelView.access$1402(PanelView.this, false);
- PanelView.FlingTracker localFlingTracker = PanelView.this.mVelocityTracker;
- int i = 0;
- float f4 = 0.0F;
- float f5 = 0.0F;
- float f6 = 0.0F;
- if (localFlingTracker != null)
- {
- PanelView.this.mVelocityTracker.computeCurrentVelocity(1000L);
- f6 = PanelView.this.mVelocityTracker.getYVelocity();
- if (f6 < 0.0F)
- i = 1;
- else
- i = 0;
- f5 = PanelView.this.mVelocityTracker.getXVelocity();
- if (f5 < 0.0F)
- f5 = -f5;
- if (f5 > PanelView.this.mFlingGestureMaxXVelocityPx)
- f5 = PanelView.this.mFlingGestureMaxXVelocityPx;
- f4 = (float)Math.hypot(f6, f5);
- if (f4 > PanelView.this.mFlingGestureMaxOutputVelocityPx)
- f4 = PanelView.this.mFlingGestureMaxOutputVelocityPx;
- PanelView.this.mVelocityTracker.recycle();
- PanelView.access$902(PanelView.this, null);
- }
- float f7 = Math.abs(PanelView.this.mFinalTouchY - PanelView.this.mInitialTouchY);
- if ((f7 < PanelView.this.mFlingGestureMinDistPx) || (f4 < PanelView.this.mFlingExpandMinVelocityPx))
- f4 = 0.0F;
- if (i != 0)
- f4 = -f4;
- if (PanelView.DEBUG)
- {
- PanelView localPanelView1 = PanelView.this;
- Object[] arrayOfObject1 = new Object[4];
- arrayOfObject1[0] = Float.valueOf(f7);
- arrayOfObject1[1] = Float.valueOf(f5);
- arrayOfObject1[2] = Float.valueOf(f6);
- arrayOfObject1[3] = Float.valueOf(f4);
- localPanelView1.LOG("gesture: dy=%f vel=(%f,%f) vlinear=%f", arrayOfObject1);
- }
- 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 (f3 > PanelView.this.mPeekHeight / 2.0F)
- PanelView.access$1402(PanelView.this, false);
- 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.this.disableGcForExternalAlloc(true);
- PanelView.access$702(PanelView.this, true);
- PanelView.this.mHandleView.setPressed(true);
- PanelView.this.postInvalidate();
- PanelView.this.mInitialTouchY = f1;
- PanelView.access$902(PanelView.this, PanelView.FlingTracker.obtain());
- PanelView.this.trackMovement(paramAnonymousMotionEvent);
- PanelView.this.mTimeAnimator.cancel();
- PanelView.this.mBar.onTrackingStarted(PanelView.this);
- PanelView.access$502(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();
- PanelView.access$1402(PanelView.this, true);
- }
- break;
- }
- return true;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement