11package cn .trinea .android .view .autoscrollviewpager ;
22
3+ import java .lang .ref .WeakReference ;
4+ import java .lang .reflect .Field ;
5+
36import android .content .Context ;
47import android .os .Handler ;
58import android .os .Message ;
1013import android .view .MotionEvent ;
1114import android .view .animation .Interpolator ;
1215
13- import java .lang .ref .WeakReference ;
14- import java .lang .reflect .Field ;
15-
1616/**
1717 * Auto Scroll View Pager
1818 * <ul>
2929 * <li>{@link #setSlideBorderMode(int)} set how to process when sliding at the last or first item</li>
3030 * <li>{@link #setStopScrollWhenTouch(boolean)} set whether stop auto scroll when touching, default is true</li>
3131 * </ul>
32- *
32+ *
3333 * @author <a href="http://www.trinea.cn" target="_blank">Trinea</a> 2013-12-30
3434 */
3535public class AutoScrollViewPager extends ViewPager {
@@ -81,7 +81,7 @@ public AutoScrollViewPager(Context paramContext, AttributeSet paramAttributeSet)
8181 init ();
8282 }
8383
84- private void init () {
84+ private void init () {
8585 handler = new MyHandler (this );
8686 setViewPagerScroller ();
8787 }
@@ -91,12 +91,12 @@ private void init() {
9191 */
9292 public void startAutoScroll () {
9393 isAutoScroll = true ;
94- sendScrollMessage ((long ) (interval + scroller .getDuration ()/ autoScrollFactor * swipeScrollFactor ));
94+ sendScrollMessage ((long )(interval + scroller .getDuration () / autoScrollFactor * swipeScrollFactor ));
9595 }
9696
9797 /**
9898 * start auto scroll
99- *
99+ *
100100 * @param delayTimeInMills first scroll delay time
101101 */
102102 public void startAutoScroll (int delayTimeInMills ) {
@@ -254,7 +254,7 @@ public void handleMessage(Message msg) {
254254
255255 /**
256256 * get auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL}
257- *
257+ *
258258 * @return the interval
259259 */
260260 public long getInterval () {
@@ -263,7 +263,7 @@ public long getInterval() {
263263
264264 /**
265265 * set auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL}
266- *
266+ *
267267 * @param interval the interval to set
268268 */
269269 public void setInterval (long interval ) {
@@ -272,7 +272,7 @@ public void setInterval(long interval) {
272272
273273 /**
274274 * get auto scroll direction
275- *
275+ *
276276 * @return {@link #LEFT} or {@link #RIGHT}, default is {@link #RIGHT}
277277 */
278278 public int getDirection () {
@@ -281,7 +281,7 @@ public int getDirection() {
281281
282282 /**
283283 * set auto scroll direction
284- *
284+ *
285285 * @param direction {@link #LEFT} or {@link #RIGHT}, default is {@link #RIGHT}
286286 */
287287 public void setDirection (int direction ) {
@@ -290,7 +290,7 @@ public void setDirection(int direction) {
290290
291291 /**
292292 * whether automatic cycle when auto scroll reaching the last or first item, default is true
293- *
293+ *
294294 * @return the isCycle
295295 */
296296 public boolean isCycle () {
@@ -299,7 +299,7 @@ public boolean isCycle() {
299299
300300 /**
301301 * set whether automatic cycle when auto scroll reaching the last or first item, default is true
302- *
302+ *
303303 * @param isCycle the isCycle to set
304304 */
305305 public void setCycle (boolean isCycle ) {
@@ -308,7 +308,7 @@ public void setCycle(boolean isCycle) {
308308
309309 /**
310310 * whether stop auto scroll when touching, default is true
311- *
311+ *
312312 * @return the stopScrollWhenTouch
313313 */
314314 public boolean isStopScrollWhenTouch () {
@@ -317,7 +317,7 @@ public boolean isStopScrollWhenTouch() {
317317
318318 /**
319319 * set whether stop auto scroll when touching, default is true
320- *
320+ *
321321 * @param stopScrollWhenTouch
322322 */
323323 public void setStopScrollWhenTouch (boolean stopScrollWhenTouch ) {
@@ -326,7 +326,7 @@ public void setStopScrollWhenTouch(boolean stopScrollWhenTouch) {
326326
327327 /**
328328 * get how to process when sliding at the last or first item
329- *
329+ *
330330 * @return the slideBorderMode {@link #SLIDE_BORDER_MODE_NONE}, {@link #SLIDE_BORDER_MODE_TO_PARENT},
331331 * {@link #SLIDE_BORDER_MODE_CYCLE}, default is {@link #SLIDE_BORDER_MODE_NONE}
332332 */
@@ -336,7 +336,7 @@ public int getSlideBorderMode() {
336336
337337 /**
338338 * set how to process when sliding at the last or first item
339- *
339+ *
340340 * @param slideBorderMode {@link #SLIDE_BORDER_MODE_NONE}, {@link #SLIDE_BORDER_MODE_TO_PARENT},
341341 * {@link #SLIDE_BORDER_MODE_CYCLE}, default is {@link #SLIDE_BORDER_MODE_NONE}
342342 */
@@ -346,7 +346,7 @@ public void setSlideBorderMode(int slideBorderMode) {
346346
347347 /**
348348 * whether animating when auto scroll at the last or first item, default is true
349- *
349+ *
350350 * @return
351351 */
352352 public boolean isBorderAnimation () {
@@ -355,7 +355,7 @@ public boolean isBorderAnimation() {
355355
356356 /**
357357 * set whether animating when auto scroll at the last or first item, default is true
358- *
358+ *
359359 * @param isBorderAnimation
360360 */
361361 public void setBorderAnimation (boolean isBorderAnimation ) {
0 commit comments