@@ -72,6 +72,8 @@ public class BezelImageView extends ImageView {
7272
7373 private boolean isPressed = false ;
7474 private boolean isSelected ;
75+ private ColorMatrixColorFilter mTempDesaturateColorFilter ;
76+ private ColorFilter mTempSelectorFilter ;
7577
7678 public BezelImageView (Context context ) {
7779 this (context , null );
@@ -128,23 +130,6 @@ protected void onSizeChanged(int w, int h, int old_w, int old_h) {
128130 }
129131 }
130132
131- @ TargetApi (21 )
132- private class CustomOutline extends ViewOutlineProvider {
133-
134- int width ;
135- int height ;
136-
137- CustomOutline (int width , int height ) {
138- this .width = width ;
139- this .height = height ;
140- }
141-
142- @ Override
143- public void getOutline (View view , Outline outline ) {
144- outline .setOval (0 , 0 , width , height );
145- }
146- }
147-
148133 @ Override
149134 protected boolean setFrame (int l , int t , int r , int b ) {
150135 final boolean changed = super .setFrame (l , t , r , b );
@@ -231,7 +216,6 @@ protected void onDraw(Canvas canvas) {
231216 isPressed = isPressed ();
232217 }
233218
234-
235219 @ Override
236220 public boolean dispatchTouchEvent (MotionEvent event ) {
237221 // Check for clickable state and do nothing if disabled
@@ -280,7 +264,6 @@ protected boolean verifyDrawable(Drawable who) {
280264 return who == mMaskDrawable || super .verifyDrawable (who );
281265 }
282266
283-
284267 /**
285268 * Sets the color of the selector to be draw over the
286269 * CircularImageView. Be sure to provide some opacity.
@@ -293,7 +276,6 @@ public void setSelectorColor(int selectorColor) {
293276 this .invalidate ();
294277 }
295278
296-
297279 @ Override
298280 public void setImageDrawable (Drawable drawable ) {
299281 super .setImageDrawable (drawable );
@@ -309,9 +291,6 @@ public void setImageBitmap(Bitmap bm) {
309291 super .setImageBitmap (bm );
310292 }
311293
312- private ColorMatrixColorFilter mTempDesaturateColorFilter ;
313- private ColorFilter mTempSelectorFilter ;
314-
315294 public void disableTouchFeedback (boolean disable ) {
316295 if (disable ) {
317296 mTempDesaturateColorFilter = this .mDesaturateColorFilter ;
@@ -327,4 +306,21 @@ public void disableTouchFeedback(boolean disable) {
327306 }
328307 }
329308 }
309+
310+ @ TargetApi (21 )
311+ private class CustomOutline extends ViewOutlineProvider {
312+
313+ int width ;
314+ int height ;
315+
316+ CustomOutline (int width , int height ) {
317+ this .width = width ;
318+ this .height = height ;
319+ }
320+
321+ @ Override
322+ public void getOutline (View view , Outline outline ) {
323+ outline .setOval (0 , 0 , width , height );
324+ }
325+ }
330326}
0 commit comments