Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Button negro, gris, cian, azul, verde, naranja, morado, rojo, rosa;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Dibujar drawView = findViewById(R.id.dibujar);
- negro= findViewById(R.id.negro);
- gris= findViewById(R.id.gris);
- cian= findViewById(R.id.cian);
- azul= findViewById(R.id.azul);
- verde= findViewById(R.id.verde);
- naranja= findViewById(R.id.naranja);
- morado= findViewById(R.id.morado);
- rojo= findViewById(R.id.rojo);
- rosa= findViewById(R.id.rosa);
- negro.setOnClickListener(this);
- gris.setOnClickListener(this);
- cian.setOnClickListener(this);
- azul.setOnClickListener(this);
- verde.setOnClickListener(this);
- naranja.setOnClickListener(this);
- morado.setOnClickListener(this);
- rojo.setOnClickListener(this);
- rosa.setOnClickListener(this);
- }
- @Override
- public void onClick(View v) {
- int numero= Color.parseColor(v.getTag().toString());
- Dibujar.cambioColor(numero);
- }
- public static void cambioColor(int color){
- pincel.setColor(color);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement