package com.example.lab4;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private DrawingView drawingView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        drawingView = findViewById(R.id.powierzchnia_rysunku);

        findViewById(R.id.btn_red).setOnClickListener(v ->
                drawingView.setCurrentColor(0xFFFF0000));
        findViewById(R.id.btn_orange).setOnClickListener(v ->
                drawingView.setCurrentColor(0xFFFFA500));
        findViewById(R.id.btn_blue).setOnClickListener(v ->
                drawingView.setCurrentColor(0xFF0000FF));
        findViewById(R.id.btn_green).setOnClickListener(v ->
                drawingView.setCurrentColor(0xFF008000));
        findViewById(R.id.btn_clear).setOnClickListener(v ->
                drawingView.clearCanvas());
    }
}
