@@ -64,11 +64,8 @@ public interface IndicatorLayoutBehaviour {
64
64
private int indicatorStrokeColor ;
65
65
private int indicatorColorStart ;
66
66
private int indicatorColorEnd ;
67
- private int indicatorDelay ;
68
67
private int indicatorRepeats ;
69
68
private int indicatorRepeatMode ;
70
- private int indicatorDuration ;
71
- private int indicatorIntervalDelay ;
72
69
private int indicatorInnerOutlineColor ;
73
70
74
71
private int usableWidth ;
@@ -102,8 +99,11 @@ public interface IndicatorLayoutBehaviour {
102
99
103
100
private float indicatorStrokeWidth ;
104
101
105
- private long revealDuration = 300 ;
106
- private long concealDuration = 300 ;
102
+ private long revealDuration = 0 ;
103
+ private long concealDuration = 0 ;
104
+ private long indicatorDelay ;
105
+ private long indicatorDuration ;
106
+ private long indicatorIntervalDelay ;
107
107
108
108
private boolean showInnerOutline = false ;
109
109
private boolean useColorInterpolation = false ;
@@ -191,6 +191,8 @@ private void initialize(ViewGroup parentView) {
191
191
animators = new ArrayList <>();
192
192
193
193
parent = parentView ;
194
+
195
+ initializeIndicator ();
194
196
}
195
197
196
198
public void setUpAttributes (TypedArray typedArray ) {
@@ -522,8 +524,6 @@ public void setTarget(View view, float widthRatio, float heightRatio, float radi
522
524
523
525
target = view ;
524
526
525
- stopIndicatorAnimation ();
526
-
527
527
int width = ((ViewGroup ) view .getParent ()).getWidth ();
528
528
int height = ((ViewGroup ) view .getParent ()).getHeight ();
529
529
@@ -533,8 +533,10 @@ public void setTarget(View view, float widthRatio, float heightRatio, float radi
533
533
behaviour .setUpBehaviour (this , width , height );
534
534
}
535
535
536
- parent .removeView (this );
537
- parent .addView (this );
536
+ if (this .getParent () != parent ) {
537
+ parent .removeView (this );
538
+ parent .addView (this );
539
+ }
538
540
539
541
int [] locationView = new int [2 ];
540
542
@@ -679,11 +681,11 @@ public void setInnerOutLineWidth(float innerOutLineWidth) {
679
681
this .innerOutLineWidth = innerOutLineWidth ;
680
682
}
681
683
682
- public int getIndicatorIntervalDelay () {
684
+ public long getIndicatorIntervalDelay () {
683
685
return indicatorIntervalDelay ;
684
686
}
685
687
686
- public void setIndicatorIntervalDelay (int indicatorIntervalDelay ) {
688
+ public void setIndicatorIntervalDelay (long indicatorIntervalDelay ) {
687
689
this .indicatorIntervalDelay = indicatorIntervalDelay ;
688
690
}
689
691
@@ -857,11 +859,11 @@ public void setIndicatorRepeatMode(int indicatorRepeatMode) {
857
859
this .indicatorRepeatMode = indicatorRepeatMode ;
858
860
}
859
861
860
- public int getIndicatorDuration () {
862
+ public long getIndicatorDuration () {
861
863
return indicatorDuration ;
862
864
}
863
865
864
- public void setIndicatorDuration (int indicatorDuration ) {
866
+ public void setIndicatorDuration (long indicatorDuration ) {
865
867
this .indicatorDuration = indicatorDuration ;
866
868
}
867
869
0 commit comments