Skip to content

Commit

Permalink
implemented ColourCircles.{get,set}Colors
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed Jul 12, 2012
1 parent 4216553 commit 347eeea
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/hu/vsza/android/cmp/ColourCircles.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,29 @@ public void setCount(int count) {
}
requestLayout();
}

public int[] getColors() {
synchronized (color_lock) {
int[] retval = new int[colors.length];
for (int i = 0; i < colors.length; i++) {
retval[i] = colors[i];
}
return retval;
}
}

public void setColors(int[] colors) {
final int count = colors.length;
synchronized (color_lock) {
this.colors = new int[count];
for (int i = 0; i < count; i++) {
this.colors[i] = colors[i];
}
if (selected_color_index >= count) {
selected_color_index = count - 1;
}
}
fireColorChange();
requestLayout();
}
}

0 comments on commit 347eeea

Please sign in to comment.