Picture Auto scrolling, loop play Android Auto-scroll-view-pager (reprint)

Source: Internet
Author: User

Detailed View:

http://uisource.com/project/auto-scroll-view-pager/

The sample code can be seen:

Https://github.com/Trinea/android-demo/blob/master/src/cn/trinea/android/demo/AutoScrollViewPagerDemo.java

Use:

1. Introduction of Library

2. Call:

① Layout definition

< cn . Trinea.android.view.autoscrollviewpager.AutoScrollViewPager    android:id= "@+id/view_pager"      android:layout_width= "Match_parent"    android:layout_height= "Wrap_ Content "/>

Instead of the general Viewpager definition

② Start Viewpager Auto-scroll

// Start automatic scrolling // Stop automatic scrolling

3. Setting

SetInterval (Long)//set the interval between automatic scrolling in millisecondsSetdirection (int)//sets the direction of automatic scrolling by default to the rightSetcycle (Boolean)//whether to automatically cycle the carousel, the default is TrueSetscrolldurationfactor (Double)//sets the magnification of the Viewpager sliding animation interval to slow the animation or change the animation speedSetstopscrollwhentouch (Boolean)//whether to stop auto-scrolling when the finger touches the Viewpager, the default is TrueSetslidebordermode (int)//Swipe to handle the first or last item, support No action, carousel, and pass to Parent view three modesSetborderanimation (Boolean)//Sets whether animation is required to scroll from edge to next when looping scrolling, by default true

4. Other

① indicator, round or square indicator please use with Viewpagerindicator

② Infinite Loop, if you want to continue playing the first sheet instead of returning to the first one in the last sheet, please refer to Autoscrollviewpagersingledemo.java, note that this feature cannot be used with Viewpagerindicator

Picture Auto scrolling, loop play Android Auto-scroll-view-pager (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.