Skip to content

Commit 9616b20

Browse files
committed
readme updated
1 parent d17600e commit 9616b20

File tree

1 file changed

+57
-23
lines changed

1 file changed

+57
-23
lines changed

README.md

+57-23
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
This is an amazing image slider for the Android .
88

9-
You can easily load images from an internet URL, drawable, or file. And there are many kinds of amazing animations you can choose.
9+
You can easily load images with your custom layout, And there are many kinds of amazing animations you can choose.
1010

11-
implementation 'com.github.smarteist:autoimageslider:1.3.1'
11+
implementation 'com.github.smarteist:autoimageslider:1.3.2'
1212

1313
### New Feautures
1414
* Added new adapter based slider view, Provides the ability to add custom views
1515
* Bugs fixed
16+
* Fixed animation issues
17+
* Indicator attributes added
1618
* Migrated to androidx
1719

1820
# Demo
@@ -27,10 +29,23 @@ Just put the view in the layout xml like this:
2729

2830
```xml
2931
<com.smarteist.autoimageslider.SliderView
30-
android:layout_width="match_parent"
31-
android:layout_height="300dp"
32-
android:layout_alignParentTop="true"
33-
android:id="@+id/imageSlider"/>
32+
android:id="@+id/imageSlider"
33+
android:layout_width="match_parent"
34+
android:layout_height="300dp"
35+
app:sliderAnimationDuration="600"
36+
app:sliderAutoCycleDirection="back_and_forth"
37+
app:sliderAutoCycleEnabled="true"
38+
app:sliderCircularHandlerEnabled="true"
39+
app:sliderIndicatorAnimationDuration="600"
40+
app:sliderIndicatorGravity="center_horizontal|bottom"
41+
app:sliderIndicatorMargin="15dp"
42+
app:sliderIndicatorOrientation="horizontal"
43+
app:sliderIndicatorPadding="3dp"
44+
app:sliderIndicatorRadius="2dp"
45+
app:sliderIndicatorSelectedColor="#5A5A5A"
46+
app:sliderIndicatorUnselectedColor="#FFF"
47+
app:sliderScrollTimeInSec="1"
48+
app:sliderStartAutoCycle="true" />
3449
```
3550

3651
Or you can wrap it in a cardView :
@@ -43,10 +58,23 @@ Just put the view in the layout xml like this:
4358
android:layout_height="wrap_content">
4459

4560
<com.smarteist.autoimageslider.SliderView
46-
android:layout_width="match_parent"
47-
android:layout_height="300dp"
48-
android:layout_alignParentTop="true"
49-
android:id="@+id/imageSlider"/>
61+
android:id="@+id/imageSlider"
62+
android:layout_width="match_parent"
63+
android:layout_height="300dp"
64+
app:sliderAnimationDuration="600"
65+
app:sliderAutoCycleDirection="back_and_forth"
66+
app:sliderAutoCycleEnabled="true"
67+
app:sliderCircularHandlerEnabled="true"
68+
app:sliderIndicatorAnimationDuration="600"
69+
app:sliderIndicatorGravity="center_horizontal|bottom"
70+
app:sliderIndicatorMargin="15dp"
71+
app:sliderIndicatorOrientation="horizontal"
72+
app:sliderIndicatorPadding="3dp"
73+
app:sliderIndicatorRadius="2dp"
74+
app:sliderIndicatorSelectedColor="#5A5A5A"
75+
app:sliderIndicatorUnselectedColor="#FFF"
76+
app:sliderScrollTimeInSec="1"
77+
app:sliderStartAutoCycle="true" />
5078

5179
</androidx.cardview.widget.CardView>
5280
```
@@ -138,19 +166,25 @@ Here is a more realistic and more complete example :
138166
```java
139167

140168
@Override
141-
protected void onCreate(Bundle savedInstanceState) {
142-
super.onCreate(savedInstanceState);
143-
setContentView(R.layout.activity_main);
144-
145-
SliderView sliderView = findViewById(R.id.imageSlider);
146-
147-
sliderView.setSliderAdapter(new SliderAdapterExample(this));
148-
149-
sliderView.setIndicatorAnimation(IndicatorAnimations.SWAP); //set indicator animation by using SliderLayout.IndicatorAnimations. :WORM or THIN_WORM or COLOR or DROP or FILL or NONE or SCALE or SCALE_DOWN or SLIDE and SWAP!!
150-
sliderView.setSliderTransformAnimation(SliderAnimations.DEPTHTRANSFORMATION);
151-
sliderView.setScrollTimeInSec(2); //set scroll delay in seconds :
152-
sliderView.startAutoCycle();
153-
}
169+
protected void onCreate(Bundle savedInstanceState) {
170+
super.onCreate(savedInstanceState);
171+
setContentView(R.layout.activity_main);
172+
173+
SliderView sliderView = findViewById(R.id.imageSlider);
174+
175+
SliderAdapterExample adapter = new SliderAdapterExample(this);
176+
177+
sliderView.setSliderAdapter(adapter);
178+
179+
sliderView.setIndicatorAnimation(IndicatorAnimations.WORM); //set indicator animation by using SliderLayout.IndicatorAnimations. :WORM or THIN_WORM or COLOR or DROP or FILL or NONE or SCALE or SCALE_DOWN or SLIDE and SWAP!!
180+
sliderView.setSliderTransformAnimation(SliderAnimations.SIMPLETRANSFORMATION);
181+
sliderView.setAutoCycleDirection(SliderView.AUTO_CYCLE_DIRECTION_BACK_AND_FORTH);
182+
sliderView.setIndicatorSelectedColor(Color.WHITE);
183+
sliderView.setIndicatorUnselectedColor(Color.GRAY);
184+
sliderView.setScrollTimeInSec(4); //set scroll delay in seconds :
185+
sliderView.startAutoCycle();
186+
187+
}
154188
```
155189

156190
# Contribute

0 commit comments

Comments
 (0)