Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cody.color;
- import android.app.Activity;
- import android.graphics.Color;
- import android.widget.Button;
- public class ButtonColorUpdate extends Activity {
- ColorFloodGame data = new ColorFloodGame(6,6);
- Button changed;
- int value,x,y;
- public ButtonColorUpdate(ColorFloodGame g1, Button b1, int x01, int y01){
- data = g1;
- changed = b1;
- x= x01;
- y= y01;
- }
- public void updateVal(){
- value = data.returnColor(x,y);
- }
- public void change(){
- if(value == 0)
- changed.setBackgroundColor(Color.RED);
- if(value == 1)
- changed.setBackgroundColor(Color.BLUE);
- if(value == 2)
- changed.setBackgroundColor(Color.GREEN);
- if(value == 3)
- changed.setBackgroundColor(Color.YELLOW);
- if(value == 4)
- changed.setBackgroundColor(Color.CYAN);
- if(value == 5)
- changed.setBackgroundColor(Color.GRAY);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement