Android全屏以幻灯片方式展示图片:Android-ScreenSlidePager
ngww
9年前
通过Picasso从互联网取得图片,然后全屏幻灯片方式展示。
demo
The indicator at the bottom of ScreenSlidePager has been extracted as an aar. Your can add it to your dependecies to use it independently.
Gradle
compile 'com.liangfeizc:SlidePageIndicator:1.0.0@aar'
Maven
<dependency> <groupId>com.liangfeizc</groupId> <artifactId>SlidePageIndicator</artifactId> <version>1.0.0</version> <type>aar</type> </dependency>
how to use
CirclePageIndicatorandViewPagershoud be used as child views of aFramelayout. But here we usedmergeinstead, because the root view in any activity is aFrameLayout. You can useandroid:gravityto position theCirclePageIndicatorand useapp:indicator_spacingto adjust the spacing between two adjencent circle indicators.
<merge xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" /> <com.liangfeizc.slidepageindicator.CirclePageIndicator android:id="@+id/indicator" android:gravity="bottom|center_horizontal" app:indicator_spacing="5dp" android:layout_marginBottom="20dp" android:layout_marginStart="20dp" android:layout_marginLeft="20dp" android:layout_width="match_parent" android:layout_height="match_parent" /> </merge>
dependencies
项目主页:http://www.open-open.com/lib/view/home/1429774250838