SimpleSlider

A simple slider allows you to easily use.

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

io.github.cpacm
ArtifactId

ArtifactId

simpleslider
Last Version

Last Version

2.3.2
Release Date

Release Date

Type

Type

aar
Description

Description

SimpleSlider
A simple slider allows you to easily use.
Project URL

Project URL

https://github.com/cpacm/SimpleSlider
Source Code Management

Source Code Management

https://github.com/cpacm/SimpleSlider

Download simpleslider

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.cpacm/simpleslider/ -->
<dependency>
    <groupId>io.github.cpacm</groupId>
    <artifactId>simpleslider</artifactId>
    <version>2.3.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.cpacm/simpleslider/
implementation 'io.github.cpacm:simpleslider:2.3.2'
// https://jarcasting.com/artifacts/io.github.cpacm/simpleslider/
implementation ("io.github.cpacm:simpleslider:2.3.2")
'io.github.cpacm:simpleslider:aar:2.3.2'
<dependency org="io.github.cpacm" name="simpleslider" rev="2.3.2">
  <artifact name="simpleslider" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.github.cpacm', module='simpleslider', version='2.3.2')
)
libraryDependencies += "io.github.cpacm" % "simpleslider" % "2.3.2"
[io.github.cpacm/simpleslider "2.3.2"]

Dependencies

compile (1)

Group / Artifact Type Version
androidx.appcompat » appcompat jar 1.2.0

Project Modules

There are no modules declared in this project.

Simple Slider

Maven Central

Intro

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

Use your own imageloader;
Create your own indicator;
Variety of transition effects.

这是一款轻量级的图片轮播器,它包括了一下几个特点:

与图片加载框架完全解耦;
内置常用的指示器,基本满足对指示器的需求;
丰富多彩的转场动画,亦可以发挥你的创意创造新的特效;
内置不同款式的轮播器。

How to use

Gradle

repositories {
  google()
  mavenCentral()
}

dependencies {
    implementation 'io.github.cpacm:simpleslider:2.3.2'
}

Compile with Android 28 and androidx

Add the slider to your layout

<com.cpacm.library.SimpleViewPager
    android:id="@+id/simple_slider"
    android:layout_width="match_parent"
    android:layout_height="140dp">

</com.cpacm.library.SimpleSlider>

Config in your code

    simpleSlider.setInfiniteEnable(true);
    simpleSlider.startAutoScroll(true);
    simpleSlider.setSliderDuration(3000);
    simpleSlider.setSliderTransformDuration(DEFAULT_SCROLL_DURATION, new SpringInterpolator());
    simpleSlider.setPageTransformer(new ZoomOutSlideTransformer());
    circlePageIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
    circlePageIndicator.setViewPager(simpleSlider);
    //when adapter's data changed, you should call this method
    //当adapter数据更新时,必须要调用
    simpleSLider.notifyDataSetChanged();

Advanced usage

Basic

indicator

两种轮播器,一种是普通模式,一种是回廊模式。

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

丰富的过场动画(上面的回廊式轮播就可以通过设置 Transform 来实现)

Note:

无限轮播最低要求有三张页面。

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

License

Copyright 2018 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.

Versions

Version
2.3.2
2.3.1