Snapping SeekBar

Android Library for creating a snapping seekbar

License

License

GroupId

GroupId

com.github.tobiasbuchholz
ArtifactId

ArtifactId

snappingseekbar
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

Snapping SeekBar
Android Library for creating a snapping seekbar
Project URL

Project URL

https://github.com/TobiasBuchholz/SnappingSeekBar
Source Code Management

Source Code Management

https://github.com/TobiasBuchholz/SnappingSeekBar

Download snappingseekbar

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

SnappingSeekBar

This is a sample app which contains my implementation of a snapping seek bar. If you build the project you can see some different seek bar examples which are all attached to the same OnItemSelectionListener.

##Demo You can also download the sample app in the Google Play Store: demo

qr code

##Features

  • create the seek bar from xml or from layout
  • the progress bar contains indicators and optional texts below those indicators
  • after releasing the thumb it snaps to the nearest indicator with an smooth animation
  • it is very customizable -> change drawables, colors, amount of items etc.
  • set up everything properly and the seek bar does the rest for you

##Usage

####In xml use the following attributes:

<com.tobishiba.SnappingSeekBarSample.views.SnappingSeekBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:progressDrawable="@drawable/apptheme_scrubber_progress_horizontal_holo_light"
    app:thumb="@drawable/apptheme_scrubber_control_selector_holo_light"
    app:progressColor="@color/blue"
    app:thumbnailColor="@color/blue_light"
    app:indicatorColor="@color/white"
    app:textIndicatorColor="@color/white"
    app:textSize="12dp"
    app:indicatorSize="12dp"
    app:itemsArrayId="@array/seek_bar_with_big_indicators_items"/> 


Most of the attributes have a default value, so the minimum setup looks like the following:
<com.tobishiba.SnappingSeekBarSample.views.SnappingSeekBar
    android:id="@+id/activity_main_seek_bar_without_texts"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:itemsAmount="5"/>

####From code it could look like this: ```java private SnappingSeekBar createSnappingSeekBarProgrammatically() { final SnappingSeekBar snappingSeekBar = new SnappingSeekBar(this); snappingSeekBar.setProgressDrawable(R.drawable.apptheme_scrubber_progress_horizontal_holo_light); snappingSeekBar.setThumbDrawable(R.drawable.apptheme_scrubber_control_selector_holo_light); snappingSeekBar.setItems(new String[]{"Wow", "such", "amazing"}); snappingSeekBar.setProgressColor(resources.getColor(R.color.green_darker)); snappingSeekBar.setThumbnailColor(resources.getColor(R.color.yellow_light)); snappingSeekBar.setTextIndicatorColor(resources.getColor(R.color.red_darker)); snappingSeekBar.setIndicatorColor(resources.getColor(R.color.green_light)); snappingSeekBar.setTextSize(14); snappingSeekBar.setIndicatorSize(14); snappingSeekBar.setOnItemSelectionListener(this); return snappingSeekBar; } ```
##Contribution If you would like to contribute to this project make sure you send pull request to dev branch or create an issue.

##Developed by

##License

Copyright 2014 Tobias Buchholz

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
1.0.1
1.0.0