本文整理汇总了Java中com.thebluealliance.spectrum.SpectrumDialog类的典型用法代码示例。如果您正苦于以下问题:Java SpectrumDialog类的具体用法?Java SpectrumDialog怎么用?Java SpectrumDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpectrumDialog类属于com.thebluealliance.spectrum包,在下文中一共展示了SpectrumDialog类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onClick
import com.thebluealliance.spectrum.SpectrumDialog; //导入依赖的package包/类
@Override
public void onClick(View view) {
int viewId = view.getId();
switch (viewId)
{
// Allow the user to select another color for the global color
case R.id.brush_color_button:
spectrumBuilder
.setSelectedColorRes(colorMap.get(currentGlobalColor))
.setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener() {
@Override
public void onColorSelected(boolean positiveResult, @ColorInt int color) {
currentGlobalColor = color;
}
}).build().show(getSupportFragmentManager(), "color_chooser_fragment");
break;
// Fill the grid with one color
case R.id.fill_button:
currentGrid.init(currentGlobalColor);
mAdapter.notifyDataSetChanged();
break;
}
}
开发者ID:Goodpie-zz,项目名称:LED-Visualizer,代码行数:25,代码来源:MainActivity.java
示例2: onClick
import com.thebluealliance.spectrum.SpectrumDialog; //导入依赖的package包/类
@Override
public void onClick(View v) {
new SpectrumDialog.Builder(getBaseContext())
.setColors(colorArray)
.setSelectedColor(kanboardColors.get(colorId != null ? colorId : defaultColor).getBackground())
.setDismissOnColorSelected(true)
.setTitle(R.string.taskedit_seclect_color)
.setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener() {
@Override
public void onColorSelected(boolean positiveResult, @ColorInt int color) {
if (positiveResult) {
Enumeration<String> iter = kanboardColors.keys();
while (iter.hasMoreElements()) {
String key = iter.nextElement();
if (kanboardColors.get(key).getBackground() == color) {
colorId = key;
break;
}
}
setButtonColor();
}
}
}).build().show(getSupportFragmentManager(), "color_dialog");
}
开发者ID:andresth,项目名称:Kandroid,代码行数:25,代码来源:TaskEditActivity.java
示例3: handlePaletteAction
import com.thebluealliance.spectrum.SpectrumDialog; //导入依赖的package包/类
/**
* When the user touch palette menu icon in order to change background color of the
* future CardView.
*/
private void handlePaletteAction() {
new SpectrumDialog.Builder(this)
.setColors(R.array.card_colors)
.setSelectedColor(this.selectedColor)
.setDismissOnColorSelected(true)
.setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener() {
@Override
public void onColorSelected(boolean positiveResult, @ColorInt int color) {
if (positiveResult) {
selectedColor = color;
mainLayout.setBackgroundColor(selectedColor);
}
}
}).build().show(getSupportFragmentManager(), "SpectrumDialog");
}
开发者ID:GrenderG,项目名称:TinyList,代码行数:21,代码来源:EditListActivity.java
示例4: showColorSelectionDialog
import com.thebluealliance.spectrum.SpectrumDialog; //导入依赖的package包/类
private void showColorSelectionDialog() {
new SpectrumDialog.Builder(getActivity())
.setColors(R.array.demo_colors)
.setDismissOnColorSelected(true)
.setOutlineWidth(2)
.setSelectedColor(sharedPrefStorage.getQodColor())
.setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener() {
@Override
public void onColorSelected(boolean positiveResult, @ColorInt int color) {
if (positiveResult) {
binding.circleImageViewTextColor.setFillColor(color);
sharedPrefStorage.setQodColor(color);
}
}
})
.build()
.show(getActivity().getSupportFragmentManager(), "dialog_demo_1");
}
开发者ID:mdilaveroglu,项目名称:Quoter-Android,代码行数:19,代码来源:SettingsFragment.java
示例5: launchColourPickerDialog
import com.thebluealliance.spectrum.SpectrumDialog; //导入依赖的package包/类
/**
* Launch the colour picker dialog using the Spectrum Colour picker
* https://github.com/the-blue-alliance/spectrum
*/
private void launchColourPickerDialog(Integer currentColour){
new SpectrumDialog.Builder(getApplicationContext())
.setColors(R.array.avatar_colours)
.setSelectedColor(currentColour)
.setDismissOnColorSelected(true)
.setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener() {
@Override public void onColorSelected(boolean positiveResult, @ColorInt int color) {
if (positiveResult) {
// Change the button colour to the selected colour.
GradientDrawable buttonBackgroundShape = (GradientDrawable) mPickAvatarColourButton.getBackground();
buttonBackgroundShape.setColor(color);
// Update the sCurrentAvatarColour
sCurrentAvatarColour = color;
}
}
}).build().show(getSupportFragmentManager(), COLOUR_PICKER_TAG);
}
开发者ID:ulternate,项目名称:nearby-chat,代码行数:22,代码来源:MainActivity.java
示例6: showColorDialog
import com.thebluealliance.spectrum.SpectrumDialog; //导入依赖的package包/类
private void showColorDialog() {
new SpectrumDialog.Builder(MainActivity.this)
.setColors(R.array.demo_colors)
.setOnColorSelectedListener(new SpectrumDialog.OnColorSelectedListener() {
@Override
public void onColorSelected(boolean positiveResult, @ColorInt int color) {
if (positiveResult) {
tintMediaRouterButtons(color);
}
}
}).build().show(getSupportFragmentManager(), "color_dialog");
}
开发者ID:andrei-egeniq,项目名称:android-tibits,代码行数:13,代码来源:MainActivity.java
注:本文中的com.thebluealliance.spectrum.SpectrumDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论