@Override
 public void onClick(View v) {
   ColorPickerDialog picker = new ColorPickerDialog(getContext(), getColor());
   picker.setOnColorChangedListener(this);
   if (mAlphaSliderEnabled) {
     picker.setAlphaSliderVisible(true);
   }
   picker.show();
 }
Exemple #2
0
  /**
   * 色選択
   *
   * @param v
   */
  public void clickButton_Color(View v) {

    ColorPickerDialog colorPickerDialog;

    // 色選択ダイアログ
    colorPickerDialog = new ColorPickerDialog(this, selectColor);
    colorPickerDialog.setOnColorChangedListener(
        new ColorPickerDialog.OnColorChangedListener() {
          @Override
          public void onColorChanged(int color) {
            selectColor = color;
            imageButton.setBackgroundColor(color);
          }
        });

    colorPickerDialog.show();
  }