Skip to content

A colorful SeekBar for picking color. Updated the original one for more features.

Notifications You must be signed in to change notification settings

NehaParmar/ColorSeekBar

 
 

Repository files navigation

#ColorSeekBar

ScreenShot:

Attrs

attr format default
colors references
colorBarValue integer 0
alphaBarValue integer 0
maxValue integer 100
bgColor color TRANSPARENT
barHeight dimension 2dp
barMargin dimension 5dp
thumbHeight dimension 30dp
showAlphaBar boolean false

Gradle:

Release API Android Arsenal

Step 1. Add the JitPack repository in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

  compile 'com.github.rtugeek:ColorSeekBar:1.0.1'

Usage

XML

  <com.rtugeek.android.colorseekbar.ColorSeekBar
      android:id="@+id/colorSlider"
      android:layout_width="match_parent"
      app:colors="@array/material_colors"
      android:layout_height="wrap_content" />

JAVA

  colorSeekBar.setMaxValue(100);
  colorSeekBar.setColors(R.array.material_colors); // material_colors is defalut included in res/color,just use it.
  colorSeekBar.setColorBarValue(10); //0 - maxValue
  colorSeekBar.setAlphaBarValue(10); //0-255
  colorSeekBar.setShowAlphaBar(true); 
  colorSeekBar.setBarHeight(5); //5dpi 
  colorSeekBar.setThumbHeight(30); //30dpi
  colorSeekBar.setBarMargin(10); //set the margin between colorBar and alphaBar 10dpi

Listener

  colorSeekBar.setOnColorChangeListener(new ColorSeekBar.OnColorChangeListener() {
            @Override
            public void onColorChangeListener(int colorBarValue, int alphaBarValue, int color) {
                textView.setTextColor(color);
            }
  });

Spread the word

License

        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                Version 2, December 2004

Copyright (C) 2004 Leon Fu <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.

About

A colorful SeekBar for picking color. Updated the original one for more features.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%