Skip to content

veritas1/vertical-slide-color-picker

Repository files navigation

Vertical Slide Color Picker

Demo gif

Example usage

layout.xml

<com.github.veritas1.verticalslidecolorpicker.VerticalSlideColorPicker
		android:id="@+id/color_picker"
		android:layout_width="30dp"
		android:layout_height="100dp"
		colorpicker:borderColor="@android:color/black"
		colorpicker:borderWidth="2dp"
		colorpicker:colors="@array/my_color_array"/>

Activity.java

final VerticalSlideColorPicker colorPicker = (VerticalSlideColorPicker) findViewById(R.id.color_picker);
final View selectedColorView = findViewById(R.id.selected_color);

colorPicker.setOnColorChangeListener(new VerticalSlideColorPicker.OnColorChangeListener() {
	@Override
	public void onColorChange(int selectedColor) {
		selectedColorView.setBackgroundColor(selectedColor);
	}
});

Add to project

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}
dependencies {
	compile 'com.github.veritas1:verticalslidecolorpicker:$VERSION' // Check releases
}

About

🦁 Vertical slide color picker for Android

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages