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 ;
@@ -262,10 +249,10 @@ protected void onDetachedFromWindow() {
262
249
if (mAnimPresenter != null ) {
263
250
mAnimPresenter .stopAllAnimator ();
264
251
}
265
- if (mBitmapToBlur != null ) {
252
+ /* if (mBitmapToBlur != null) {
266
253
mBitmapToBlur.recycle();
267
254
mBitmapToBlur = null;
268
- }
255
+ }*/
269
256
}
270
257
271
258
/***********************************
@@ -611,7 +598,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
611
598
mIsUp = (mDragViewTop < mLastDragViewTop );
612
599
mLastDragViewTop = mDragViewTop ;
613
600
}
614
- if (mEnableBlur && mBlurDrawable != null ) {
601
+ /* if (mEnableBlur && mBlurDrawable != null) {
615
602
if (visibleHeight < mFixHeight) {
616
603
return;
617
604
}
@@ -622,7 +609,7 @@ private void _dragPositionChanged(int visibleHeight, float percent) {
622
609
mBlurDrawable.setLevel(blurLevel);
623
610
}
624
611
mBlurDrawable.setAlpha((int) (percent * 255));
625
- }
612
+ }*/
626
613
if (visibleHeight >= 0 ) {
627
614
ViewCompat .setTranslationY (mMainView , -visibleHeight * (1 - mCollapseParallax ));
628
615
}
@@ -659,9 +646,9 @@ private boolean _isNeedIntercept(MotionEvent ev) {
659
646
if (mDragHelper .isViewUnder (mAttachScrollView , (int ) ev .getX (), y ) && mMode != MODE_ANIMATE ) {
660
647
return true ;
661
648
}
662
- if (mEnableBlur && mDragStatus == STATUS_EXPANDED ) {
649
+ /* if (mEnableBlur && mDragStatus == STATUS_EXPANDED) {
663
650
return true;
664
- }
651
+ }*/
665
652
return false ;
666
653
}
667
654
@@ -983,7 +970,7 @@ public void setCustomAnimator(CustomViewAnimator inAnimator, CustomViewAnimator
983
970
/*************************************
984
971
* Blur
985
972
********************************************/
986
- private final static int DEFAULT_SAMPLE_FACTOR = 4 ;
973
+ /* private final static int DEFAULT_SAMPLE_FACTOR = 4;
987
974
private final static int DEFAULT_BLUR_RADIUS = 5;
988
975
989
976
// 使能模糊
@@ -1027,11 +1014,11 @@ public void setBlurFull(boolean blurFull) {
1027
1014
mIsBlurFull = blurFull;
1028
1015
}
1029
1016
1030
- /**
1017
+ */ /**
1031
1018
* 设置使能模糊效果
1032
1019
*
1033
1020
* @param enableBlur
1034
- */
1021
+ */ /*
1035
1022
public void setEnableBlur(boolean enableBlur) {
1036
1023
if (mEnableBlur == enableBlur) {
1037
1024
return;
@@ -1062,21 +1049,21 @@ public void run() {
1062
1049
}
1063
1050
}
1064
1051
1065
- /**
1052
+ */ /**
1066
1053
* 刷新模糊视图
1067
- */
1054
+ */ /*
1068
1055
public void updateBlurView() {
1069
1056
if (mEnableBlur) {
1070
1057
mBlurDrawable = null;
1071
1058
_handleBlurInThread();
1072
1059
}
1073
1060
}
1074
1061
1075
- /**
1062
+ */ /**
1076
1063
* 模糊视图
1077
1064
*
1078
1065
* @param view
1079
- */
1066
+ */ /*
1080
1067
private void _blurView(View view) {
1081
1068
final int width = view.getWidth();
1082
1069
final int height = view.getHeight();
@@ -1139,9 +1126,9 @@ private void _blurView(View view) {
1139
1126
}
1140
1127
}
1141
1128
1142
- /**
1129
+ */ /**
1143
1130
* 在线程处理图片模糊
1144
- */
1131
+ */ /*
1145
1132
@SuppressWarnings("deprecation")
1146
1133
private void _handleBlurInThread() {
1147
1134
new Thread(new Runnable() {
@@ -1162,7 +1149,7 @@ public void run() {
1162
1149
}
1163
1150
}).start();
1164
1151
}
1165
-
1152
+ */
1166
1153
/** ================================ 监听器 ================================ */
1167
1154
1168
1155
// 监听器
0 commit comments