Revision af8b42cc
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/rubik/RubikActivity.java | ||
---|---|---|
35 | 35 |
public class RubikActivity extends Activity |
36 | 36 |
{ |
37 | 37 |
static final int DEFAULT_SIZE = 3; |
38 |
private static final int STARTING_SIZE = 2;
|
|
38 |
private static final int SMALLEST_SIZE = 2;
|
|
39 | 39 |
private static final int[] button_ids = {R.id.rubikSize2, R.id.rubikSize3, R.id.rubikSize4}; |
40 | 40 |
|
41 | 41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
103 | 103 |
for(int b=0; b<button_ids.length; b++) |
104 | 104 |
if( button_ids[b] == id ) |
105 | 105 |
{ |
106 |
size = b+STARTING_SIZE;
|
|
106 |
size = b+SMALLEST_SIZE;
|
|
107 | 107 |
break; |
108 | 108 |
} |
109 | 109 |
|
... | ... | |
121 | 121 |
{ |
122 | 122 |
Drawable d = findViewById(button_ids[b]).getBackground(); |
123 | 123 |
|
124 |
if( size == b+STARTING_SIZE )
|
|
124 |
if( size == b+SMALLEST_SIZE )
|
|
125 | 125 |
{ |
126 | 126 |
d.setColorFilter(ContextCompat.getColor(this,R.color.red), PorterDuff.Mode.MULTIPLY); |
127 | 127 |
} |
Also available in: Unified diff
Port changes from the 'distorted-cube' target.