From 0679dfd519e35133d1ce1e43ef5e12cadcac6772 Mon Sep 17 00:00:00 2001
From: JulietteSCHILLING <juliette.schilling2@etu.univ-lorraine.fr>
Date: Sat, 5 Nov 2022 12:11:04 +0100
Subject: [PATCH] mode immersion debuts

---
 .idea/misc.xml                                |   3 +
 app/build.gradle                              |   3 +
 app/src/main/AndroidManifest.xml              |  10 +-
 .../com/example/myhabitat/MainActivity.java   |  60 ++++++++----
 ...ivity.java => ModeConceptionActivity.java} |   4 +-
 .../myhabitat/ModeImmersionActivity.java      |  81 ++++++++++++++++
 app/src/main/res/drawable/imagemur.png        | Bin 0 -> 4151 bytes
 app/src/main/res/layout/activity_main.xml     |  21 +++-
 ...ieces.xml => activity_mode_conception.xml} |   2 +-
 .../res/layout/activity_mode_immersion.xml    |  19 ++++
 app/src/main/res/menu/menu_immersion.xml      |   2 +
 app/src/main/res/values/strings.xml           |  91 ++++++++++++++++++
 app/src/main/res/values/themes.xml            |   6 ++
 13 files changed, 273 insertions(+), 29 deletions(-)
 rename app/src/main/java/com/example/myhabitat/{PiecesActivity.java => ModeConceptionActivity.java} (98%)
 create mode 100644 app/src/main/java/com/example/myhabitat/ModeImmersionActivity.java
 create mode 100644 app/src/main/res/drawable/imagemur.png
 rename app/src/main/res/layout/{activity_pieces.xml => activity_mode_conception.xml} (96%)
 create mode 100644 app/src/main/res/layout/activity_mode_immersion.xml
 create mode 100644 app/src/main/res/menu/menu_immersion.xml

diff --git a/.idea/misc.xml b/.idea/misc.xml
index 9d96ad3..031ac64 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -4,7 +4,10 @@
     <option name="filePathToZoomLevelMap">
       <map>
         <entry key="app/src/main/res/layout/activity_main.xml" value="0.15104166666666666" />
+        <entry key="app/src/main/res/layout/activity_mode_immersion.xml" value="0.3333333333333333" />
         <entry key="app/src/main/res/layout/activity_pieces.xml" value="0.19464720194647203" />
+        <entry key="app/src/main/res/layout/content_scrolling.xml" value="0.246875" />
+        <entry key="app/src/main/res/menu/menu_immersion.xml" value="0.3697916666666667" />
       </map>
     </option>
   </component>
