package com.example.smartumbrellav3;

import android.os.Bundle;
import android.view.MenuItem;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;

public class DashboardActivity extends AppCompatActivity {

    OverviewFragment overviewFragment = new OverviewFragment();
    DrivingAndControlFragment drivingAndControlFragment = new DrivingAndControlFragment();
    MoreFragment moreFragment = new MoreFragment();


    Button button1;
    Button button2;
    Button button3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dashboard);
        button1 = findViewById(R.id.button1);
        button2 = findViewById(R.id.button2);
        button3 = findViewById(R.id.button3);
        button1.setOnClickListener(view -> {
            getSupportFragmentManager().beginTransaction().replace(R.id. container, overviewFragment).commit();
        });
        button2.setOnClickListener(view -> {
            getSupportFragmentManager().beginTransaction().replace(R.id. container, drivingAndControlFragment).commit();
        });
        button3.setOnClickListener(view -> {
            getSupportFragmentManager().beginTransaction().replace(R.id. container, moreFragment).commit();
        });


    }

}