Skip to content
Snippets Groups Projects
Commit a81eb0c6 authored by SCHILLING Juliette's avatar SCHILLING Juliette
Browse files

activation mode immersion ok

parent 9254d26d
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<component name="DesignSurface"> <component name="DesignSurface">
<option name="filePathToZoomLevelMap"> <option name="filePathToZoomLevelMap">
<map> <map>
<entry key="app/src/main/res/layout/activity_boussole.xml" value="0.3098958333333333" />
<entry key="app/src/main/res/layout/activity_main.xml" value="0.15104166666666666" /> <entry key="app/src/main/res/layout/activity_main.xml" value="0.15104166666666666" />
<entry key="app/src/main/res/layout/activity_mode_conception.xml" value="0.32864583333333336" /> <entry key="app/src/main/res/layout/activity_mode_conception.xml" value="0.32864583333333336" />
<entry key="app/src/main/res/layout/activity_mode_immersion.xml" value="0.3333333333333333" /> <entry key="app/src/main/res/layout/activity_mode_immersion.xml" value="0.3333333333333333" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.example.myhabitat" > package="com.example.myhabitat">
<uses-feature <uses-feature
android:name="android.hardware.camera" android:name="android.hardware.camera"
android:required="true" /> android:required="true"/>
<application <application
android:allowBackup="true" android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.MyHabitat" android:theme="@style/Theme.MyHabitat"
tools:targetApi="31" > tools:targetApi="31">
<activity <activity
android:name=".ModeConceptionActivity" android:name=".ModeConceptionActivity"
android:exported="false" /> android:exported="false"/>
<activity <activity
android:name=".ModeImmersionActivity" android:name=".ModeImmersionActivity"
android:exported="false" /> android:exported="false"/>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" > android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>
......
...@@ -3,6 +3,7 @@ package com.example.myhabitat; ...@@ -3,6 +3,7 @@ package com.example.myhabitat;
import android.content.Intent; import android.content.Intent;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import androidx.activity.result.ActivityResult; import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback; import androidx.activity.result.ActivityResultCallback;
...@@ -55,12 +56,21 @@ public class MainActivity extends AppCompatActivity { ...@@ -55,12 +56,21 @@ public class MainActivity extends AppCompatActivity {
*/ */
textView = findViewById(R.id.textTest); textView = findViewById(R.id.textTest);
ouvrirJSON(); ouvrirJSON();
textView.setText(habitat.toString()); textView.setText(habitat.toString());
Button b = findViewById(R.id.buttonImmersion);
if(habitat.getPieces().size() == 0) {
b.setEnabled(false);
}else{
b.setEnabled(true);
}
} }
public void conception(View view) { public void conception(View view) {
...@@ -141,6 +151,12 @@ public class MainActivity extends AppCompatActivity { ...@@ -141,6 +151,12 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
protected void onPostResume() { protected void onPostResume() {
ouvrirJSON(); ouvrirJSON();
Button b = findViewById(R.id.buttonImmersion);
if(habitat.getPieces().size() == 0) {
b.setEnabled(false);
}else{
b.setEnabled(true);
}
super.onPostResume(); super.onPostResume();
} }
} }
\ No newline at end of file
...@@ -121,6 +121,26 @@ public class ModeImmersionActivity extends AppCompatActivity implements SensorEv ...@@ -121,6 +121,26 @@ public class ModeImmersionActivity extends AppCompatActivity implements SensorEv
} }
} }
public void afficheSud(View view){
murEnCours = pieceEnCours.getMurOrientation(Orientation.SUD);
afficheMur();
}
public void afficheNord(View view){
murEnCours = pieceEnCours.getMurOrientation(Orientation.NORD);
afficheMur();
}
public void afficheEst(View view){
murEnCours = pieceEnCours.getMurOrientation(Orientation.EST);
afficheMur();
}
public void afficheOuest(View view){
murEnCours = pieceEnCours.getMurOrientation(Orientation.OUEST);
afficheMur();
}
@Override @Override
public void onSensorChanged(SensorEvent event) { public void onSensorChanged(SensorEvent event) {
// On récupère l'angle // On récupère l'angle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment