Skip to content

yundequanshi/SimpleSlider

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Slider

I wrote this library just because I want a lightweight slider.

Use your own imageloader;
Create your own indicator;
Variety of transition effects;
Customize the animation of each page.

~(~ ̄▽ ̄)~

Demo

中文文档

simpleslider

How to use

Gradle

dependencies {
    	compile 'net.cpacm.simpleslider:library:1.0.1'
}

Add the slider to your layout

<net.cpacm.library.SimpleSliderLayout
    android:id="@+id/simple_slider"
    android:layout_width="match_parent"
    android:layout_height="140dp"
    android:background="#ffffff">
    
</net.cpacm.library.SimpleSliderLayout>

Config in your code

simpleSliderLayout.setCycling(true);
simpleSliderLayout.setAutoCycling(true);
simpleSliderLayout.setSliderDuration(3000);
simpleSliderLayout.setSliderTransformDuration(1000);
simpleSliderLayout.setPageTransformer(new FlipPageViewTransformer());
simpleSliderLayout.setAnimationListener(null);
circlePageIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
simpleSliderLayout.setViewPagerIndicator(circlePageIndicator);
simpleSliderLayout.setAnimationListener(new DefaultDescriptionAnimation());

Advanced usage

Slider

  • ImageSliderView include ImageView
  • DescriptionSliderView include ImageView and TextView

You can customize the Slider extends BaseSliderView

Indicator

indicator

  • CirclePageIndicator
  • IconPageIndicator
  • LinePageIndicator
  • UnderlinePageIndicator

The above indicators modified from ViewPagerIndicator

  • SpringIndicator

Modify from SpringIndicator

You can customize the indicator implements PageIndicator

Transform

Transform

The above transforms come from AndroidImageSlider

You can customize the transform extends BaseTransformer

Animation

Transform

You can customize the animation implements OnAnimationListener

Note:

In the infinite loop mode, at least three sliders. Android API >= 3.0

License

Copyright 2016 cpacm

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A simple slider allows you to easily use.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%