All Projects → Chrisvin → Rubberpicker

Chrisvin / Rubberpicker

Licence: mit
Android Rubber Picker Library

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Rubberpicker

Protractorview
A semicircular seekbar view for selecting angle from 0° to 180° ✨
Stars: ✭ 204 (-56.5%)
Mutual labels:  library, seekbar
Emojislider
🤯 A slider widget rich in emoji and highly customisable.
Stars: ✭ 549 (+17.06%)
Mutual labels:  library, seekbar
Graph
Graph algorithms and data structures
Stars: ✭ 431 (-8.1%)
Mutual labels:  library
Chat Api
WhatsApp's Private API
Stars: ✭ 4,251 (+806.4%)
Mutual labels:  library
Lambdahack
Haskell game engine library for roguelike dungeon crawlers; please offer feedback, e.g., after trying out the sample game with the web frontend at
Stars: ✭ 439 (-6.4%)
Mutual labels:  library
Create React Library
⚡CLI for creating reusable react libraries.
Stars: ✭ 4,554 (+871%)
Mutual labels:  library
Cordova Plugin Whitelist
Apache Cordova plugin whitelist
Stars: ✭ 442 (-5.76%)
Mutual labels:  library
Cpp Base64
base64 encoding and decoding with c++
Stars: ✭ 429 (-8.53%)
Mutual labels:  library
Sleepy Discord
C++ library for the Discord chat client
Stars: ✭ 459 (-2.13%)
Mutual labels:  library
Candybar Library
Android icon pack material dashboard
Stars: ✭ 437 (-6.82%)
Mutual labels:  library
React Native Vision Camera
📸 The Camera library that sees the vision.
Stars: ✭ 443 (-5.54%)
Mutual labels:  library
Pyrlang
Erlang node implemented in Python 3.5+ (Asyncio-based)
Stars: ✭ 436 (-7.04%)
Mutual labels:  library
Globjects
C++ library strictly wrapping OpenGL objects.
Stars: ✭ 431 (-8.1%)
Mutual labels:  library
Ivi
🔥 Javascript (TypeScript) library for building web user interfaces
Stars: ✭ 445 (-5.12%)
Mutual labels:  library
Android Verticalseekbar
Vertical SeekBar class which supports Android 4.x - 9.x.
Stars: ✭ 431 (-8.1%)
Mutual labels:  seekbar
Certificationy
The core library to create tests and certifications
Stars: ✭ 457 (-2.56%)
Mutual labels:  library
Jsstore
A complete IndexedDB wrapper with SQL like syntax.
Stars: ✭ 430 (-8.32%)
Mutual labels:  library
Android Dev Sources
All those Android development sources that you need to be and stay awesome!
Stars: ✭ 434 (-7.46%)
Mutual labels:  library
Ponder
C++ reflection library with Lua binding, and JSON and XML serialisation.
Stars: ✭ 442 (-5.76%)
Mutual labels:  library
Tempfile
Temporary file library for rust
Stars: ✭ 467 (-0.43%)
Mutual labels:  library

RubberPicker

License: MIT API Android Arsenal

RubberPicker library contains the RubberSeekBar and RubberRangePicker, inspired by Cuberto's rubber-range-picker.

Getting started

Setting up the dependency

  1. Add the JitPack repository to your root build.gradle at the end of repositories:
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  1. Add the RubberPicker dependency in the build.gradle:
implementation 'com.github.Chrisvin:RubberPicker:v1.5'

Demo app

To run the demo project, clone the repository and run it via Android Studio.

Usage

Adding directly in layout.xml

