@@ -29,21 +29,32 @@ public class AVLoadingIndicatorView extends View {
29
29
private boolean mShouldStartAnimationDrawable ;
30
30
31
31
public AVLoadingIndicatorView (Context context ) {
32
- this (context , null );
32
+ super (context );
33
+ init (context , null ,0 ,0 );
33
34
}
34
35
35
36
public AVLoadingIndicatorView (Context context , AttributeSet attrs ) {
36
- this (context , attrs , 0 );
37
+ super (context , attrs );
38
+ init (context , attrs ,0 ,0 );
37
39
}
38
40
39
41
public AVLoadingIndicatorView (Context context , AttributeSet attrs , int defStyleAttr ) {
40
- this (context , attrs , defStyleAttr , R .style .AVLoadingIndicatorView );
42
+ super (context , attrs , defStyleAttr );
43
+ init (context , attrs ,defStyleAttr ,R .style .AVLoadingIndicatorView );
41
44
}
42
45
43
46
@ TargetApi (Build .VERSION_CODES .LOLLIPOP )
44
47
public AVLoadingIndicatorView (Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) {
45
48
super (context , attrs , defStyleAttr , defStyleRes );
46
- init ();
49
+ init (context ,attrs ,defStyleAttr ,R .style .AVLoadingIndicatorView );
50
+ }
51
+
52
+ private void init (Context context ,AttributeSet attrs ,int defStyleAttr , int defStyleRes ) {
53
+ mMinWidth = 24 ;
54
+ mMaxWidth = 48 ;
55
+ mMinHeight = 24 ;
56
+ mMaxHeight = 48 ;
57
+
47
58
final TypedArray a = context .obtainStyledAttributes (
48
59
attrs , R .styleable .AVLoadingIndicatorView , defStyleAttr , defStyleRes );
49
60
@@ -58,13 +69,6 @@ public AVLoadingIndicatorView(Context context, AttributeSet attrs, int defStyleA
58
69
a .recycle ();
59
70
}
60
71
61
- private void init () {
62
- mMinWidth = 24 ;
63
- mMaxWidth = 48 ;
64
- mMinHeight = 24 ;
65
- mMaxHeight = 48 ;
66
- }
67
-
68
72
public Indicator getIndicator () {
69
73
return mIndicator ;
70
74
}
0 commit comments