com.flask.colorpicker.builder.ColorPickerClickListener Java Examples
The following examples show how to use
com.flask.colorpicker.builder.ColorPickerClickListener.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CustomThemeActivity.java From java-n-IDE-for-Android with Apache License 2.0 | 6 votes |
private void setColorForView(@IdRes final int id) { final View view = findViewById(id); int color = Color.WHITE; Drawable background = view.getBackground(); if (background instanceof ColorDrawable) color = ((ColorDrawable) background).getColor(); ColorPickerDialogBuilder.with(this) .showAlphaSlider(false) .initialColor(color) .setPositiveButton(android.R.string.ok, new ColorPickerClickListener() { @Override public void onClick(DialogInterface d, int lastSelectedColor, Integer[] allColors) { view.setBackgroundColor(lastSelectedColor); setColor(id, lastSelectedColor); } }) .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.cancel(); } }).build().show(); }
Example #2
Source File: ColorPickerPreference.java From java-n-IDE-for-Android with Apache License 2.0 | 6 votes |
@Override protected void onClick() { ColorPickerDialogBuilder builder = ColorPickerDialogBuilder .with(getContext()) .setTitle(pickerTitle) .initialColor(selectedColor) .wheelType(wheelType) .density(density) .setPositiveButton(pickerButtonOk, new ColorPickerClickListener() { @Override public void onClick(DialogInterface dialog, int selectedColorFromPicker, Integer[] allColors) { setValue(selectedColorFromPicker); } }) .setNegativeButton(pickerButtonCancel, null); if (!alphaSlider && !lightSlider) builder.noSliders(); else if (!alphaSlider) builder.lightnessSliderOnly(); else if (!lightSlider) builder.alphaSliderOnly(); builder .build() .show(); }
Example #3
Source File: ColorPickerPreference.java From timecat with Apache License 2.0 | 6 votes |
@Override protected void onClick() { ColorPickerDialogBuilder builder = ColorPickerDialogBuilder .with(getContext()) .setTitle(pickerTitle) .initialColor(selectedColor) .wheelType(wheelType) .density(density) .setPositiveButton(pickerButtonOk, new ColorPickerClickListener() { @Override public void onClick(DialogInterface dialog, int selectedColorFromPicker, Integer[] allColors) { setValue(selectedColorFromPicker); } }) .setNegativeButton(pickerButtonCancel, null); if (!alphaSlider && !lightSlider) builder.noSliders(); else if (!alphaSlider) builder.lightnessSliderOnly(); else if (!lightSlider) builder.alphaSliderOnly(); builder .build() .show(); }
Example #4
Source File: ColorPickerPreference.java From javaide with GNU General Public License v3.0 | 6 votes |
@Override protected void onClick() { ColorPickerDialogBuilder builder = ColorPickerDialogBuilder .with(getContext()) .setTitle(pickerTitle) .initialColor(selectedColor) .wheelType(wheelType) .density(density) .setPositiveButton(pickerButtonOk, new ColorPickerClickListener() { @Override public void onClick(DialogInterface dialog, int selectedColorFromPicker, Integer[] allColors) { setValue(selectedColorFromPicker); } }) .setNegativeButton(pickerButtonCancel, null); if (!alphaSlider && !lightSlider) builder.noSliders(); else if (!alphaSlider) builder.lightnessSliderOnly(); else if (!lightSlider) builder.alphaSliderOnly(); builder .build() .show(); }
Example #5
Source File: ColorPickerPreference.java From openlauncher with Apache License 2.0 | 6 votes |
@Override protected void onClick() { ColorPickerDialogBuilder builder = ColorPickerDialogBuilder .with(getContext()) .setTitle(pickerTitle) .initialColor(selectedColor) .showBorder(border) .wheelType(wheelType) .density(density) .showColorEdit(pickerColorEdit) .setPositiveButton(pickerButtonOk, new ColorPickerClickListener() { @Override public void onClick(DialogInterface dialog, int selectedColorFromPicker, Integer[] allColors) { setValue(selectedColorFromPicker); } }) .setNegativeButton(pickerButtonCancel, null); if (!alphaSlider && !lightSlider) builder.noSliders(); else if (!alphaSlider) builder.lightnessSliderOnly(); else if (!lightSlider) builder.alphaSliderOnly(); builder .build() .show(); }
Example #6
Source File: ColorSearchActivity.java From droidddle with Apache License 2.0 | 6 votes |
@OnClick(R.id.color_picker) void onPickColorClick(View view) { ColorPickerDialogBuilder.with(this) .setTitle(getString(R.string.pick_color_title)) .initialColor(getIntColor()) .wheelType(ColorPickerView.WHEEL_TYPE.FLOWER) .density(12) .lightnessSliderOnly() .setPositiveButton(getString(android.R.string.ok), new ColorPickerClickListener() { @Override public void onClick(DialogInterface d, int lastSelectedColor, Integer[] allColors) { mQuery = String.format("%06X", 0xFFFFFF & lastSelectedColor); updateColor(); } }) .setNegativeButton(getString(android.R.string.cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }) .build().show(); }
Example #7
Source File: ColorPickerPreference.java From droidddle with Apache License 2.0 | 6 votes |
@Override protected void onClick() { ColorPickerDialogBuilder builder = ColorPickerDialogBuilder .with(getContext()) .setTitle(pickerTitle) .initialColor(selectedColor) .wheelType(wheelType) .density(density) .setPositiveButton(pickerButtonOk, new ColorPickerClickListener() { @Override public void onClick(DialogInterface dialog, int selectedColorFromPicker, Integer[] allColors) { setValue(selectedColorFromPicker); } }) .setNegativeButton(pickerButtonCancel, null); if (!alphaSlider && !lightSlider) builder.noSliders(); else if (!alphaSlider) builder.lightnessSliderOnly(); else if (!lightSlider) builder.alphaSliderOnly(); builder .build() .show(); }