当前位置: 首页>>代码示例>>Java>>正文


Java ColorPickerDialogBuilder类代码示例

本文整理汇总了Java中com.flask.colorpicker.builder.ColorPickerDialogBuilder的典型用法代码示例。如果您正苦于以下问题:Java ColorPickerDialogBuilder类的具体用法?Java ColorPickerDialogBuilder怎么用?Java ColorPickerDialogBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ColorPickerDialogBuilder类属于com.flask.colorpicker.builder包,在下文中一共展示了ColorPickerDialogBuilder类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setColorForViews

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
public void setColorForViews(final String key) {
    ColorPickerDialogBuilder
            .with(getContext())
            .setTitle("Выберите цвет")
            .initialColor(R.color.colorPrimary)
            .wheelType(ColorPickerView.WHEEL_TYPE.FLOWER)
            .density(12)
            .setOnColorSelectedListener(selectedColor -> {
            })
            .setPositiveButton("Ок", (dialog, selectedColor, allColors) -> {
                setColorValue(selectedColor);
                putIntValueInSharedPreference(getPref(), getContext(), key, getColorValue());
            })
            .setNegativeButton("Отмена", (dialog, which) -> {
            })
            .build()
            .show();
}
 
开发者ID:Existentio,项目名称:OddLauncher,代码行数:19,代码来源:SettingsHelper.java

示例2: onClick

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
@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();
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:26,代码来源:ColorPickerPreference.java

示例3: setColorForView

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
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();
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:26,代码来源:CustomThemeActivity.java

示例4: onPickColorClick

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
@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();
}
 
开发者ID:goodev,项目名称:droidddle,代码行数:24,代码来源:ColorSearchActivity.java

示例5: onClick

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
@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();
}
 
开发者ID:goodev,项目名称:droidddle,代码行数:26,代码来源:ColorPickerPreference.java

示例6: createColorPickerDialog

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
public void createColorPickerDialog(int initialColor, ColorPickerClickListener onResult) {
    ColorPickerDialogBuilder
            .with(getContext())
            .initialColor(initialColor)
            .showAlphaSlider(false)
            .wheelType(ColorPickerView.WHEEL_TYPE.CIRCLE)
            .density(5)
            .setPositiveButton(getString(R.string.done), onResult)
            .build()
            .show();

}
 
开发者ID:dan-silver,项目名称:cast-dashboard-android-app,代码行数:13,代码来源:AppSettingsHelperFragment.java

示例7: showColorPickerDialog

import com.flask.colorpicker.builder.ColorPickerDialogBuilder; //导入依赖的package包/类
/**
 * Show a cool color picker to customize a user's flag color.
 */
private void showColorPickerDialog() {
    int currentBackgroundColor = mFlagColor;
    ColorPickerDialogBuilder
            .with(this)
            .setTitle(getString(R.string.choose_flag_color))
            .initialColor(currentBackgroundColor)
            .wheelType(ColorPickerView.WHEEL_TYPE.FLOWER)
            .density(12)
            .setOnColorSelectedListener(this::setFlagColor)
            .setPositiveButton("ok", (dialog, selectedColor, allColors) -> setFlagColor(selectedColor))
            .noSliders()
            .build()
            .show();
}
 
开发者ID:BloopApp,项目名称:Bloop,代码行数:18,代码来源:FlagCreationActivity.java


注:本文中的com.flask.colorpicker.builder.ColorPickerDialogBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。