Giter VIP home page Giter VIP logo

snappingseekbar's Introduction

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.

snappingseekbar's People

Contributors

tobiasbuchholz 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.