@@ -8,9 +8,16 @@ ECardFlow, 一个用于复数卡片滑动与展开效果的ViewPager控件,设
88)
99
1010#Preview
11- ![ ] ( https://github.com/codeestX/ECardFlow/raw/master/preview/GIF.gif )
11+ < b >ECardFlow:</ b >
1212
13- #Usage
13+ ![ ] ( https://github.com/codeestX/ECardFlow/raw/master/preview/GIF.gif )
14+
15+ <b >ECardFlowLayout:</b >
16+
17+ ![ ] ( https://github.com/codeestX/ECardFlow/raw/master/preview/GIFBlur.gif )
18+ ![ ] ( https://github.com/codeestX/ECardFlow/raw/master/preview/GIFMove.gif )
19+
20+ #Usage(ECardFlow)
1421
1522Step 1. Add the JitPack repository to your build file
1623
@@ -46,13 +53,13 @@ Step 3. Just use it as a ViewPager
4653Attrs:
4754
4855 <declare-styleable name="attr">
49- <!-- Page switch time, default 1200ms -->
56+ <!-- Page switching time, default 1200ms -->
5057 <attr name="switchTime" format="integer" />
5158
52- <!-- Page expand time, default 700ms -->
59+ <!-- Page expanding time, default 700ms -->
5360 <attr name="expandTime" format="integer" />
5461
55- <!-- Page expand mode, click or slide up to expand, default slide_up -->
62+ <!-- Page expanding mode, click or slide up to expand, default slide_up -->
5663 <attr name="expandMode">
5764 <enum name="slide_up" value="10" />
5865 <enum name="click" value="11" />
@@ -93,6 +100,71 @@ Java Code:
93100
94101 }
95102 });
103+
104+ #Usage(ECardFlowLayout)
105+ Step 1. Add the JitPack repository to your build file
106+
107+ allprojects {
108+ repositories {
109+ ...
110+ maven { url "https://jitpack.io" }
111+ }
112+ }
113+
114+ Step 2. Add the dependency
115+
116+ dependencies {
117+ compile 'com.github.codeestX:ECardFlow:v1.0.2'
118+ }
119+
120+ Step 3. Just put a ViewPager in ECardFlowLayout
121+
122+ <moe.codeest.ecardflow.ECardFlowLayout
123+ xmlns:android="http://schemas.android.com/apk/res/android"
124+ android:id="@+id/ecardflow_layout"
125+ android:layout_width="match_parent"
126+ android:layout_height="match_parent"
127+ android:clipChildren="false">
128+ <android.support.v4.view.ViewPager
129+ android:id="@+id/viewpager"
130+ android:layout_width="240dp"
131+ android:layout_height="270dp"
132+ android:layout_gravity="center_horizontal|bottom"
133+ android:layout_marginBottom="80dp"/>
134+ </moe.codeest.ecardflow.ECardFlowLayout>
135+
136+ Step 4. setAnimMode & setImageProvider
137+
138+ mVPLayout = (ECardFlowLayout) findViewById(R.id.ecardflow_layout);
139+ mVPLayout.setAnimMode(new BlurAnimMode());
140+ mVPLayout.setImageProvider(new DrawableImageProvider(this, res, width, height);
141+
142+ * Set AnimMode before Set ImageProvider
143+ * See DemoProject for more details
144+ * Use ` mVPLayout.onDestroy(); ` to release source
145+
146+ Attrs:
147+
148+ <declare-styleable name="attr_layout">
149+ <!-- The duration of Page switching animation, default 300ms -->
150+ <attr name="switchAnimTime" format="integer" />
151+ </declare-styleable>
152+
153+
154+ | AnimMode | Des |
155+ | :-------------:| :-------------:|
156+ | DefaultAnimMode | No Effect |
157+ | BlurAnimMode | Blur Effect |
158+ | MoveAnimMode | Parallax Effect |
159+ You can custom AnimMode with class which implements ` AnimMode `
160+
161+ | ImageProvider | Des |
162+ | :-------------:| :-------------:|
163+ | DrawableImageProvider | Prividing resId(R.drawable/mipmap.xx) as image resource |
164+ | PathImageProvider | Prividing file path as image resource |
165+ | FileImageProvider | Prividing ` File ` as image resource |
166+ You can custom ImageProvider with class which implements ` ImageProvider `
167+
96168
97169#License
98170
0 commit comments