• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ColorMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: launchTintColourPicker

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
public void launchTintColourPicker(View v) {
    if (((CheckBox)v).isChecked()) {
        new ChromaDialog.Builder()
                .initialColor(Color.GREEN)
                .colorMode(ColorMode.ARGB) // RGB, ARGB, HVS, CMYK, CMYK255, HSL
                .indicatorMode(IndicatorMode.HEX) //HEX or DECIMAL; Note that (HSV || HSL || CMYK) && IndicatorMode.HEX is a bad idea
                .onColorSelected(new OnColorSelectedListener() {
                    @Override
                    public void onColorSelected(@ColorInt int color) {
                        tintColour = color;
                        findViewById(R.id.iconTint).setBackgroundColor(color);
                    }
                })
                .create()
                .show(getSupportFragmentManager(), "ChromaDialog");
    } else {
        findViewById(R.id.iconTint).setBackgroundColor(ContextCompat.getColor(this, android.R.color.transparent));
    }
}
 
开发者ID:JakeSteam,项目名称:Vidsta,代码行数:20,代码来源:MainActivity.java


示例2: launchTextColourPicker

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
public void launchTextColourPicker(View v) {
    if (((CheckBox)v).isChecked()) {
        new ChromaDialog.Builder()
                .initialColor(Color.GREEN)
                .colorMode(ColorMode.ARGB) // RGB, ARGB, HVS, CMYK, CMYK255, HSL
                .indicatorMode(IndicatorMode.HEX) //HEX or DECIMAL; Note that (HSV || HSL || CMYK) && IndicatorMode.HEX is a bad idea
                .onColorSelected(new OnColorSelectedListener() {
                    @Override
                    public void onColorSelected(@ColorInt int color) {
                        textColour = color;
                        findViewById(R.id.textColour).setBackgroundColor(color);
                    }
                })
                .create()
                .show(getSupportFragmentManager(), "ChromaDialog");
    } else {
        findViewById(R.id.textColour).setBackgroundColor(ContextCompat.getColor(this, android.R.color.transparent));
    }
}
 
开发者ID:JakeSteam,项目名称:Vidsta,代码行数:20,代码来源:MainActivity.java


示例3: showColorSelectionInput

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
@Override
public void showColorSelectionInput(
        String key,
        CharSequence title,
        int defaultColor,
        final Listener<Integer> colorListener) {
    FragmentActivity activity;
    try {
        activity = (FragmentActivity) context;
    } catch (ClassCastException exc) {
        throw new AssertionError(context.getString(R.string.exc_not_frag_activity_subclass));
    }
    String tag = colorListener.getClass().getSimpleName();
    new ChromaDialog.Builder()
            .initialColor(defaultColor)
            .colorMode(ColorMode.ARGB)
            .indicatorMode(IndicatorMode.HEX)
            .onColorSelected(new OnColorSelectedListener() {
                @Override
                public void onColorSelected(int color) {
                    colorListener.onInput(color);
                }
            })
            .create()
            .show(activity.getSupportFragmentManager(), tag);
}
 
开发者ID:yarolegovich,项目名称:MaterialPreferences,代码行数:27,代码来源:StandardUserInputModule.java


示例4: makeArgs

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
private static Bundle makeArgs(@ColorInt int initialColor, ColorMode colorMode, IndicatorMode indicatorMode) {
    Bundle args = new Bundle();
    args.putInt(ARG_INITIAL_COLOR, initialColor);
    args.putInt(ARG_COLOR_MODE_ID, colorMode.ordinal());
    args.putInt(ARG_INDICATOR_MODE, indicatorMode.ordinal());
    return args;
}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:8,代码来源:ChromaDialogFixed.java


