Skip to content

Repository files navigation

ColorPickerDialog JCenter

A custom Dialog using for color picking.(Android Ice Cream Sandwich:API level 14)

##Download

  • Gradle:
dependencies {
compile'com.mummyding.view:colorpickerdialog:1.0.0'
}
  • Download Directly

colorpickerdialog-1.0.0.aar

##Usage

  • Baisc Data
// colors you want to add,colors must not be null!!!int [] colors = newint[]{Color.YELLOW,Color.BLACK,Color.BLUE,Color.GRAY,
Color.GREEN,Color.CYAN,Color.RED,Color.DKGRAY, Color.LTGRAY,Color.MAGENTA,
Color.rgb(100,22,33),Color.rgb(82,182,2), Color.rgb(122,32,12),Color.rgb(82,12,2),
Color.rgb(89,23,200),Color.rgb(13,222,23), Color.rgb(222,22,2),Color.rgb(2,22,222)};
  • Create Demo
ColorPickerDialogdialog =
// Constructor,the first argv is Context,second one is the colors you want to addnewColorPickerDialog(this,colors)
// Optional, if you want the dialog dismissed after picking,set it to true,otherwise// false. default true
.setDismissAfterClick(false)
// Optional, Dialog's title,default "Theme"
.setTitle("Custom Theme")
//Optional, current checked color
.setCheckedColor(Color.BLACK)
.setOnColorChangedListener(newOnColorChangedListener() {
@OverridepublicvoidonColorChanged(intnewColor) {
// do something hereToast.makeText(getApplicationContext(),"Color "+newColor,Toast.LENGTH_SHORT).show();
}})
// build Dialog,argv means width count of Dialog,default value is 4 if you use build() // without argv
.build(6)
.show();
  • Simple Usage
ColorPickerDialogdialog =
// Constructor,the first argv is Context,second one is the colors you want to addnewColorPickerDialog(this,colors)
.setOnColorChangedListener(newOnColorChangedListener() {
@OverridepublicvoidonColorChanged(intnewColor) {
// do something hereToast.makeText(getApplicationContext(),"Color "+newColor,Toast.LENGTH_SHORT).show();
}})
.build()
.show();

##Screenshots

About

A custom Dialog using for color picking.

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages