本文整理汇总了Java中com.android.colorpicker.ColorPickerSwatch类的典型用法代码示例。如果您正苦于以下问题:Java ColorPickerSwatch类的具体用法?Java ColorPickerSwatch怎么用?Java ColorPickerSwatch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColorPickerSwatch类属于com.android.colorpicker包,在下文中一共展示了ColorPickerSwatch类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clickColorPickerButton
import com.android.colorpicker.ColorPickerSwatch; //导入依赖的package包/类
@OnClick(R.id.colorPickerButton)
public void clickColorPickerButton() {
dialog = new ColorPickerDialog();
dialog.setOnColorSelectedListener(new ColorPickerSwatch.OnColorSelectedListener() {
@Override
public void onColorSelected(int color) {
noteColors.setBarStatusColor(color);
setLayoutColors(color, noteColors.getBarColor(), noteColors.getStatusColor());
}
});
dialog.initialize(R.string.color_picker_title, colors, Color.WHITE, 3, colors.length);
dialog.show(getFragmentManager(), "tag");
}
示例2: showDialog
import com.android.colorpicker.ColorPickerSwatch; //导入依赖的package包/类
public static void showDialog(Context context, FragmentManager fragmentManager, ColorPickerSwatch.OnColorSelectedListener onSelected) {
ColorPickerDialog colorcalendar = ColorPickerDialog.newInstance(
R.string.color_picker_default_title,
colorChoice(context), 0, 3,
ColorPickerDialog.SIZE_SMALL);
colorcalendar.show(fragmentManager,"cal");
colorcalendar.setOnColorSelectedListener(onSelected);
}