<com.jem.rubberpicker.RubberSeekBar
  ...
  app:minValue="20"
  app:maxValue="80"
  app:elasticBehavior="cubic"
  app:dampingRatio="0.3"
  app:stiffness="300"
  app:stretchRange="24dp"
  app:defaultThumbRadius="16dp"
  app:normalTrackWidth="4dp"
  app:highlightTrackWidth="8dp"
  app:normalTrackColor="#AAAAAA"
  app:highlightTrackColor="#BA1F33"
  app:defaultThumbInsideColor="#FFF"
  app:highlightDefaultThumbOnTouchColor="#CD5D67"/>

<!-- Similar attributes can be applied for RubberRangePicker as well-->
<com.jem.rubberpicker.RubberRangePicker
  ...
  app:minValue="0"
  app:maxValue="100"
  app:elasticBehavior="linear"
  app:dampingRatio="0.4"
  app:stiffness="400"
  app:stretchRange="36dp"
  app:defaultThumbRadius="16dp"
  app:normalTrackWidth="4dp"
  app:highlightTrackWidth="8dp"
  app:normalTrackColor="#AAAAAA"
  app:highlightTrackColor="#BA1F33"
  app:defaultThumbInsideColor="#CFCD5D67"
  app:highlightDefaultThumbOnTouchColor="#CD5D67"/>

Adding/Modifying programmatically

val rubberSeekBar = RubberSeekBar(this)
rubberSeekBar.setMin(20)
rubberSeekBar.setMax(80)
rubberSeekBar.setElasticBehavior(ElasticBehavior.CUBIC)
rubberSeekBar.setDampingRatio(0.4F)
rubberSeekBar.setStiffness(1000F)
rubberSeekBar.setStretchRange(50f)
rubberSeekBar.setThumbRadius(32f)
rubberSeekBar.setNormalTrackWidth(2f)
rubberSeekBar.setHighlightTrackWidth(4f)
rubberSeekBar.setNormalTrackColor(Color.GRAY)
rubberSeekBar.setHighlightTrackColor(Color.BLUE)
rubberSeekBar.setHighlightThumbOnTouchColor(Color.CYAN)
rubberSeekBar.setDefaultThumbInsideColor(Color.WHITE)

val currentValue = rubberSeekBar.getCurrentValue()
rubberSeekBar.setCurrentValue(currentValue + 10)
rubberSeekBar.setOnRubberSeekBarChangeListener(object : RubberSeekBar.OnRubberSeekBarChangeListener {
    override fun onProgressChanged(seekBar: RubberSeekBar, value: Int, fromUser: Boolean) {}
    override fun onStartTrackingTouch(seekBar: RubberSeekBar) {}
    override fun onStopTrackingTouch(seekBar: RubberSeekBar) {}
})


//Similarly for RubberRangePicker
val rubberRangePicker = RubberRangePicker(this)
rubberRangePicker.setMin(20)
...
rubberRangePicker.setHighlightThumbOnTouchColor(Color.CYAN)

val startThumbValue = rubberRangePicker.getCurrentStartValue()
rubberRangePicker.setCurrentStartValue(startThumbValue + 10)
val endThumbValue = rubberRangePicker.getCurrentEndValue()
rubberRangePicker.setCurrentEndValue(endThumbValue + 10)
rubberRangePicker.setOnRubberRangePickerChangeListener(object: RubberRangePicker.OnRubberRangePickerChangeListener{
    override fun onProgressChanged(rangePicker: RubberRangePicker, startValue: Int, endValue: Int, fromUser: Boolean) {}
    override fun onStartTrackingTouch(rangePicker: RubberRangePicker, isStartThumb: Boolean) {}
    override fun onStopTrackingTouch(rangePicker: RubberRangePicker, isStartThumb: Boolean) {}
})

Todo

  • [ ] Refactor code to remove redundant code between RubberSeekBar & RubberRangePicker.
  • [ ] Add step attribute, make necessary UI adjustments for step based value increments.
  • [ ] Current library overcomes view clipping by setting the parent layout's clipChildren & clipToPadding as false. Find a better alternative to overcome view clipping.

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

License

MIT License

Copyright (c) 2019 Jem

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].