• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

before after slider

Before and after image slider

The library uses Glide for image loading

Fix: The image clip retains its last position when screen orientation changes.


  <com.github.developer__.BeforeAfterSlider
        android:id="@+id/mySlider"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        app:slider_thumb="@mipmap/white_circle" 
        />
  //Inside java
  
  mySlider.setBeforeImage(imgUrl1).setAfterImage(imgUrl2)  
  //to change slider_thumb programmaticaly
  mySlider.setSliderThumb(yourDrawable)
  <!--  to set images from xml  -->
  app:before_image="@mipmap/image1"
  app:after_image="@mipmap/image2"

Gradle dependency

//ORIGINAL
//add this to your top level build.gradle file
 maven { url 'https://dl.bintray.com/kandroid/maven' }
 
//and add this to your module level build.gradle file
  compile 'com.github.developer--:beforeafterslider:1.0.4'
  
//MY VERSION
//add this to your top level build.gradle file
  maven { url 'https://jitpack.io' }