Advertisement
dunc001

AOKP_method

Jun 11th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.12 KB | None | 0 0
  1. protected void onFinishInflate()
  2. {
  3. super.onFinishInflate();
  4. this.mHandleView = findViewById(2131230766);
  5. loadDimens();
  6. if (this.mHandleView != null)
  7. this.mHandleView.setOnTouchListener(new View.OnTouchListener()
  8. {
  9. public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
  10. {
  11. float f1 = paramAnonymousMotionEvent.getY();
  12. float f2 = paramAnonymousMotionEvent.getRawY();
  13. PanelView.this.getLocationOnScreen(PanelView.this.mAbsPos);
  14. switch (paramAnonymousMotionEvent.getAction())
  15. {
  16. case 1:
  17. case 3:
  18. PanelView.this.mFinalTouchY = f1;
  19. PanelView.access$502(PanelView.this, false);
  20. PanelView.access$602(PanelView.this, false);
  21. PanelView.this.mHandleView.setPressed(false);
  22. PanelView.this.postInvalidate();
  23. PanelView.this.mBar.onTrackingStopped(PanelView.this);
  24. PanelView.this.trackMovement(paramAnonymousMotionEvent);
  25. PanelView.FlingTracker localFlingTracker = PanelView.this.mVelocityTracker;
  26. int i = 0;
  27. float f4 = 0.0F;
  28. if (localFlingTracker != null)
  29. {
  30. PanelView.this.mVelocityTracker.computeCurrentVelocity(1000L);
  31. float f5 = PanelView.this.mVelocityTracker.getYVelocity();
  32. if (f5 < 0.0F)
  33. i = 1;
  34. else
  35. i = 0;
  36. float f6 = PanelView.this.mVelocityTracker.getXVelocity();
  37. if (f6 < 0.0F)
  38. f6 = -f6;
  39. if (f6 > PanelView.this.mFlingGestureMaxXVelocityPx)
  40. f6 = PanelView.this.mFlingGestureMaxXVelocityPx;
  41. f4 = (float)Math.hypot(f5, f6);
  42. if (f4 > PanelView.this.mFlingGestureMaxOutputVelocityPx)
  43. f4 = PanelView.this.mFlingGestureMaxOutputVelocityPx;
  44. PanelView.this.mVelocityTracker.recycle();
  45. PanelView.access$802(PanelView.this, null);
  46. }
  47. if ((Math.abs(PanelView.this.mFinalTouchY - PanelView.this.mInitialTouchY) < PanelView.this.mFlingGestureMinDistPx) || (f4 < PanelView.this.mFlingExpandMinVelocityPx))
  48. f4 = 0.0F;
  49. if (i != 0)
  50. f4 = -f4;
  51. PanelView.this.fling(f4, true);
  52. break;
  53. case 2:
  54. float f3 = f2 - PanelView.this.mAbsPos[1] - PanelView.this.mTouchOffset;
  55. if (f3 > PanelView.this.mPeekHeight)
  56. {
  57. if ((PanelView.this.mPeekAnimator != null) && (PanelView.this.mPeekAnimator.isRunning()))
  58. PanelView.this.mPeekAnimator.cancel();
  59. PanelView.access$1202(PanelView.this, false);
  60. if (PanelView.this.mBrightnessSliderEnabled)
  61. {
  62. PanelView.this.mHandler.removeCallbacks(PanelView.this.mSetShouldReact);
  63. PanelView.access$502(PanelView.this, false);
  64. }
  65. }
  66. if ((PanelView.this.mBrightnessSliderEnabled) && (PanelView.this.mTracking) && (PanelView.this.mShouldReactToBrightnessSlider))
  67. {
  68. if (PanelView.this.mPropFactor == null)
  69. PanelView.this.setPropFactor();
  70. PanelView.access$2002(PanelView.this, Integer.valueOf(PanelView.this.checkMinMax(Math.round(paramAnonymousMotionEvent.getRawX() * PanelView.this.mPropFactor.floatValue()))));
  71. PanelView.this.changeBrightness();
  72. }
  73. if (!PanelView.this.mJustPeeked)
  74. {
  75. PanelView.this.setExpandedHeightInternal(f3);
  76. PanelView.this.mBar.panelExpansionChanged(PanelView.this, PanelView.this.mExpandedFraction);
  77. }
  78. PanelView.this.trackMovement(paramAnonymousMotionEvent);
  79. break;
  80. case 0:
  81. PanelView.access$502(PanelView.this, false);
  82. PanelView.access$602(PanelView.this, true);
  83. PanelView.this.mHandleView.setPressed(true);
  84. PanelView.this.postInvalidate();
  85. PanelView.this.mInitialTouchY = f1;
  86. PanelView.access$802(PanelView.this, PanelView.FlingTracker.obtain());
  87. PanelView.this.trackMovement(paramAnonymousMotionEvent);
  88. PanelView.this.mTimeAnimator.cancel();
  89. PanelView.this.mBar.onTrackingStarted(PanelView.this);
  90. PanelView.access$1002(PanelView.this, f2 - PanelView.this.mAbsPos[1] - PanelView.this.getExpandedHeight());
  91. if (PanelView.this.mExpandedHeight == 0.0F)
  92. {
  93. PanelView.access$1202(PanelView.this, true);
  94. PanelView.this.runPeekAnimation();
  95. if (PanelView.this.mBrightnessSliderEnabled)
  96. PanelView.this.mHandler.postDelayed(PanelView.this.mSetShouldReact, 400L);
  97. }
  98. break;
  99. }
  100. return true;
  101. }
  102. });
  103. }
  104.  
  105. protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  106. {
  107. super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement