一个易于使用的Material Design ViewPager库:MaterialViewPager

gxw6 10年前

一个易于使用的Material Design ViewPager库。

Build screen

Sample

You can find a sample APK : Link

And have a look on a sample 油Tube Video : 油Tube Link

Video

Download

In your root build.gradle add

repositories {      maven {          url "http://dl.bintray.com/florent37/maven" }  }

In your module Download

compile ('com.github.florent37:materialviewpager:1.0.0@aar'){      transitive = true }

Usage

Add MaterialViewPager to your activity's layout

<com.github.florent37.materialviewpager.MaterialViewPager      android:id="@+id/materialViewPager"      android:layout_width="match_parent"      android:layout_height="match_parent"      app:viewpager_logo="@layout/header_logo"      app:viewpager_logoMarginTop="100dp"      app:viewpager_color="@color/colorPrimary"      app:viewpager_headerHeight="200dp"      app:viewpager_hideLogoWithFade="true"      app:viewpager_hideToolbarAndTitle="true"      app:viewpager_enableToolbarElevation="true"      />


You will see on Android Studio Preview :

alt preview

Retrieve the MaterialViewPager

You can use MaterialViewPager as an usual Android View, and get it by findViewById

public class MainActivity extends ActionBarActivity {        private MaterialViewPager mViewPager;        @Override      protected void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.activity_main);            mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);      }  }


项目主页:http://www.open-open.com/lib/view/home/1430658572467