Files
SAE41_2022/app/src/main/java/com/example/mastermind/MasterMindActivity.java

40 lines
1.3 KiB
Java
Raw Normal View History

2023-03-19 22:36:49 +01:00
package com.example.mastermind;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
2023-03-19 22:36:49 +01:00
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.example.mastermind.controller.mastermind.MonOnTouchListener;
import com.example.mastermind.vue.mastermind.UnePiece;
2023-03-19 22:36:49 +01:00
public class MasterMindActivity extends AppCompatActivity {
private int[] code;
2023-03-19 22:36:49 +01:00
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_master_mind);
Intent data=this.getIntent();
this.code=data.getIntArrayExtra("code");
LinearLayout l=this.findViewById(R.id.jeu);
for(int i=0; i<l.getChildCount(); i++){
LinearLayout fils = (LinearLayout) l.getChildAt(i);
for(int j=0; j<fils.getChildCount(); j++){
fils.getChildAt(j).setOnTouchListener(new MonOnTouchListener((UnePiece) fils.getChildAt(j), data.getBooleanExtra("vide", false)));
}
2023-04-06 22:51:16 +02:00
}
}
@Override
public void onBackPressed() {
Intent menu=new Intent(this, MenuActivity.class);
this.startActivity(menu);
this.finish();
2023-03-19 22:36:49 +01:00
}
}