예제 #1
0
  public View buildView() {
    View mainView = loadViewFromXml(R.layout.color_picker);

    picker = (ColorPicker) mainView.findViewById(R.id.picker);
    //		svBar = (SVBar) findViewById(R.id.svbar);
    //		opacityBar = (OpacityBar) findViewById(R.id.opacitybar);
    saturationBar = (SaturationBar) mainView.findViewById(R.id.saturationbar);
    //		valueBar = (ValueBar) findViewById(R.id.valuebar);

    oldColorHex = Project4App.getApp(context).getEditProjectColorString();
    int oldColor = Color.parseColor(oldColorHex);

    picker.setColor(oldColor);
    picker.setOldCenterColor(oldColor);

    //		picker.addSVBar(svBar);
    //		picker.addValueBar(valueBar);
    //		picker.addOpacityBar(opacityBar);
    picker.addSaturationBar(saturationBar);

    //		picker.setOnColorChangedListener(this);
    //		picker.setShowOldCenterColor(false);

    return mainView;
  }
예제 #2
0
 @Override
 public void onClickNegative() {
   Project4App.getApp(context).setEditProjectColorString(oldColorHex);
 }
예제 #3
0
 @Override
 public void onClickPositive() {
   float alpha = picker.getAlpha();
   String hexColor = ColorUtil.getHex(picker.getColor());
   Project4App.getApp(context).setEditProjectColorString(hexColor);
 }