Skip to content
Snippets Groups Projects
Commit 9497b962 authored by CHAPUSOT Alexis's avatar CHAPUSOT Alexis
Browse files

Creation de l'activité photo + validation des murs

parent 5bdaeb4d
Branches
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ android {
defaultConfig {
applicationId = "com.example.buildingbuilder"
minSdk = 24
targetSdk = 30
versionCode = 1
versionName = "1.0"
......@@ -21,6 +22,8 @@ android {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
......@@ -40,4 +43,9 @@ dependencies {
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
\ No newline at end of file
implementation ("androidx.camera:camera-core:1.3.0")
implementation ("androidx.camera:camera-camera2:1.3.0")
implementation ("androidx.camera:camera-video:1.3.0")
implementation ("androidx.camera:camera-extensions:1.3.0")
}
......@@ -6,6 +6,11 @@
android:name="android.hardware.camera"
android:required="true"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera.any" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
......
......@@ -94,4 +94,17 @@ public class Room implements IterableItem {
walls[3]=workingWall;
}
}
public boolean hasNorth(){
return walls[0].islocated();
}
public boolean hasEast(){
return walls[1].islocated();
}
public boolean hasSouth(){
return walls[2].islocated();
}
public boolean hasWeast(){
return walls[3].islocated();
}
}
......@@ -5,12 +5,15 @@ import java.util.ArrayList;
public class Wall {
ArrayList<Access> access;
String Location;
String location;
public Wall(){
access = new ArrayList<>();
}
public void setLocation(String location) {
Location = location;
location = location;
}
public boolean islocated(){
return location == null;
}
}
......@@ -48,10 +48,27 @@ public class RoomCreator extends AppCompatActivity {
this.updateMode = intent.getExtras() != null;
if(updateMode){
buttonEditMurNord.setVisibility(View.VISIBLE);
buttonEditMurSud.setVisibility(View.VISIBLE);
buttonEditMurOuest.setVisibility(View.VISIBLE);
buttonEditMurEst.setVisibility(View.VISIBLE);
Room lastWorkingRoom = BuildingManager.getInstance().getCurrentBuilding().getLastWorkingRoom();
if(lastWorkingRoom.hasNorth()) {
buttonEditMurNord.setVisibility(View.VISIBLE);
}else {
buttonEditMurNord.setVisibility(View.INVISIBLE);
}
if(lastWorkingRoom.hasEast()) {
buttonEditMurEst.setVisibility(View.VISIBLE);
}else {
buttonEditMurEst.setVisibility(View.INVISIBLE);
}
if(lastWorkingRoom.hasSouth()) {
buttonEditMurSud.setVisibility(View.VISIBLE);
}else {
buttonEditMurSud.setVisibility(View.INVISIBLE);
}
if(lastWorkingRoom.hasWeast()) {
buttonEditMurOuest.setVisibility(View.VISIBLE);
}else {
buttonEditMurOuest.setVisibility(View.INVISIBLE);
}
this.position = Integer.parseInt(intent.getExtras().getString("position"));
//recopie de la salle
}
......@@ -67,10 +84,14 @@ public class RoomCreator extends AppCompatActivity {
if (result.getResultCode()==RESULT_OK){
if(updateMode){
//Mise à jour du mur selon la position
//reaffichage de l'image selon la position
}
else{
BuildingManager.getInstance().getCurrentBuilding().getLastWorkingRoom().validWall(result.getData().getExtras().getString("position"));
//affichage de l'image selon mur
//affichage du bouton
}
}
else{
......@@ -78,8 +99,31 @@ public class RoomCreator extends AppCompatActivity {
}
});
buttonPhotoMurNord.setOnClickListener(view->{
Intent intent = new
Intent intentPhoto = new Intent(this,CameraWithAccelererometre.class);
intentPhoto.putExtra("orientation","north");
//si updateMode alors photo->updateMode
wallLauncher.launch(intentPhoto);
});
buttonPhotoMurOuest.setOnClickListener(view->{
Intent intentPhoto = new Intent(this,CameraWithAccelererometre.class);
intentPhoto.putExtra("orientation","West");
//si updateMode alors photo->updateMode
wallLauncher.launch(intentPhoto);
});
buttonPhotoMurEst.setOnClickListener(view->{
Intent intentPhoto = new Intent(this,CameraWithAccelererometre.class);
intentPhoto.putExtra("orientation","north");
//si updateMode alors photo->updateMode
wallLauncher.launch(intentPhoto);
});
buttonPhotoMurSud.setOnClickListener(view->{
Intent intentPhoto = new Intent(this,CameraWithAccelererometre.class);
intentPhoto.putExtra("orientation","north");
//si updateMode alors photo->updateMode
wallLauncher.launch(intentPhoto);
});
}
}
\ No newline at end of file
app/src/main/res/drawable/check.png

6.85 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment