Giter Club home page Giter Club logo

colorpickerseekbar's Introduction

ColorPickerSeekBar

ColorPickerSeekBar is an extension of SeekBar Android Widget for choosing a color. User can touch the thumb and drag left or right to set the color.

This github repo contains 2 modules

  1. ColorPickerSeekBar (com.ak.android.widget.colorpickerseekbar) which is an Android Library
  2. ColorPickerSampleApp - A sample app showing how to use the above library

Setup

The library is now only compatible with Gradle out of the box. To use this library in your project, either:
  • Add the dependency from Maven: compile 'com.github.avinashkolluru.colorpickerseekbar:library:1.0-SNAPSHOT'. You'll also need to add the Sonatype snapshots repository to your repositories {} tag:
repositories {
    mavenCentral()
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots'
    }
}
  • Copy the library project(ColorPickerSeekBar) into your Gradle project. In your settings.gradle, add the project (using the include (':ColorPickerSeekBar') notation) and add a dependency to the library module in your app. Sync Gradle and then go ahead!

Usage

To use the ColorPickerSeekBar all you have to do is import the library, add it as a dependency and define the view
 <com.ak.android.widget.colorpickerseekbar.ColorPickerSeekBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/colorpicker"/>

To receive color change events when the user drags along the seekbar register a ColorPickerSeekBar.OnColorSeekBarChangeListener


colorPickerSeekBar.setOnColorSeekbarChangeListener(new ColorPickerSeekBar.OnColorSeekBarChangeListener() {
            @Override
            public void onColorChanged(SeekBar seekBar, int color, boolean fromUser) {
                view.setBackgroundColor(color);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });

colorpickerseekbar's People

Contributors

avinashkolluru avatar

Watchers

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