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


Java ColorPicker.setColor方法代码示例

本文整理汇总了Java中com.larswerkman.holocolorpicker.ColorPicker.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java ColorPicker.setColor方法的具体用法?Java ColorPicker.setColor怎么用?Java ColorPicker.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.larswerkman.holocolorpicker.ColorPicker的用法示例。


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

示例1: PrepareColorPicker

import com.larswerkman.holocolorpicker.ColorPicker; //导入方法依赖的package包/类
protected ColorPicker PrepareColorPicker(int color)
{
    ColorPicker cp = (ColorPicker) findViewById(R.id.dialog_colorpicker);
    if (cp != null)
    {
        View v = findViewById(R.id.dialog_colorpicker_saturation_bar);
        if (v != null && v instanceof SaturationBar)
        {
            cp.addSaturationBar((SaturationBar) v);
        }
        v = findViewById(R.id.dialog_colorpicker_value_bar);
        if (v != null && v instanceof ValueBar)
        {
            cp.addValueBar((ValueBar) v);
        }
        v = findViewById(R.id.dialog_colorpicker_opacity_bar);
        if (v != null && v instanceof OpacityBar)
        {
            cp.addOpacityBar((OpacityBar) v);
        }
        cp.setColor(color);
        cp.setOldCenterColor(color);
    }
    return cp;
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:26,代码来源:DialogBase.java

示例2: onCreate

import com.larswerkman.holocolorpicker.ColorPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_color_chooser);

    // initialize the color picker
    picker = (ColorPicker) findViewById(R.id.picker);
    picker.setOldCenterColor(getOldColor());
    picker.setColor(getOldColor());

    connection = new WearConnection(getBaseContext());

    findViewById(R.id.chooseColorButton).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            setOldColor(picker.getColor());
            connection.sendColor(CommonConstants.DATA_PATH_DOT_COLOR, picker.getColor());
        }
    });
}
 
开发者ID:dwa012,项目名称:WearBinaryWatchFace,代码行数:21,代码来源:ColorChooserActivity.java

示例3: onBuildDialog

import com.larswerkman.holocolorpicker.ColorPicker; //导入方法依赖的package包/类
@NonNull
@Override
public MaterialDialog onBuildDialog(@NonNull MaterialDialog.Builder builder) {
    MaterialDialog md = builder
            .customView(R.layout.dialog_preference_colorpicker, true)
            .build();

    int color = (int) mOption.read(mConfig);
    boolean randomColor = Color.alpha(color) == RANDOM_COLOR_ALPHA_MASK;
    if (randomColor) color |= Color.argb(255, 0, 0, 0);

    RadioGroup rg = (RadioGroup) md.getCustomView().findViewById(R.id.radios);
    mColorPanel = (ViewGroup) rg.findViewById(R.id.custom_color_panel);
    mColorPicker = (ColorPicker) mColorPanel.findViewById(R.id.picker);
    mColorPicker.addSaturationBar((SaturationBar) mColorPanel.findViewById(R.id.saturationbar));
    mColorPicker.addValueBar((ValueBar) mColorPanel.findViewById(R.id.valuebar));
    mColorPicker.setColor(color);
    mColorPicker.setOldCenterColor(color);

    // Setup radio things
    mRadioCustomColor = (RadioButton) rg.findViewById(R.id.custom_color);
    mRadioRandomColor = (RadioButton) rg.findViewById(R.id.random_color);
    rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            ViewUtils.setVisible(mColorPanel, mRadioCustomColor.isChecked());
        }
    });
    rg.check(randomColor
            ? mRadioRandomColor.getId()
            : mRadioCustomColor.getId());
    return md;
}
 
开发者ID:AChep,项目名称:AcDisplay,代码行数:34,代码来源:ColorPickerPreference.java

示例4: onCreate

import com.larswerkman.holocolorpicker.ColorPicker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_color_picker);

    mBleManager = BleManager.getInstance(this);

    // UI
    mRgbColorView = findViewById(R.id.rgbColorView);
    mRgbTextView = (TextView) findViewById(R.id.rgbTextView);

    SaturationBar mSaturationBar = (SaturationBar) findViewById(R.id.saturationbar);
    ValueBar mValueBar = (ValueBar) findViewById(R.id.valuebar);
    mColorPicker = (ColorPicker) findViewById(R.id.colorPicker);
    if (mColorPicker != null) {
        mColorPicker.addSaturationBar(mSaturationBar);
        mColorPicker.addValueBar(mValueBar);
        mColorPicker.setOnColorChangedListener(this);
    }

    if (kPersistValues) {
        SharedPreferences preferences = getSharedPreferences(kPreferences, Context.MODE_PRIVATE);
        mSelectedColor = preferences.getInt(kPreferences_color, kFirstTimeColor);
    } else {
        mSelectedColor = kFirstTimeColor;
    }

    mColorPicker.setOldCenterColor(mSelectedColor);
    mColorPicker.setColor(mSelectedColor);
    onColorChanged(mSelectedColor);

    // Start services
    onServicesDiscovered();
}
 
开发者ID:adafruit,项目名称:Bluefruit_LE_Connect_Android,代码行数:35,代码来源:ColorPickerActivity.java

示例5: onCreate

import com.larswerkman.holocolorpicker.ColorPicker; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_neopixel_colorpicker);
        setContentView(R.layout.activity_color_picker);

        Intent intent = getIntent();
        mSelectedColor = intent.getIntExtra(kActivityParameter_SelectedColorKey, Color.WHITE);

        // UI
        mRgbColorView = findViewById(R.id.rgbColorView);
        mRgbTextView = (TextView) findViewById(R.id.rgbTextView);

        SaturationBar mSaturationBar = (SaturationBar) findViewById(R.id.saturationbar);
        ValueBar mValueBar = (ValueBar) findViewById(R.id.valuebar);
        mColorPicker = (ColorPicker) findViewById(R.id.colorPicker);
        if (mColorPicker != null) {
            mColorPicker.addSaturationBar(mSaturationBar);
            mColorPicker.addValueBar(mValueBar);
            mColorPicker.setOnColorChangedListener(this);

            mColorPicker.setOldCenterColor(mSelectedColor);
            mColorPicker.setColor(mSelectedColor);
        }
        onColorChanged(mSelectedColor);

        Button sendButton = (Button) findViewById(R.id.sendButton);
        sendButton.setText(R.string.neopixel_colorpicker_setcolor);

    }
 
开发者ID:adafruit,项目名称:Bluefruit_LE_Connect_Android,代码行数:31,代码来源:NeopixelColorPickerActivity.java


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