package com.example.tcg;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.activity.OnBackPressedCallback;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    Button abrirPacotesButton, colecaoButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // Modo "FullScreen"
        getWindow().getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        | View.SYSTEM_UI_FLAG_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
        );

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        colecaoButton = findViewById(R.id.colecaoButton);
        abrirPacotesButton = findViewById(R.id.abrirPacotesButton);

        abrirPacotesButton.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, PacotesActivity.class);
            startActivity(intent);
        });

        colecaoButton.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, ColecaoActivity.class);
            startActivity(intent);
        });

        getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
            @Override
            public void handleOnBackPressed() {
                // Minimiza a app
                moveTaskToBack(true);
                overridePendingTransition(0, 0);
            }
        });
    }
}



