Skip to content

Commit 81431e2

Browse files
authored
Update Readme.md
I Have Added Some Implementation Examples to The Read me File. Thanks
1 parent 2220d9b commit 81431e2

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,73 @@ public class SliderAdapterExample extends
166166

167167
}
168168
```
169+
170+
## Custom Slider Image Layout
171+
172+
you can make your own layout for slider view
173+
174+
here is an example for adapter implementation :
175+
176+
```xml
177+
<?xml version="1.0" encoding="utf-8"?>
178+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
179+
xmlns:tools="http://schemas.android.com/tools"
180+
android:layout_width="match_parent"
181+
android:layout_height="match_parent"
182+
android:orientation="vertical">
183+
184+
<ImageView
185+
android:id="@+id/iv_auto_image_slider"
186+
android:layout_width="match_parent"
187+
android:layout_height="match_parent"
188+
android:scaleType="fitXY" />
189+
190+
191+
<ImageView
192+
android:id="@+id/iv_gif_container"
193+
android:layout_width="80dp"
194+
android:layout_height="80dp"
195+
android:layout_gravity="bottom|start"
196+
android:layout_margin="50dp" />
197+
198+
199+
<FrameLayout
200+
android:id="@+id/fl_shadow_container"
201+
android:background="@drawable/bg_overlay"
202+
android:layout_width="match_parent"
203+
android:layout_height="wrap_content"
204+
android:layout_gravity="bottom">
205+
206+
<TextView
207+
android:id="@+id/tv_auto_image_slider"
208+
android:layout_width="match_parent"
209+
android:layout_height="wrap_content"
210+
android:layout_marginTop="8dp"
211+
android:layout_marginBottom="25dp"
212+
android:padding="6dp"
213+
android:textColor="#FFF"
214+
android:textSize="18sp" />
215+
216+
</FrameLayout>
217+
218+
</FrameLayout>
219+
```
220+
169221
## Set the adapter to the Sliderview
170222

171223
After the instantiating of the sliderView (inside the activity or fragment with findViewById|BindView blah blah...), set the adapter to the slider.
172224

173225
```java
226+
SliderView sliderView = findViewById(R.id.imageSlider);
174227
sliderView.setSliderAdapter(new SliderAdapterExample(context));
175228
```
176229

177230
You can call this method if you want to start flipping automatically and you can also set up the slider animation :
178231

179232
```java
180-
sliderView.startAutoCycle();
181233
sliderView.setIndicatorAnimation(IndicatorAnimationType.WORM);
182234
sliderView.setSliderTransformAnimation(SliderAnimations.SIMPLETRANSFORMATION);
235+
sliderView.startAutoCycle();
183236
```
184237

185238
## Elaborate more?

0 commit comments

Comments
 (0)