Giter Club home page Giter Club logo

range-seek-bar's Introduction

RangeSeekBar

The missing view for android.

Android Arsenal

Screenshot

Usage

First add jitpack to your projects build.gradle file

allprojects {
   	repositories {
   		...
   		maven { url "https://jitpack.io" }
   	}
}

Then add the dependency in your android app module's build.gradle file.

If you are upgrading from a previous version, please take a look at changelogs to make sure nothing will break.

dependencies {
    implementation 'com.github.Innovattic:range-seek-bar:v1.0.6'
}

Then use the view in your layouts:

<com.innovattic.rangeseekbar.RangeSeekBar
    android:id="@+id/rangeSeekBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorAccent" />

Attributes

You can change view attributes directly from your layout's xml file or in your java/kotlin code:

Variable / Function XML Attribute Type Description
trackColor rsb_trackColor color Color of horizontal track
trackSelectedColor rsb_trackSelectedColor color Color of the selected range of horizontal track
trackThickness rsb_trackThickness dimension The thickness of the horizontal track
trackSelectedThickness rsb_trackSelectedThickness dimension The thickness of the selected range of horizontal track
sidePadding rsb_sidePadding dimension Side padding for view, by default 16dp on the left and right
touchRadius rsb_touchRadius dimension The acceptable touch radius around thumbs in pixels
minThumbOffset rsb_minThumbOffsetVertical dimension Vertical offset of min thumb
minThumbOffset rsb_minThumbOffsetHorizontal dimension Horizontal offset of min thumb
maxThumbOffset rsb_maxThumbOffsetVertical dimension Vertical offset of max thumb
maxThumbOffset rsb_maxThumbOffsetHorizontal dimension Horizontal offset of max thumb
minThumbDrawable rsb_minThumbDrawable reference The drawable to draw min thumb with
maxThumbDrawable rsb_maxThumbDrawable reference The drawable to draw max thumb with
minRange rsb_minRange integer The minimum range to be selected. It should at least be 1
max rsb_max integer The maximum value of thumbs which can also be considered as the maximum possible range
trackRoundedCaps rsb_trackRoundedCaps boolean If the track should have rounded caps.
trackSelectedRoundedCaps rsb_trackSelectedRoundedCaps boolean If the selected range track should have rounded caps.
setMinThumbValue(integer) rsb_initialMinThumbValue integer Value of min thumb
setMaxThumbValue(integer) rsb_initialMaxThumbValue integer Value of max thumb

Changelogs

  • v1.0.6:
    • Fixed ScrollView stealing focus issue. (#4)
    • Added xml attributes to set initial values of min and max thumbs. (#9)
  • v1.0.5: Converted thumb position offset attributes to dimensions instead of integer
  • v1.0.4: Added option to make tracks have rounded caps
  • v1.0.3: AndroidX support
  • v1.0.2: Added the option to offset the thumb drawables.
  • v1.0.1: Made the RangeSeekBar class, open

range-seek-bar's People

Contributors

clzola avatar mirrajabi avatar siper avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.