Skip to content

Commit

Permalink
Create separate multicast function and restore old static color on ca…
Browse files Browse the repository at this point in the history
…ncel colorwheel
  • Loading branch information
RickDB authored and RickDB committed Jan 15, 2016
1 parent 72d3c5e commit 03f3970
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion atmoorb/src/com/EvilCorp/atmoorb/ColorPicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,17 @@ protected void onDraw(Canvas canvas) {
}

int color = getColor();
sendApiColorCommand(color);
}

public void sendApiColorCommand(int color)
{
cRed = Color.red(color);
cGreen = Color.green(color);
cBlue = Color.blue(color);
cCommand = "static";
new SendMultiCastData().execute("");
}

private void drawPointerArrow(Canvas canvas) {

int centerX = getWidth() / 2;
Expand Down
4 changes: 4 additions & 0 deletions atmoorb/src/com/EvilCorp/atmoorb/ColorPickerDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class ColorPickerDialog extends AlertDialog {

private ColorPicker colorPickerView;
private final OnColorSelectedListener onColorSelectedListener;
private int oldColor;


public ColorPickerDialog(Context context, int initialColor, String cOrbIDs, String cOrbLedCount, OnColorSelectedListener onColorSelectedListener) {
super(context);
Expand All @@ -22,6 +24,7 @@ public ColorPickerDialog(Context context, int initialColor, String cOrbIDs, Stri

colorPickerView = new ColorPicker(context);
colorPickerView.setColor(initialColor);
oldColor = initialColor;
colorPickerView.cOrbIDs = cOrbIDs;
colorPickerView.cOrbLedCount = cOrbLedCount;

Expand All @@ -42,6 +45,7 @@ public void onClick(DialogInterface dialog, int which) {
onColorSelectedListener.onColorSelected(selectedColor);
break;
case BUTTON_NEGATIVE:
colorPickerView.sendApiColorCommand(oldColor);
dialog.dismiss();
break;
}
Expand Down

0 comments on commit 03f3970

Please sign in to comment.