2
2
3
3
import android .content .Context ;
4
4
import 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 ;
13
5
import android .support .annotation .IntDef ;
14
6
import android .support .v4 .view .MotionEventCompat ;
15
7
import android .support .v4 .view .ViewCompat ;
16
8
import android .support .v4 .view .ViewPager ;
17
9
import android .support .v4 .widget .NestedScrollView ;
18
10
import android .support .v4 .widget .ScrollerCompat ;
19
11
import 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 ;
24
12
import android .util .AttributeSet ;
25
13
import android .view .GestureDetector ;
26
- import android .view .Gravity ;
27
14
import android .view .MotionEvent ;
28
15
import android .view .View ;
29
16
import android .view .ViewConfiguration ;
@@ -260,10 +247,10 @@ protected void onDetachedFromWindow() {
260
247
if (mAnimPresenter != null ) {
261
248
mAnimPresenter .stopAllAnimator ();
262
249
}
263
- if (mBitmapToBlur != null ) {
250
+ /* if (mBitmapToBlur != null) {
264
251
mBitmapToBlur.recycle();
265
252
mBitmapToBlur = null;
266
- }
253
+ }*/
267
254
}
268
255
269
256
/***********************************
@@ -607,7 +594,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
607
594
mIsUp = (mDragViewTop < mLastDragViewTop );
608
595
mLastDragViewTop = mDragViewTop ;
609
596
}
610
- if (mEnableBlur && mBlurDrawable != null ) {
597
+ /* if (mEnableBlur && mBlurDrawable != null) {
611
598
if (visibleHeight < mFixHeight) {
612
599
return;
613
600
}
@@ -618,7 +605,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
618
605
mBlurDrawable.setLevel(blurLevel);
619
606
}
620
607
mBlurDrawable.setAlpha((int) (percent * 255));
621
- }
608
+ }*/
622
609
if (visibleHeight >= 0 ) {
623
610
ViewCompat .setTranslationY (mMainView , -visibleHeight * (1 - mCollapseParallax ));
624
611
}
@@ -655,9 +642,9 @@ private boolean _isNeedIntercept(MotionEvent ev) {
655
642
if (mDragHelper .isViewUnder (mAttachScrollView , (int ) ev .getX (), y ) && mMode != MODE_ANIMATE ) {
656
643
return true ;
657
644
}
658
- if (mEnableBlur && mDragStatus == STATUS_EXPANDED ) {
645
+ /* if (mEnableBlur && mDragStatus == STATUS_EXPANDED) {
659
646
return true;
660
- }
647
+ }*/
661
648
return false ;
662
649
}
663
650
@@ -894,7 +881,7 @@ public void setCustomAnimator(CustomViewAnimator inAnimator, CustomViewAnimator
894
881
/*************************************
895
882
* Blur
896
883
********************************************/
897
- private final static int DEFAULT_SAMPLE_FACTOR = 4 ;
884
+ /* private final static int DEFAULT_SAMPLE_FACTOR = 4;
898
885
private final static int DEFAULT_BLUR_RADIUS = 5;
899
886
900
887
// 使能模糊
@@ -938,11 +925,11 @@ public void setBlurFull(boolean blurFull) {
938
925
mIsBlurFull = blurFull;
939
926
}
940
927
941
- /**
928
+ */ /**
942
929
* 设置使能模糊效果
943
930
*
944
931
* @param enableBlur
945
- */
932
+ */ /*
946
933
public void setEnableBlur(boolean enableBlur) {
947
934
if (mEnableBlur == enableBlur) {
948
935
return;
@@ -973,21 +960,21 @@ public void run() {
973
960
}
974
961
}
975
962
976
- /**
963
+ */ /**
977
964
* 刷新模糊视图
978
- */
965
+ */ /*
979
966
public void updateBlurView() {
980
967
if (mEnableBlur) {
981
968
mBlurDrawable = null;
982
969
_handleBlurInThread();
983
970
}
984
971
}
985
972
986
- /**
973
+ */ /**
987
974
* 模糊视图
988
975
*
989
976
* @param view
990
- */
977
+ */ /*
991
978
private void _blurView(View view) {
992
979
final int width = view.getWidth();
993
980
final int height = view.getHeight();
@@ -1050,9 +1037,9 @@ private void _blurView(View view) {
1050
1037
}
1051
1038
}
1052
1039
1053
- /**
1040
+ */ /**
1054
1041
* 在线程处理图片模糊
1055
- */
1042
+ */ /*
1056
1043
@SuppressWarnings("deprecation")
1057
1044
private void _handleBlurInThread() {
1058
1045
new Thread(new Runnable() {
@@ -1073,7 +1060,7 @@ public void run() {
1073
1060
}
1074
1061
}).start();
1075
1062
}
1076
-
1063
+ */
1077
1064
/** ================================ 监听器 ================================ */
1078
1065
1079
1066
// 监听器
0 commit comments