Skip to content

Commit 8eaaeea

Browse files
committed
fix stopAutoCycle
1 parent 726dfe5 commit 8eaaeea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

library/src/main/java/com/daimajia/slider/library/SliderLayout.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ private void pauseAutoCycle(){
286286
public void setDuration(long duration){
287287
if(duration >= 500){
288288
mSliderDuration = duration;
289-
startAutoCycle();
289+
if(mAutoCycle && mCycling){
290+
startAutoCycle();
291+
}
290292
}
291293
}
292294

@@ -307,6 +309,7 @@ public void stopAutoCycle(){
307309
mResumingTask.cancel();
308310
}
309311
mAutoCycle = false;
312+
mCycling = false;
310313
}
311314

312315
/**
@@ -329,7 +332,7 @@ public void run() {
329332
startAutoCycle();
330333
}
331334
};
332-
mResumingTimer.schedule(mResumingTask,6000);
335+
mResumingTimer.schedule(mResumingTask, 6000);
333336
}
334337
}
335338

0 commit comments

Comments
 (0)