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 ;
@@ -252,10 +239,10 @@ protected void onDetachedFromWindow() {
252
239
if (mAnimPresenter != null ) {
253
240
mAnimPresenter .stopAllAnimator ();
254
241
}
255
- if (mBitmapToBlur != null ) {
242
+ /* if (mBitmapToBlur != null) {
256
243
mBitmapToBlur.recycle();
257
244
mBitmapToBlur = null;
258
- }
245
+ }*/
259
246
}
260
247
261
248
/***********************************
@@ -587,7 +574,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
587
574
mIsUp = (mDragViewTop < mLastDragViewTop );
588
575
mLastDragViewTop = mDragViewTop ;
589
576
}
590
- if (mEnableBlur && mBlurDrawable != null ) {
577
+ /* if (mEnableBlur && mBlurDrawable != null) {
591
578
if (visibleHeight < mFixHeight) {
592
579
return;
593
580
}
@@ -598,7 +585,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
598
585
mBlurDrawable.setLevel(blurLevel);
599
586
}
600
587
mBlurDrawable.setAlpha((int) (percent * 255));
601
- }
588
+ }*/
602
589
if (visibleHeight >= 0 ) {
603
590
ViewCompat .setTranslationY (mMainView , -visibleHeight * (1 - mCollapseParallax ));
604
591
}
@@ -635,9 +622,9 @@ private boolean _isNeedIntercept(MotionEvent ev) {
635
622
if (mDragHelper .isViewUnder (mAttachScrollView , (int ) ev .getX (), y ) && mMode != MODE_ANIMATE ) {
636
623
return true ;
637
624
}
638
- if (mEnableBlur && mDragStatus == STATUS_EXPANDED ) {
625
+ /* if (mEnableBlur && mDragStatus == STATUS_EXPANDED) {
639
626
return true;
640
- }
627
+ }*/
641
628
return false ;
642
629
}
643
630
@@ -874,7 +861,7 @@ public void setCustomAnimator(CustomViewAnimator inAnimator, CustomViewAnimator
874
861
/*************************************
875
862
* Blur
876
863
********************************************/
877
- private final static int DEFAULT_SAMPLE_FACTOR = 4 ;
864
+ /* private final static int DEFAULT_SAMPLE_FACTOR = 4;
878
865
private final static int DEFAULT_BLUR_RADIUS = 5;
879
866
880
867
// 使能模糊
@@ -918,11 +905,11 @@ public void setBlurFull(boolean blurFull) {
918
905
mIsBlurFull = blurFull;
919
906
}
920
907
921
- /**
908
+ */ /**
922
909
* 设置使能模糊效果
923
910
*
924
911
* @param enableBlur
925
- */
912
+ */ /*
926
913
public void setEnableBlur(boolean enableBlur) {
927
914
if (mEnableBlur == enableBlur) {
928
915
return;
@@ -953,21 +940,21 @@ public void run() {
953
940
}
954
941
}
955
942
956
- /**
943
+ */ /**
957
944
* 刷新模糊视图
958
- */
945
+ */ /*
959
946
public void updateBlurView() {
960
947
if (mEnableBlur) {
961
948
mBlurDrawable = null;
962
949
_handleBlurInThread();
963
950
}
964
951
}
965
952
966
- /**
953
+ */ /**
967
954
* 模糊视图
968
955
*
969
956
* @param view
970
- */
957
+ */ /*
971
958
private void _blurView(View view) {
972
959
final int width = view.getWidth();
973
960
final int height = view.getHeight();
@@ -1030,9 +1017,9 @@ private void _blurView(View view) {
1030
1017
}
1031
1018
}
1032
1019
1033
- /**
1020
+ */ /**
1034
1021
* 在线程处理图片模糊
1035
- */
1022
+ */ /*
1036
1023
@SuppressWarnings("deprecation")
1037
1024
private void _handleBlurInThread() {
1038
1025
new Thread(new Runnable() {
@@ -1053,7 +1040,7 @@ public void run() {
1053
1040
}
1054
1041
}).start();
1055
1042
}
1056
-
1043
+ */
1057
1044
/** ================================ 监听器 ================================ */
1058
1045
1059
1046
// 监听器
0 commit comments