Skip to content

datalink747/ShiftColorPicker

 
 

Repository files navigation

##Simple vertical and horizontal color picker

Alt text

##Usage

Grab project from this repository (Maven/Gradle support coming soon)

Add view to your activity's layout and specify orientation:

   <uz.shift.colorpicker.LineColorPicker
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/picker"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        app:orientation="horizontal" />

Setup view

colorPicker = (LineColorPicker) findViewById(R.id.picker);

// set color palette
colorPicker.setColors(new int[] {Color.RED,Color.GREEN,Color.BLUE,Color.YELLOW});

// set selected color [optional]
colorPicker.setSelectedColor(Color.RED);

// set on change listener
colorPicker.setOnColorChangedListener(new OnColorChangedListener() {
			@Override
			public void onColorChanged(int c) {
				Log.d(TAG, "Selectede color " + Integer.toHexString(c));
			}
		});

// get selected color
int color = colorPicker.getColor();

##Downlaod ###Gradle

repositories {
    maven {
        url  "http://dl.bintray.com/dasar/ShiftColorPicker"
    }
}

###Releases page or grab latest version from repository.

##Requirements

Android 2.3 (Gingerbread) and later.

##Todo

  • Expand/collapse animations
  • More color pickers in different styles
  • rounded corners for line picker

##License

The MIT License (MIT)

Copyright (c) 2015 Bogdasarov Bogdan

About

Simple color picker view for Android

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%