File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
library/src/main/java/eightbitlab/com/blurview Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ public void startBlurAutoUpdate() {
135
135
rootView .getViewTreeObserver ().addOnPreDrawListener (drawListener );
136
136
}
137
137
138
- private void updateBlur () {
138
+ void updateBlur () {
139
139
isMeDrawingNow = true ;
140
140
blurView .invalidate ();
141
141
}
@@ -150,14 +150,19 @@ public void onGlobalLayout() {
150
150
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN ) {
151
151
blurView .getViewTreeObserver ().removeOnGlobalLayoutListener (this );
152
152
} else {
153
- blurView . getViewTreeObserver (). removeGlobalOnLayoutListener ( this );
153
+ legacyRemoveOnGlobalLayoutListener ( );
154
154
}
155
155
156
156
int measuredWidth = blurView .getMeasuredWidth ();
157
157
int measuredHeight = blurView .getMeasuredHeight ();
158
158
159
159
init (measuredWidth , measuredHeight );
160
160
}
161
+
162
+ @ SuppressWarnings ("deprecation" )
163
+ private void legacyRemoveOnGlobalLayoutListener () {
164
+ blurView .getViewTreeObserver ().removeGlobalOnLayoutListener (this );
165
+ }
161
166
});
162
167
}
163
168
You can’t perform that action at this time.
0 commit comments