Ajout du menu + MAJ de l'arborescence
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package sae.chuzzle;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
public class MenuActivity extends Activity implements View.OnClickListener {
|
||||
|
||||
private Button btnNouvellePartie;
|
||||
private Button btnPartieGraine;
|
||||
private Button btnOptions;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_menu);
|
||||
|
||||
btnNouvellePartie = findViewById(R.id.btnNouvellePartie);
|
||||
btnPartieGraine = findViewById(R.id.btnPartieGraine);
|
||||
btnOptions = findViewById(R.id.btnOptions);
|
||||
|
||||
btnNouvellePartie.setOnClickListener(this);
|
||||
btnPartieGraine.setOnClickListener(this);
|
||||
btnOptions.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v == btnNouvellePartie) {
|
||||
long graine = System.currentTimeMillis();
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.putExtra("graine", graine);
|
||||
startActivity(intent);
|
||||
} else if (v == btnPartieGraine) {
|
||||
Intent intent = new Intent(this, SeedActivity.class);
|
||||
startActivity(intent);
|
||||
} else if (v == btnOptions) {
|
||||
Intent intent = new Intent(this, OptionsActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user