https://github.com/chayanforyou/androidimageslider
An amazing and convenient Android image slider.
https://github.com/chayanforyou/androidimageslider
android image imageslider imageslideshow java kotlin slider slideshow
Last synced: 3 months ago
JSON representation
An amazing and convenient Android image slider.
- Host: GitHub
- URL: https://github.com/chayanforyou/androidimageslider
- Owner: chayanforyou
- License: mit
- Created: 2022-10-16T05:49:06.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T06:09:48.000Z (over 2 years ago)
- Last Synced: 2025-01-14T08:11:31.589Z (5 months ago)
- Topics: android, image, imageslider, imageslideshow, java, kotlin, slider, slideshow
- Language: Java
- Homepage:
- Size: 3.97 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Image Slider
[](https://github.com/chayanforyou/AndroidImageSlider/releases)
[](https://android-arsenal.com/api?level=19)

[](https://github.com/chayanforyou/AndroidImageSlider/pulls)Forked from https://github.com/daimajia/AndroidImageSlider which was getting very old. I needed to get a project working that had used this a while back but was now incompatible with modern build tools and android libs.
---
This is an amazing image slider for the Android platform. I decided to open source this because there is really not an attractive, convenient slider widget in Android.
You can easily load images from an internet URL, drawable, or file. And there are many kinds of amazing animations you can choose. 😀
## Demo
## Setup
```groovy
dependencies {
implementation 'io.github.chayanforyou:slider:1.0.0'
}
```## Usage
- Add the Slider to your **layout**:
```xml```
- If you want to use **custom indicator**:
```xml```
- You can change indicators
```
app:selected_drawable="@drawable/selected_dot"
app:unselected_drawable="@drawable/unselected_dot"
```- Add Slider to your **activity**
```kotlin
//val urlMaps = HashMap()
//urlMaps["Hannibal"] = "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg"
//urlMaps["Big Bang Theory"] = "http://tvfiles.alphacoders.com/100/hdclearart-10.png"
//urlMaps["House of Cards"] = "http://cdn3.nflximg.net/images/3093/2043093.jpg"
//urlMaps["Game of Thrones"] = "http://images.boomsbeat.com/data/images/full/19640/game-of-thrones-season-4-jpg.jpg"val fileMaps: HashMap = HashMap()
fileMaps["Hannibal"] = R.drawable.hannibal
fileMaps["Big Bang Theory"] = R.drawable.bigbang
fileMaps["House of Cards"] = R.drawable.house
fileMaps["Game of Thrones"] = R.drawable.game_of_thronesfor (name in fileMaps.keys) {
val sliderView = TextSliderView(this)// initialize a SliderLayout
sliderView.description(name)
.image(fileMaps[name]!!)
.setScaleType(BaseSliderView.ScaleType.Fit)// add SliderView to the SliderLayout
mDemoSlider.addSlider(sliderView)
}
mDemoSlider.setDuration(4000)
mDemoSlider.setCustomAnimation(DescriptionAnimation())
bmDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion)
mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom)
```- You can use click listener
```kotlin
sliderView.setOnSliderClickListener(object : BaseSliderView.OnSliderClickListener {
override fun onSliderClick(slider: BaseSliderView?) {
// You can listen here
}
})
```- You can add stop and start auto sliding again
```kotlin
mDemoSlider.startAutoCycle(4000, 4000, true)
mDemoSlider.startAutoCycle()
mDemoSlider.stopAutoCycle()
```[Code example](https://github.com/chayanforyou/AndroidImageSlider/blob/master/demo/src/main/java/io/github/chayanforyou/slider/demo/MainActivity.kt)
[Layout example](https://github.com/chayanforyou/AndroidImageSlider/blob/master/demo/src/main/res/layout/activity_main.xml)
====
## Advanced usagePlease visit [Wiki](https://github.com/daimajia/AndroidImageSlider/wiki)
## Thanks- [Picasso](https://github.com/square/picasso)
- [ViewPagerTransforms](https://github.com/ToxicBakery/ViewPagerTransforms)