Skip to content

Mikhail57/AndroidImageSlider

 
 

Repository files navigation

Android Image Slider

This is based on daimajia's work. I changed it to use frescolib, and fixed some memory leaks.

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 any resource using the URI. As it is based on frescolib, read more at http://frescolib.org/docs/supported-uris.html#_

And there are many kinds of amazing animations you can choose. :-D

Demo

Download Apk

Usage

Step 1

Gradle

  1. Add it in your root build.gradle at the end of repositories:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency
dependencies {
    implementation 'com.github.Mikhail57:AndroidImageSlider:1.1.6'
}

Step 2

Add permissions (if necessary) to your AndroidManifest.xml

<!-- if you want to load images from the internet -->
<uses-permission android:name="android.permission.INTERNET" /> 

<!-- if you want to load images from a file OR from the internet -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Note: If you want to load images from the internet, you need both the INTERNET and READ_EXTERNAL_STORAGE permissions to allow files from the internet to be cached into local storage.

If you want to load images from drawable, then no additional permissions are necessary.

Step 3

Add the Slider to your layout:

<com.daimajia.slider.library.SliderLayout
        android:id="@+id/slider"
        android:layout_width="match_parent"
        android:layout_height="200dp"
/>

There are some default indicators. If you want to use a provided indicator:

<com.daimajia.slider.library.Indicators.PagerIndicator
        android:id="@+id/custom_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        />

Code example

====

Advanced usage

Please visit Wiki

Thanks

About

Image slider with androidx support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%