Skip to content

Commit 03674fc

Browse files
saviukdsaviukd
saviukd
authored and
saviukd
committed
Fix lint warning
1 parent 94c3296 commit 03674fc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

library/src/main/java/eightbitlab/com/blurview/BlockingBlurController.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void startBlurAutoUpdate() {
135135
rootView.getViewTreeObserver().addOnPreDrawListener(drawListener);
136136
}
137137

138-
private void updateBlur() {
138+
void updateBlur() {
139139
isMeDrawingNow = true;
140140
blurView.invalidate();
141141
}
@@ -150,14 +150,19 @@ public void onGlobalLayout() {
150150
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
151151
blurView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
152152
} else {
153-
blurView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
153+
legacyRemoveOnGlobalLayoutListener();
154154
}
155155

156156
int measuredWidth = blurView.getMeasuredWidth();
157157
int measuredHeight = blurView.getMeasuredHeight();
158158

159159
init(measuredWidth, measuredHeight);
160160
}
161+
162+
@SuppressWarnings("deprecation")
163+
private void legacyRemoveOnGlobalLayoutListener() {
164+
blurView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
165+
}
161166
});
162167
}
163168

0 commit comments

Comments
 (0)