Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/litao0621/nifty-slider

:star: Sliders allow users to make selections from a range of values. :star:
https://github.com/litao0621/nifty-slider

progress-bar seekbar slider ui ux

Last synced: 6 days ago
JSON representation

:star: Sliders allow users to make selections from a range of values. :star:

Awesome Lists containing this project

README

        

![banner](https://github.com/litao0621/NiftySlider/blob/main/art/banner1.png)

![NiftySliderVersion](https://maven-badges.herokuapp.com/maven-central/io.github.litao0621/nifty-slider/badge.svg)
[![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)
| [View documentation][2] | [中文][3]

# Getting Started

1. Maven library dependency
``` groovy
dependencies {
implementation 'io.github.litao0621:nifty-slider:(latest version)'
// Added effect for Sliders (Optional Features)
implementation 'io.github.litao0621:nifty-slider-effect:(latest version)'
}
```

2. Add it to the layout file

``` xml

```
[View more attributes][1]

3. Registers a callback to be invoked when the slider changes

``` kotlin
binding.niftySlider.setOnValueChangeListener { slider, value, fromUser ->
//do something with float value
}
binding.niftySlider.setOnIntValueChangeListener { slider, value, fromUser ->
//do something with int value
}
binding.niftySlider.setOnSliderTouchListener(object :NiftySlider.OnSliderTouchListener{
override fun onStartTrackingTouch(slider: NiftySlider) {
//do something on touch start
}
override fun onStopTrackingTouch(slider: NiftySlider) {
//do something on touch stop
}
})
```

# Custom Effects

### 1. M3 Style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/M3StyleDemoFragment.kt)

### 2. WeRead Style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/WeReadDemoFragment.kt)

### 3. Color Pick Style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/ColorPickDemoFragment.kt)

### 4. Custom Thumb Drawable Style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/CustomThumbDemoFragment.kt)

### 5. Lottie Animation style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/CustomThumbWithLottieDemoFragment.kt)

### 6. Tiktok Style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/TiktokStyleDemoFragment.kt)

### 7. BiliBili Style

[View Sample](https://github.com/litao0621/NiftySlider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/BiliBiliDemoFragment.kt)

### 8. YouTube video preview style

[View Sample](https://github.com/litao0621/nifty-slider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/YouTubeDemoFragment.kt)

### 9. YouTube graph style

[View Sample](https://github.com/litao0621/nifty-slider/blob/main/simple/src/main/java/com/litao/niftyslider/fragment/YouTubeChartDemoFragment.kt)

### 10. Effect with issues [#13](https://github.com/litao0621/nifty-slider/issues/13)

[View Sample](https://github.com/litao0621/nifty-slider/blob/main/sample/src/main/java/com/litao/niftyslider/fragment/IndicatorStyle1Fragment.kt)

### 11. Vertical Mode

[View Sample](https://github.com/litao0621/nifty-slider/blob/main/sample/src/main/java/com/litao/niftyslider/fragment/VerticalFragment.kt)

# Contributing
You are welcome to send push requests (Just remember to add you name to the contributers list) or raise issues

# Donate
If you feel this library has helped you, you can click the Star button to support the author. You can also buy the author a cup of coffee.Thanks very much.:smiley:

# DEMO

[Demo APK download][5]

# License

Copyright 2023 litao

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.

[1]:https://github.com/litao0621/nifty-slider/wiki/Attribute&Method
[2]:https://github.com/litao0621/nifty-slider/wiki
[3]:https://github.com/litao0621/nifty-slider/blob/main/README-ZH.md
[5]:https://github.com/litao0621/nifty-slider/blob/main/art/sample-debug.apk