diff --git a/app/build.gradle b/app/build.gradle
index 4699227..0ca0e70 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -25,6 +25,9 @@ android {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
+    buildFeatures {
+        viewBinding true
+    }
 }
 
 dependencies {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index bfeb52f..c380773 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -2,9 +2,10 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     package="com.example.myhabitat" >
+
     <uses-feature
-            android:name="android.hardware.camera"
-            android:required="true"/>
+        android:name="android.hardware.camera"
+        android:required="true" />
 
     <application
         android:allowBackup="true"
@@ -17,7 +18,10 @@
         android:theme="@style/Theme.MyHabitat"
         tools:targetApi="31" >
         <activity
-            android:name=".PiecesActivity"
+            android:name=".ModeConceptionActivity"
+            android:exported="false" />
+        <activity
+            android:name=".ModeImmersionActivity"
             android:exported="false" />
         <activity
             android:name=".MainActivity"
diff --git a/app/src/main/java/com/example/myhabitat/MainActivity.java b/app/src/main/java/com/example/myhabitat/MainActivity.java
index 694ec28..89d92a3 100644
--- a/app/src/main/java/com/example/myhabitat/MainActivity.java
+++ b/app/src/main/java/com/example/myhabitat/MainActivity.java
@@ -1,8 +1,6 @@
 package com.example.myhabitat;
 
 import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.util.Log;
 import android.view.View;
 import android.widget.TextView;
@@ -60,10 +58,17 @@ public class MainActivity extends AppCompatActivity {
 
     }
 
-    public void AffichePieces(View view) {
-        Intent intent = new Intent(this, PiecesActivity.class);
+    public void conception(View view) {
+        Intent intent = new Intent(this, ModeConceptionActivity.class);
+        intent.putExtra("Habitat", habitat);
+        if (intent.resolveActivity(getPackageManager()) != null){
+            launcher.launch(intent);
+        }
+    }
+
+    public void immersion(View view) {
+        Intent intent = new Intent(this, ModeImmersionActivity.class);
         intent.putExtra("Habitat", habitat);
-        //startActivity(intent);
         if (intent.resolveActivity(getPackageManager()) != null){
             launcher.launch(intent);
         }
@@ -86,7 +91,11 @@ public class MainActivity extends AppCompatActivity {
                 murs.put(Jmur);
             }
             pieces.put(piece.getNom());
-            pieces.put(murs);
+            try {
+                pieces.put(0, murs);
+            } catch (JSONException e) {
+                throw new RuntimeException(e);
+            }
         }
         try {
             enregistrement.put("Pieces", pieces);
@@ -103,6 +112,7 @@ public class MainActivity extends AppCompatActivity {
                 ps.close();
                 fos.flush();
                 Log.i("testEnregistrement", "enregistrement.json a bien été enregistré");
+                ouvrirJSON();
             } catch (FileNotFoundException e) {
                 throw new RuntimeException(e);
             } catch (IOException e) {
@@ -110,27 +120,40 @@ public class MainActivity extends AppCompatActivity {
             }
             Log.i("testJSON", enregistrement.toString());
 
-            FileInputStream fis = null;
+        }else{
+            Log.i("testJSON", "pbm");
+        }
+    }
+
+    public void ouvrirJSON(){
+        FileInputStream fis = null;
+        try {
+            fis = openFileInput("enregistrement.json");
+        } catch (FileNotFoundException e) {
+            //throw new RuntimeException(e);
+        }
+        if (fis != null) {
+            String json = getFileContent(fis);
+
             try {
-                fis = openFileInput("enregistrement.json");
-            } catch (FileNotFoundException e) {
-                //throw new RuntimeException(e);
-            }
-            if (fis != null) {
-                String json = getFileContent(fis);
+                JSONObject enregistrement = new JSONObject(json);
+                JSONArray pieces = enregistrement.getJSONArray("Pieces");
+                JSONArray murs = pieces.getJSONArray(0);
+                Log.i("testJSONmurs", murs.toString());
 
-                Log.i("testJSON", json);
+            } catch (JSONException e) {
+                throw new RuntimeException(e);
             }
 
-
+            Log.i("testJSON", json);
         }else{
-            Log.i("testJSON", "pbm");
+            Log.i("testJSON", "pbm ouverture");
         }
     }
 
-    public String getFileContent( FileInputStream fis ) {
+    public String getFileContent(FileInputStream fis) {
         StringBuilder sb = new StringBuilder();
-        Reader r = null;  //or whatever encoding
+        Reader r = null;
         try {
             r = new InputStreamReader(fis, "UTF-8");
             int ch = r.read();
@@ -148,7 +171,6 @@ public class MainActivity extends AppCompatActivity {
 
     @Override
     protected void onPause() {
-        Log.i("testOn", "on y est !");
         enregistrement();
         super.onPause();
     }
diff --git a/app/src/main/java/com/example/myhabitat/PiecesActivity.java b/app/src/main/java/com/example/myhabitat/ModeConceptionActivity.java
similarity index 98%
rename from app/src/main/java/com/example/myhabitat/PiecesActivity.java
rename to app/src/main/java/com/example/myhabitat/ModeConceptionActivity.java
index dc6320a..2224fbd 100644
--- a/app/src/main/java/com/example/myhabitat/PiecesActivity.java
+++ b/app/src/main/java/com/example/myhabitat/ModeConceptionActivity.java
@@ -24,7 +24,7 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
-public class PiecesActivity extends AppCompatActivity {
+public class ModeConceptionActivity extends AppCompatActivity {
     private Habitat habitat;
     private GestionnaireEditHabitat gestionnaire;
     private ActivityResultLauncher<Intent> launcher;
@@ -34,7 +34,7 @@ public class PiecesActivity extends AppCompatActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_pieces);
+        setContentView(R.layout.activity_mode_conception);
 
         gestionnaire = new GestionnaireEditHabitat();
 
diff --git a/app/src/main/java/com/example/myhabitat/ModeImmersionActivity.java b/app/src/main/java/com/example/myhabitat/ModeImmersionActivity.java
new file mode 100644
index 0000000..2141c7c
--- /dev/null
+++ b/app/src/main/java/com/example/myhabitat/ModeImmersionActivity.java
@@ -0,0 +1,81 @@
+package com.example.myhabitat;
+
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.util.Log;
+import android.view.Display;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.ImageView;
+import android.widget.Toast;
+import androidx.appcompat.app.AppCompatActivity;
+import android.os.Bundle;
+import habitat.Habitat;
+import habitat.Mur;
+import habitat.Piece;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+public class ModeImmersionActivity extends AppCompatActivity {
+    Habitat habitat;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        //On récupère Habitat
+        Intent intent = getIntent();
+        if (intent != null){
+            Habitat habitat = intent.getParcelableExtra("Habitat");
+            if (habitat != null){
+                this.habitat = habitat;
+                this.habitat.setCorrectly();
+            }
+        }
+
+        setContentView(R.layout.activity_mode_immersion);
+    }
+
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.menu_immersion, menu);
+
+        int i =0;
+        for(Piece piece : habitat.getPieces()){
+            menu.add(piece.getNom());
+            menu.getItem(i).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
+                @Override
+                public boolean onMenuItemClick(MenuItem item) {
+                    Log.i("testImmersion", "J'ouvre " + item.getTitle());
+                    Toast.makeText(getBaseContext(), item.getTitle(), Toast.LENGTH_SHORT).show();
+                    affichePiece(piece);
+                    return false;
+                }
+            });
+            i++;
+        }
+
+        return true;
+    }
+
+    public void affichePiece(Piece piece){
+        ImageView imageViewMur = findViewById(R.id.imageViewMur);
+        Mur mur = piece.getMurs().get(0);
+
+        //On récupère la photo
+        FileInputStream fis = null;
+        try {
+            fis = openFileInput(mur.getId()+".data");
+        } catch (FileNotFoundException e) {
+            //throw new RuntimeException(e);
+        }
+        if (fis != null) {
+            Bitmap bm = BitmapFactory.decodeStream(fis);
+            imageViewMur.setImageBitmap(bm);
+        }else{
+            Log.i("testDrawable", "pas de photo");
+            imageViewMur.setImageDrawable(getDrawable(R.drawable.imagemur));
+        }
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/imagemur.png b/app/src/main/res/drawable/imagemur.png
new file mode 100644
index 0000000000000000000000000000000000000000..bcde97bfb1d9611b9132d17ff854e3b078e84ce1
GIT binary patch
literal 4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$n9!fk8H7EhR<lb*3cHO6hxDwP;N-BoLx*;dL-6nv+t?Ba5@
zrP?7P{Hx!CH~%-SkSN^G*AlID|7>jGqFdj@gyyYO3F+QZf0$#wM$O@>qt3~{&D|pG
zgFgGcbM^?`n(_K}soM_Kx3VgeISm7^p6KvA#WA0&=J!HNj;X4vcrQ;7&f~1xyjim4
zhqvb<BTmbQ_a<67_-V$wT2GiDoF}{Llc}P@#JXt1Ei>zLdO5bM?6)mrQoQ&?h|SVU
zWlgr%Z_UM1Iym-L#eYw3i7s6f;#&86ij51yn*5`j+h3(F-RhB|bnDx<-u<S29B-d>
zTyMAXauK;#@Zs;vCN*Qf9b3cCX{b%P6!?96e%&oEHJ0+?GL_GFUp-ZBswv!8=%jI6
zJzZsfpyX|)<oo-6uC;SB@jIdMU2bL1{FbBlEbgitI@|T1S@6bVw_nD3Zx|RD7(8A5
KT-G@yGywp1|Ltf1

literal 0
HcmV?d00001

diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 2b42194..2f55666 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -8,11 +8,11 @@
         tools:context=".MainActivity">
 
     <Button
-            android:text="Button"
+            android:text="Mode Conception"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:id="@+id/buttonAffichePieces"
-            android:onClick="AffichePieces"
+            android:id="@+id/buttonConception"
+            android:onClick="conception"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
@@ -25,6 +25,19 @@
             android:id="@+id/textTest"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintBottom_toTopOf="@+id/buttonAffichePieces"
+            app:layout_constraintBottom_toTopOf="@+id/buttonConception"
             app:layout_constraintTop_toTopOf="parent"/>
+
+    <Button
+            android:text="Mode Immersion"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/buttonImmersion"
+            android:onClick="immersion"
+            app:layout_constraintTop_toBottomOf="@+id/buttonConception"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintHorizontal_bias="0.498"
+            app:layout_constraintVertical_bias="0.156"/>
 </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_pieces.xml b/app/src/main/res/layout/activity_mode_conception.xml
similarity index 96%
rename from app/src/main/res/layout/activity_pieces.xml
rename to app/src/main/res/layout/activity_mode_conception.xml
index 0156df5..6ce396e 100644
--- a/app/src/main/res/layout/activity_pieces.xml
+++ b/app/src/main/res/layout/activity_mode_conception.xml
@@ -5,7 +5,7 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    tools:context=".PiecesActivity">
+    tools:context=".ModeConceptionActivity">
 
     <Button
             android:text="Ajouter une piece"
diff --git a/app/src/main/res/layout/activity_mode_immersion.xml b/app/src/main/res/layout/activity_mode_immersion.xml
new file mode 100644
index 0000000..ef9fb76
--- /dev/null
+++ b/app/src/main/res/layout/activity_mode_immersion.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        tools:context=".ModeImmersionActivity">
+
+    <ImageView
+            android:layout_width="308dp"
+            android:layout_height="305dp"
+            app:srcCompat="@drawable/imagemur"
+            android:id="@+id/imageViewMur"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"/>
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_immersion.xml b/app/src/main/res/menu/menu_immersion.xml
new file mode 100644
index 0000000..738676e
--- /dev/null
+++ b/app/src/main/res/menu/menu_immersion.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/menuImmersion"/>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 91534ff..79d6566 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,3 +1,94 @@
 <resources>
     <string name="app_name">MyHabitat</string>
+    <string name="title_activity_scrolling">ScrollingActivity</string>
+    <string name="large_text">
+        "Material is the metaphor.\n\n"
+
+        "A material metaphor is the unifying theory of a rationalized space and a system of motion."
+        "The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
+        "technologically advanced and open to imagination and magic.\n"
+        "Surfaces and edges of the material provide visual cues that are grounded in reality. The "
+        "use of familiar tactile attributes helps users quickly understand affordances. Yet the "
+        "flexibility of the material creates new affordances that supercede those in the physical "
+        "world, without breaking the rules of physics.\n"
+        "The fundamentals of light, surface, and movement are key to conveying how objects move, "
+        "interact, and exist in space and in relation to each other. Realistic lighting shows "
+        "seams, divides space, and indicates moving parts.\n\n"
+
+        "Bold, graphic, intentional.\n\n"
+
+        "The foundational elements of print based design typography, grids, space, scale, color, "
+        "and use of imagery guide visual treatments. These elements do far more than please the "
+        "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
+        "imagery, large scale typography, and intentional white space create a bold and graphic "
+        "interface that immerse the user in the experience.\n"
+        "An emphasis on user actions makes core functionality immediately apparent and provides "
+        "waypoints for the user.\n\n"
+
+        "Motion provides meaning.\n\n"
+
+        "Motion respects and reinforces the user as the prime mover. Primary user actions are "
+        "inflection points that initiate motion, transforming the whole design.\n"
+        "All action takes place in a single environment. Objects are presented to the user without "
+        "breaking the continuity of experience even as they transform and reorganize.\n"
+        "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
+        "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
+
+        "3D world.\n\n"
+
+        "The material environment is a 3D space, which means all objects have x, y, and z "
+        "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
+        "positive z-axis extending towards the viewer. Every sheet of material occupies a single "
+        "position along the z-axis and has a standard 1dp thickness.\n"
+        "On the web, the z-axis is used for layering and not for perspective. The 3D world is "
+        "emulated by manipulating the y-axis.\n\n"
+
+        "Light and shadow.\n\n"
+
+        "Within the material environment, virtual lights illuminate the scene. Key lights create "
+        "directional shadows, while ambient light creates soft shadows from all angles.\n"
+        "Shadows in the material environment are cast by these two light sources. In Android "
+        "development, shadows occur when light sources are blocked by sheets of material at "
+        "various positions along the z-axis. On the web, shadows are depicted by manipulating the "
+        "y-axis only. The following example shows the card with a height of 6dp.\n\n"
+
+        "Resting elevation.\n\n"
+
+        "All material objects, regardless of size, have a resting elevation, or default elevation "
+        "that does not change. If an object changes elevation, it should return to its resting "
+        "elevation as soon as possible.\n\n"
+
+        "Component elevations.\n\n"
+
+        "The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
+        "does not vary from 6dp in one app to 16dp in another app).\n"
+        "Components may have different resting elevations across platforms, depending on the depth "
+        "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
+
+        "Responsive elevation and dynamic elevation offsets.\n\n"
+
+        "Some component types have responsive elevation, meaning they change elevation in response "
+        "to user input (e.g., normal, focused, and pressed) or system events. These elevation "
+        "changes are consistently implemented using dynamic elevation offsets.\n"
+        "Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
+        "to the component’s resting state. They ensure that elevation changes are consistent "
+        "across actions and component types. For example, all components that lift on press have "
+        "the same elevation change relative to their resting elevation.\n"
+        "Once the input event is completed or cancelled, the component will return to its resting "
+        "elevation.\n\n"
+
+        "Avoiding elevation interference.\n\n"
+
+        "Components with responsive elevations may encounter other components as they move between "
+        "their resting elevations and dynamic elevation offsets. Because material cannot pass "
+        "through other material, components avoid interfering with one another any number of ways, "
+        "whether on a per component basis or using the entire app layout.\n"
+        "On a component level, components can move or be removed before they cause interference. "
+        "For example, a floating action button (FAB) can disappear or move off screen before a "
+        "user picks up a card, or it can move if a snackbar appears.\n"
+        "On the layout level, design your app layout to minimize opportunities for interference. "
+        "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
+        "when a user tries to pick up one of cards.\n\n"
+    </string>
+    <string name="action_settings">Settings</string>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 44b3584..7f70abd 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -13,4 +13,10 @@
         <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
         <!-- Customize your theme here. -->
     </style>
+    <style name="Theme.MyHabitat.NoActionBar">
+        <item name="windowActionBar">false</item>
+        <item name="windowNoTitle">true</item>
+    </style>
+    <style name="Theme.MyHabitat.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
+    <style name="Theme.MyHabitat.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
 </resources>
\ No newline at end of file
-- 
GitLab