22
33import android .content .Context ;
44import android .content .res .TypedArray ;
5- import android .graphics .Bitmap ;
6- import android .graphics .Canvas ;
7- import android .graphics .Color ;
8- import android .graphics .drawable .BitmapDrawable ;
9- import android .graphics .drawable .ClipDrawable ;
10- import android .graphics .drawable .ColorDrawable ;
11- import android .graphics .drawable .Drawable ;
12- import android .os .Build ;
135import android .support .annotation .IntDef ;
146import android .support .v4 .view .MotionEventCompat ;
157import android .support .v4 .view .ViewCompat ;
168import android .support .v4 .view .ViewPager ;
179import android .support .v4 .widget .NestedScrollView ;
1810import android .support .v4 .widget .ScrollerCompat ;
1911import android .support .v4 .widget .ViewDragHelper ;
20- import android .support .v8 .renderscript .Allocation ;
21- import android .support .v8 .renderscript .Element ;
22- import android .support .v8 .renderscript .RenderScript ;
23- import android .support .v8 .renderscript .ScriptIntrinsicBlur ;
2412import android .util .AttributeSet ;
2513import android .view .GestureDetector ;
26- import android .view .Gravity ;
2714import android .view .MotionEvent ;
2815import android .view .View ;
2916import android .view .ViewConfiguration ;
@@ -262,10 +249,10 @@ protected void onDetachedFromWindow() {
262249 if (mAnimPresenter != null ) {
263250 mAnimPresenter .stopAllAnimator ();
264251 }
265- if (mBitmapToBlur != null ) {
252+ /* if (mBitmapToBlur != null) {
266253 mBitmapToBlur.recycle();
267254 mBitmapToBlur = null;
268- }
255+ }*/
269256 }
270257
271258 /***********************************
@@ -611,7 +598,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
611598 mIsUp = (mDragViewTop < mLastDragViewTop );
612599 mLastDragViewTop = mDragViewTop ;
613600 }
614- if (mEnableBlur && mBlurDrawable != null ) {
601+ /* if (mEnableBlur && mBlurDrawable != null) {
615602 if (visibleHeight < mFixHeight) {
616603 return;
617604 }
@@ -622,7 +609,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
622609 mBlurDrawable.setLevel(blurLevel);
623610 }
624611 mBlurDrawable.setAlpha((int) (percent * 255));
625- }
612+ }*/
626613 if (visibleHeight >= 0 ) {
627614 ViewCompat .setTranslationY (mMainView , -visibleHeight * (1 - mCollapseParallax ));
628615 }
@@ -659,9 +646,9 @@ private boolean _isNeedIntercept(MotionEvent ev) {
659646 if (mDragHelper .isViewUnder (mAttachScrollView , (int ) ev .getX (), y ) && mMode != MODE_ANIMATE ) {
660647 return true ;
661648 }
662- if (mEnableBlur && mDragStatus == STATUS_EXPANDED ) {
649+ /* if (mEnableBlur && mDragStatus == STATUS_EXPANDED) {
663650 return true;
664- }
651+ }*/
665652 return false ;
666653 }
667654
@@ -983,7 +970,7 @@ public void setCustomAnimator(CustomViewAnimator inAnimator, CustomViewAnimator
983970 /*************************************
984971 * Blur
985972 ********************************************/
986- private final static int DEFAULT_SAMPLE_FACTOR = 4 ;
973+ /* private final static int DEFAULT_SAMPLE_FACTOR = 4;
987974 private final static int DEFAULT_BLUR_RADIUS = 5;
988975
989976 // 使能模糊
@@ -1027,11 +1014,11 @@ public void setBlurFull(boolean blurFull) {
10271014 mIsBlurFull = blurFull;
10281015 }
10291016
1030- /**
1017+ */ /**
10311018 * 设置使能模糊效果
10321019 *
10331020 * @param enableBlur
1034- */
1021+ */ /*
10351022 public void setEnableBlur(boolean enableBlur) {
10361023 if (mEnableBlur == enableBlur) {
10371024 return;
@@ -1062,21 +1049,21 @@ public void run() {
10621049 }
10631050 }
10641051
1065- /**
1052+ */ /**
10661053 * 刷新模糊视图
1067- */
1054+ */ /*
10681055 public void updateBlurView() {
10691056 if (mEnableBlur) {
10701057 mBlurDrawable = null;
10711058 _handleBlurInThread();
10721059 }
10731060 }
10741061
1075- /**
1062+ */ /**
10761063 * 模糊视图
10771064 *
10781065 * @param view
1079- */
1066+ */ /*
10801067 private void _blurView(View view) {
10811068 final int width = view.getWidth();
10821069 final int height = view.getHeight();
@@ -1139,9 +1126,9 @@ private void _blurView(View view) {
11391126 }
11401127 }
11411128
1142- /**
1129+ */ /**
11431130 * 在线程处理图片模糊
1144- */
1131+ */ /*
11451132 @SuppressWarnings("deprecation")
11461133 private void _handleBlurInThread() {
11471134 new Thread(new Runnable() {
@@ -1162,7 +1149,7 @@ public void run() {
11621149 }
11631150 }).start();
11641151 }
1165-
1152+ */
11661153 /** ================================ 监听器 ================================ */
11671154
11681155 // 监听器
0 commit comments