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


Java LobsterShadeSlider类代码示例

本文整理汇总了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();
}
 
开发者ID:kizitonwose,项目名称:colorpreference,代码行数:26,代码来源:PreferenceCompatActivity.java

示例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();
}
 
开发者ID:kizitonwose,项目名称:colorpreference,代码行数:26,代码来源:PreferenceActivity.java

示例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();
}
 
开发者ID:danvratil,项目名称:FBEventSync,代码行数:28,代码来源:SettingsActivity.java


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