Simple, lightweight and customizable color picker dialog for your android app.
- Place color_picker_dialog.xml in your layout folder.
- Place ColorPickerDialog.java in your java folder.
- Change package name in ColorPickerDialog.java to your app package.
- Open the color picker dialog
ColorPickerDialog dialog = new ColorPickerDialog(initialColor);
dialog.show(getSupportFragmentManager(), "Color Picker");
- Implement listener
public class YourActivity extends AppCompatActivity implements ColorPickerDialog.setColorPickerListener {
@Override
public void applyColor(int color) {
//use this 'color' value in your code
yourFunction(color);
}
}