本文整理汇总了Java中com.larswerkman.lobsterpicker.sliders.LobsterShadeSlider类的典型用法代码示例。如果您正苦于以下问题:Java LobsterShadeSlider类的具体用法?Java LobsterShadeSlider怎么用?Java LobsterShadeSlider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LobsterShadeSlider类属于com.larswerkman.lobsterpicker.sliders包,在下文中一共展示了LobsterShadeSlider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showColorDialog
import com.larswerkman.lobsterpicker.sliders.LobsterShadeSlider; //导入依赖的package包/类
private void showColorDialog(final Preference preference) {
LayoutInflater inflater = getActivity().getLayoutInflater();
View colorView = inflater.inflate(R.layout.dialog_color, null);
int color = PreferenceManager.getDefaultSharedPreferences(getActivity()).getInt(CUSTOM_PICKER_PREF_KEY, Color.YELLOW);
final LobsterPicker lobsterPicker = colorView.findViewById(R.id.lobsterPicker);
LobsterShadeSlider shadeSlider = colorView.findViewById(R.id.shadeSlider);
lobsterPicker.addDecorator(shadeSlider);
lobsterPicker.setColorHistoryEnabled(true);
lobsterPicker.setHistory(color);
lobsterPicker.setColor(color);
new AlertDialog.Builder(getActivity())
.setView(colorView)
.setTitle("Choose Color")
.setPositiveButton("SAVE", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
((ColorPreferenceCompat) preference).setValue(lobsterPicker.getColor());
}
})
.setNegativeButton("CLOSE", null)
.show();
}
示例2: showColorDialog
import com.larswerkman.lobsterpicker.sliders.LobsterShadeSlider; //导入依赖的package包/类
private void showColorDialog(final Preference preference) {
LayoutInflater inflater = getActivity().getLayoutInflater();
View colorView = inflater.inflate(R.layout.dialog_color, null);
int color = PreferenceManager.getDefaultSharedPreferences(getActivity()).getInt(CUSTOM_PICKER_PREF_KEY, Color.YELLOW);
final LobsterPicker lobsterPicker = (LobsterPicker) colorView.findViewById(R.id.lobsterPicker);
LobsterShadeSlider shadeSlider = (LobsterShadeSlider) colorView.findViewById(R.id.shadeSlider);
lobsterPicker.addDecorator(shadeSlider);
lobsterPicker.setColorHistoryEnabled(true);
lobsterPicker.setHistory(color);
lobsterPicker.setColor(color);
new AlertDialog.Builder(getActivity())
.setView(colorView)
.setTitle("Choose Color")
.setPositiveButton("SAVE", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
((ColorPreference) preference).setValue(lobsterPicker.getColor());
}
})
.setNegativeButton("CLOSE", null)
.show();
}
示例3: showColorDialog
import com.larswerkman.lobsterpicker.sliders.LobsterShadeSlider; //导入依赖的package包/类
private void showColorDialog(String key, final Preference preference) {
LayoutInflater inflater = getActivity().getLayoutInflater();
@SuppressLint("InflateParams")
View colorView = inflater.inflate(R.layout.color_dialog, null);
int color = PreferenceManager.getDefaultSharedPreferences(getActivity())
.getInt(key, getResources().getColor(R.color.colorFBBlue));
final LobsterPicker lobsterPicker = colorView.findViewById(R.id.colordialog_lobsterpicker);
LobsterShadeSlider shadeSlider = colorView.findViewById(R.id.colordialog_shadeslider);
lobsterPicker.addDecorator(shadeSlider);
lobsterPicker.setColorHistoryEnabled(true);
lobsterPicker.setHistory(color);
lobsterPicker.setColor(color);
new AlertDialog.Builder(getActivity())
.setView(colorView)
.setTitle(getString(R.string.color_dlg_title))
.setPositiveButton(getString(R.string.color_dlg_save_btn_title), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
((ColorPreference) preference).setValue(lobsterPicker.getColor());
}
})
.setNegativeButton(getString(R.string.color_dlg_close_btn_title), null)
.show();
}