示例5: onClick

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
@Override
public void onClick(final View view) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(TwistyTimer.getAppContext());
    final SharedPreferences.Editor editor = sp.edit();
    String currentHex = "FFFFFF";
    switch (view.getId()) {
        case R.id.top:
            currentHex = sp.getString("cubeTop", "FFFFFF");
            break;
        case R.id.left:
            currentHex = sp.getString("cubeLeft", "FF8B24");
            break;
        case R.id.front:
            currentHex = sp.getString("cubeFront", "02D040");
            break;
        case R.id.right:
            currentHex = sp.getString("cubeRight", "EC0000");
            break;
        case R.id.back:
            currentHex = sp.getString("cubeBack", "304FFE");
            break;
        case R.id.down:
            currentHex = sp.getString("cubeDown", "FDD835");
            break;
    }

    new ChromaDialogFixed.Builder()
            .initialColor(Color.parseColor("#" + currentHex))
            .colorMode(ColorMode.RGB)
            .indicatorMode(IndicatorMode.HEX)
            .onColorSelected(new OnColorSelectedListener() {
                @Override
                public void onColorSelected(@ColorInt int color) {
                    String hexColor = Integer.toHexString(color).toUpperCase().substring(2);
                    switch (view.getId()) {
                        case R.id.top:
                            setColor(top, Color.parseColor("#" + hexColor));
                            editor.putString("cubeTop", hexColor);
                            break;
                        case R.id.left:
                            setColor(left, Color.parseColor("#" + hexColor));
                            editor.putString("cubeLeft", hexColor);
                            break;
                        case R.id.front:
                            setColor(front, Color.parseColor("#" + hexColor));
                            editor.putString("cubeFront", hexColor);
                            break;
                        case R.id.right:
                            setColor(right, Color.parseColor("#" + hexColor));
                            editor.putString("cubeRight", hexColor);
                            break;
                        case R.id.back:
                            setColor(back, Color.parseColor("#" + hexColor));
                            editor.putString("cubeBack", hexColor);
                            break;
                        case R.id.down:
                            setColor(down, Color.parseColor("#" + hexColor));
                            editor.putString("cubeDown", hexColor);
                            break;
                    }
                    editor.apply();
                }
            })
            .create()
            .show(getFragmentManager(), "ChromaDialog");

}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:68,代码来源:SchemeSelectDialogMain.java


示例6: newInstance

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
private static ChromaDialogFixed newInstance(@ColorInt int initialColor, ColorMode colorMode, IndicatorMode indicatorMode) {
    ChromaDialogFixed fragment = new ChromaDialogFixed();
    fragment.setArguments(makeArgs(initialColor, colorMode, indicatorMode));
    return fragment;
}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:6,代码来源:ChromaDialogFixed.java


示例7: onCreateDialog

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    if (savedInstanceState == null) {
        chromaView = new ChromaView(
                getArguments().getInt(ARG_INITIAL_COLOR),

                ColorMode.values()[
                        getArguments().getInt(ARG_COLOR_MODE_ID)],

                IndicatorMode.values()[
                        getArguments().getInt(ARG_INDICATOR_MODE)],

                getActivity());
    } else {
        chromaView = new ChromaView(

                savedInstanceState.getInt(ARG_INITIAL_COLOR, ChromaView.DEFAULT_COLOR),

                ColorMode.values()[
                        savedInstanceState.getInt(ARG_COLOR_MODE_ID)],

                IndicatorMode.values()[
                        savedInstanceState.getInt(ARG_INDICATOR_MODE)],

                getActivity());
    }

    chromaView.enableButtonBar(new ChromaView.ButtonBarListener() {
        @Override
        public void onPositiveButtonClick(int color) {
            if (listener != null) {
                listener.onColorSelected(color);
            }
            dismiss();
        }

        @Override
        public void onNegativeButtonClick() {
            dismiss();
        }
    });

    final AlertDialog ad = new AlertDialog.Builder(getActivity(), getTheme()).setView(chromaView).create();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
        ad.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialog) {
                measureLayout(ad);
            }
        });
    }

    return ad;
}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:57,代码来源:ChromaDialogFixed.java


示例8: onCreateView

import com.pavelsikun.vintagechroma.colormode.ColorMode; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    chooserButton = (Button) findViewById(R.id.chooserButton);
    chooserButton.setText(barcodeContent);

    chooserButton.setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    (new CreateFragment.BarcodeContentChooserFragment()).show(getFragmentManager(), null);
                }
            }
    );

    colorPickerButton = (Button) findViewById(R.id.color_picker_button);

    // The color chooser for the QR Code
    colorPickerButton.setBackgroundColor(foregroundColor);
    colorPickerButton.setText("");
    colorPickerButton.setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    new ChromaDialog.Builder()
                            .initialColor(foregroundColor)
                            .colorMode(ColorMode.ARGB)
                            .indicatorMode(IndicatorMode.DECIMAL)
                            .onColorSelected(new OnColorSelectedListener() {
                                @Override
                                public void onColorSelected(@ColorInt int color) {
                                    colorPickerButton.setBackgroundColor(color);
                                    foregroundColor = color;
                                }
                            })
                            .create()
                            .show(activityCommander.getSupportFragmentMgr(), "ChromaDialog");
                }
            }
    );

    activityCommander.setInputSection(getFragmentManager(), R.layout.input_text, new TextInputFragment());
    return getView();
}
 
开发者ID:areebbeigh,项目名称:QRCodeUtility,代码行数:47,代码来源:CreateFragment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RedwoodChannels类代码示例发布时间:2022-05-22
下一篇:
Java BiomeSavanna类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap