diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56e9f285d8cfdc6c270853a5d439021a278..b86273d9424b73937ca6ad7933f6b7eeb60f4a3d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> - <bytecodeTargetLevel target="17" /> + <bytecodeTargetLevel target="21" /> </component> </project> \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index 58f1ee30765d9aa31dfb8239c49a092cabc8deca..5a8e5f9cf6dcf38c4e6d5ddfde5866b84c191938 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -4,28 +4,14 @@ <selectionStates> <SelectionState runConfigName="app"> <option name="selectionMode" value="DROPDOWN" /> - <DropdownSelection timestamp="2024-10-31T15:32:51.190810400Z"> + <DropdownSelection timestamp="2024-12-15T17:00:55.472861300Z"> <Target type="DEFAULT_BOOT"> <handle> - <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\user\.android\avd\Pixel_8_Pro_API_35.avd" /> + <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\Prosp\.android\avd\Medium_Phone_API_35.avd" /> </handle> </Target> </DropdownSelection> - <DialogSelection> - <targets> - <Target type="DEFAULT_BOOT"> - <handle> - <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\melvi\.android\avd\Pixel_8_API_35.avd" /> - </handle> - </Target> - </targets> - </DialogSelection> - </SelectionState> - <SelectionState runConfigName="HomeActivity"> - <option name="selectionMode" value="DROPDOWN" /> - </SelectionState> - <SelectionState runConfigName="MainActivity"> - <option name="selectionMode" value="DROPDOWN" /> + <DialogSelection /> </SelectionState> </selectionStates> </component> diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ef8e008a44385384a7c0362377ae1af68f99835 --- /dev/null +++ b/.idea/deviceManager.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="DeviceTable"> + <option name="columnSorters"> + <list> + <ColumnSorterState> + <option name="column" value="Name" /> + <option name="order" value="DESCENDING" /> + </ColumnSorterState> + <ColumnSorterState> + <option name="column" value="API" /> + <option name="order" value="DESCENDING" /> + </ColumnSorterState> + </list> + </option> + </component> +</project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 8978d23db569daa721cb26dde7923f4c673d1fc9..b2c751a35c77d4f7b713fe3bfc2cfb693e4d984f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ <project version="4"> <component name="ExternalStorageConfigurationManager" enabled="true" /> - <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000000000000000000000000000000000000..16660f1d80a1f5cde389ecce783051eb8f68223d --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="RunConfigurationProducerService"> + <option name="ignoredProducers"> + <set> + <option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" /> + <option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" /> + <option value="com.intellij.execution.junit.PatternConfigurationProducer" /> + <option value="com.intellij.execution.junit.TestInClassConfigurationProducer" /> + <option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" /> + <option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" /> + <option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" /> + <option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..25a9d0725cb00bd019665ec986d16d4feba6a95b --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# com-ent-projet38-2024 +Répertoire accueillant le projet n°38 de Commande Entreprise (IMT Atlantique). diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6f2e13f0d5e49ca3833c24669d0edf44a69b875c..3244b422655b480beaefc14fd2899b49fdee642d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,8 +26,8 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } } @@ -37,6 +37,11 @@ dependencies { implementation(libs.activity) implementation(libs.constraintlayout) implementation(libs.flexboxlayout) + implementation(libs.readmoretextview) + implementation("org.tensorflow:tensorflow-lite:2.14.0") + implementation("org.tensorflow:tensorflow-lite-support:0.4.4") + //implementation(libs.litert.gpu) + implementation(libs.ui.graphics.android) testImplementation(libs.junit) androidTestImplementation(libs.ext.junit) androidTestImplementation(libs.espresso.core) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c5d5754291d45468e9c4868b9397eabebd02535d..5b948718e24417d8dc35a3af094f92fe24e715da 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <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.myapplication"> <uses-feature android:name="android.hardware.camera" @@ -15,9 +16,9 @@ android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" - android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" - android:roundIcon="@mipmap/ic_launcher_round" + android:icon="@mipmap/plunv_logo" + android:label="Pluñv" + android:roundIcon="@mipmap/plunv_logo_round" android:supportsRtl="true" android:theme="@style/Theme.MyApplication" tools:targetApi="31"> @@ -30,7 +31,8 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:name=".HomeActivity"/> + <activity android:name=".HomeActivity" /> + <activity android:name=".TutorialActivity" /> <activity android:name=".PublicActivity" android:exported="true" /> @@ -38,6 +40,16 @@ <meta-data android:name="preloaded_fonts" android:resource="@array/preloaded_fonts" /> + + <provider + android:authorities="${applicationId}.fileprovider" + android:name="androidx.core.content.FileProvider" + android:exported="false" + android:grantUriPermissions="true"> + <meta-data + android:name="android.support.FILE_PROVIDER_PATHS" + android:resource="@xml/file_paths" /> + </provider> </application> </manifest> \ No newline at end of file diff --git a/app/src/main/assets/bernache_cravant.jpg b/app/src/main/assets/bernache_cravant.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9ecd3dcdb3c3a7103a14a750a9554c68d2f602e5 Binary files /dev/null and b/app/src/main/assets/bernache_cravant.jpg differ diff --git a/app/src/main/assets/goeland_argente.jpeg b/app/src/main/assets/goeland_argente.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4bebcf8db9418e09d37569ee0884e030094b08a7 Binary files /dev/null and b/app/src/main/assets/goeland_argente.jpeg differ diff --git a/app/src/main/assets/labels.txt b/app/src/main/assets/labels.txt new file mode 100644 index 0000000000000000000000000000000000000000..55c7a720631c846452516c397bf24d09d29f38bb --- /dev/null +++ b/app/src/main/assets/labels.txt @@ -0,0 +1,9 @@ +Bécasseau Sanderling +Bernache Cravant +Goéland Argenté +Mouette Rieuse +Pluvier Argenté +Grand Cormoran +Foulque Macroule +Tadorne de Belon +Chevalier Gambette \ No newline at end of file diff --git a/app/src/main/assets/model_float32.tflite b/app/src/main/assets/model_float32.tflite new file mode 100644 index 0000000000000000000000000000000000000000..f549b7d154f329e158f0af432b011be25a43f53a Binary files /dev/null and b/app/src/main/assets/model_float32.tflite differ diff --git a/app/src/main/assets/mouette_rieuse.jpg b/app/src/main/assets/mouette_rieuse.jpg new file mode 100644 index 0000000000000000000000000000000000000000..91d4dd930610d28a3f495182419cea0c6f4c5e46 Binary files /dev/null and b/app/src/main/assets/mouette_rieuse.jpg differ diff --git a/app/src/main/assets/tuto.pdf b/app/src/main/assets/tuto.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a2fb7992c7e0ae35161a7ca4fc0ac8c1a0e9e0d1 Binary files /dev/null and b/app/src/main/assets/tuto.pdf differ diff --git a/app/src/main/java/com/example/myapplication/BoundingBox.java b/app/src/main/java/com/example/myapplication/BoundingBox.java new file mode 100644 index 0000000000000000000000000000000000000000..20110f1437f315d11d601bf1bcaa581080e56432 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/BoundingBox.java @@ -0,0 +1,22 @@ +package com.example.myapplication; + +public class BoundingBox { + public float x1, y1, x2, y2, cx, cy, w, h, cnf; + public int cls; + public String clsName; + + public BoundingBox(float x1, float y1, float x2, float y2, float cx, float cy, + float w, float h, float cnf, int cls, String clsName) { + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + this.cx = cx; + this.cy = cy; + this.w = w; + this.h = h; + this.cnf = cnf; + this.cls = cls; + this.clsName = clsName; + } +} diff --git a/app/src/main/java/com/example/myapplication/HomeActivity.java b/app/src/main/java/com/example/myapplication/HomeActivity.java index c6317af36f68aa8c2c8055df6149ab3e86c8e3e7..8bef76f8915a35f73ba547e15bd381f253907de9 100644 --- a/app/src/main/java/com/example/myapplication/HomeActivity.java +++ b/app/src/main/java/com/example/myapplication/HomeActivity.java @@ -1,16 +1,48 @@ package com.example.myapplication; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Button; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; public class HomeActivity extends AppCompatActivity { + @Override + protected void onResume() { + super.onResume(); + + // If tutorial ran from photo page + boolean fromPhotoPage = getIntent().getBooleanExtra("FROM_PHOTO_PAGE", false); + if (fromPhotoPage) runTutorial(true); + + String tutorialKey = "FIRST_TIME_TUTORIAL"; + boolean preferences = getIntent().getBooleanExtra("PREFERENCES",true); + if (!preferences) getPreferences(MODE_PRIVATE).edit().putBoolean(tutorialKey, false).apply(); + boolean firstTime = getPreferences(MODE_PRIVATE).getBoolean(tutorialKey, true); + if (firstTime) { + runTutorial(false); + } + } + + private void runTutorial(boolean fromPhotoPage) { + Intent intent = new Intent(HomeActivity.this, TutorialActivity.class); + intent.putExtra("FROM_PHOTO_PAGE", fromPhotoPage); + startActivity(intent); + finish(); + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Load the saved theme mode from SharedPreferences + SharedPreferences preferences = getSharedPreferences("theme_prefs", MODE_PRIVATE); + int themeMode = preferences.getInt("theme_mode", AppCompatDelegate.MODE_NIGHT_NO); + AppCompatDelegate.setDefaultNightMode(themeMode); + setContentView(R.layout.activity_home); /* @@ -65,7 +97,6 @@ public class HomeActivity extends AppCompatActivity { }; photoButton.setOnClickListener(listenerPhotoButton); } - /** * A method to go to the learning page * @param pageToGo a string to signify to which page we want to go diff --git a/app/src/main/java/com/example/myapplication/LearningPage.java b/app/src/main/java/com/example/myapplication/LearningPage.java index badffa32bb892e90df1e91629f64cb7157158c19..de979da49d19f8b22a1e4a2ee744be470caa0dd1 100644 --- a/app/src/main/java/com/example/myapplication/LearningPage.java +++ b/app/src/main/java/com/example/myapplication/LearningPage.java @@ -2,11 +2,14 @@ package com.example.myapplication; import android.os.Bundle; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; public class LearningPage extends Fragment { @Override @@ -15,4 +18,159 @@ public class LearningPage extends Fragment { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_learning_page, container, false); } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + // Listener pour le becasseau + Button buttonBecasseau = (Button) this.getView().findViewById(R.id.button_becasseau); + View.OnClickListener listenerButtonBecasseau=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayBecasseau(); + } + }; + + buttonBecasseau.setOnClickListener(listenerButtonBecasseau); + + // Listener pour la bernache + Button buttonBernache = (Button) this.getView().findViewById(R.id.button_bernache); + + View.OnClickListener listenerButtonBernache=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayBernache(); + } + }; + + buttonBernache.setOnClickListener(listenerButtonBernache); + + // Listener pour le goeland + Button buttonGoeland = (Button) this.getView().findViewById(R.id.button_goeland); + + View.OnClickListener listenerButtonGoeland=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayGoeland(); + } + }; + + buttonGoeland.setOnClickListener(listenerButtonGoeland); + + // Listener pour la mouette + Button buttonMouette = (Button) this.getView().findViewById(R.id.button_mouette); + + View.OnClickListener listenerButtonMouette=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayMouette(); + } + }; + + buttonMouette.setOnClickListener(listenerButtonMouette); + + // Listener pour le pluvier + Button buttonPluvier = (Button) this.getView().findViewById(R.id.button_pluvier); + + View.OnClickListener listenerButtonPluvier=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayPluvier(); + } + }; + + buttonPluvier.setOnClickListener(listenerButtonPluvier); + + // Listener pour le cormoran + Button buttonCormoran = (Button) this.getView().findViewById(R.id.button_cormoran); + + View.OnClickListener listenerButtonCormoran=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayCormoran(); + } + }; + + buttonCormoran.setOnClickListener(listenerButtonCormoran); + + // Listener pour la foulque macroule + Button buttonFoulque = (Button) this.getView().findViewById(R.id.button_foulque); + + View.OnClickListener listenerButtonFoulque=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayFoulque(); + } + }; + + buttonFoulque.setOnClickListener(listenerButtonFoulque); + + // Listener pour le tadorne de Belon + Button buttonTadorne = (Button) this.getView().findViewById(R.id.button_tadorne); + + View.OnClickListener listenerButtonTadorne=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayTadorne(); + } + }; + + buttonTadorne.setOnClickListener(listenerButtonTadorne); + + // Listener pour le chevalier gambette + Button buttonChevalier = (Button) this.getView().findViewById(R.id.button_chevalier); + + View.OnClickListener listenerButtonChevalier=new View.OnClickListener() { + @Override + public void onClick(View view) { + showOverlayChevalier(); + } + }; + + buttonChevalier.setOnClickListener(listenerButtonChevalier); + } + + public void showOverlayBecasseau() { + OverlayDialogFragmentBecasseau overlayDialogBecasseau = new OverlayDialogFragmentBecasseau(); + overlayDialogBecasseau.show(getParentFragmentManager(), "overlayDialogBecasseau"); + } + + public void showOverlayBernache() { + OverlayDialogFragmentBernache overlayDialogBernache = new OverlayDialogFragmentBernache(); + overlayDialogBernache.show(getParentFragmentManager(), "overlayDialogBernache"); + } + + public void showOverlayGoeland() { + OverlayDialogFragmentGoeland overlayDialogGoeland = new OverlayDialogFragmentGoeland(); + overlayDialogGoeland.show(getParentFragmentManager(), "overlayDialogGoeland"); + } + + public void showOverlayMouette() { + OverlayDialogFragmentMouette overlayDialogMouette = new OverlayDialogFragmentMouette(); + overlayDialogMouette.show(getParentFragmentManager(), "overlayDialogMouette"); + } + + public void showOverlayPluvier() { + OverlayDialogFragmentPluvier overlayDialogPluvier = new OverlayDialogFragmentPluvier(); + overlayDialogPluvier.show(getParentFragmentManager(), "overlayDialogPluvier"); + } + + public void showOverlayCormoran() { + OverlayDialogFragmentCormoran overlayDialogCormoran = new OverlayDialogFragmentCormoran(); + overlayDialogCormoran.show(getParentFragmentManager(), "overlayDialogCormoran"); + } + + public void showOverlayFoulque() { + OverlayDialogFragmentFoulque overlayDialogFoulque = new OverlayDialogFragmentFoulque(); + overlayDialogFoulque.show(getParentFragmentManager(), "overlayDialogFoulque"); + } + + public void showOverlayTadorne() { + OverlayDialogFragmentTadorne overlayDialogTadorne = new OverlayDialogFragmentTadorne(); + overlayDialogTadorne.show(getParentFragmentManager(), "overlayDialogTadorne"); + } + + public void showOverlayChevalier() { + OverlayDialogFragmentChevalier overlayDialogChevalier = new OverlayDialogFragmentChevalier(); + overlayDialogChevalier.show(getParentFragmentManager(), "overlayDialogChevalier"); + } } \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/MainActivity.java b/app/src/main/java/com/example/myapplication/MainActivity.java index d7d469c40e32e6855d751ddf3899314c2b5d8252..12f9d387168dae293843e2a41b081a1f50e9c40d 100644 --- a/app/src/main/java/com/example/myapplication/MainActivity.java +++ b/app/src/main/java/com/example/myapplication/MainActivity.java @@ -1,14 +1,33 @@ package com.example.myapplication; import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; + import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; + +import org.tensorflow.lite.support.tensorbuffer.TensorBuffer; + +import java.io.IOException; +import java.util.List; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Load the saved theme mode from SharedPreferences + SharedPreferences preferences = getSharedPreferences("theme_prefs", MODE_PRIVATE); + int themeMode = preferences.getInt("theme_mode", AppCompatDelegate.MODE_NIGHT_NO); + AppCompatDelegate.setDefaultNightMode(themeMode); + setContentView(R.layout.activity_main); @@ -22,6 +41,48 @@ public class MainActivity extends AppCompatActivity { finish(); } }, delayMillis); + + + + } + + public void testPredict(View v){ + TextView textView = findViewById(R.id.testInference); + TestModeleTflite testModeleTflite = null; + try { + testModeleTflite = new TestModeleTflite(this); + String currentDir = System.getProperty("user.dir"); + String imagePath = "mouette_rieuse.jpg"; + Bitmap inputImage = TestModeleTflite.loadImage(imagePath, this); + + if (inputImage == null) { + System.out.println("Failed to load the image. Check the file path."); + return; + } + + // Perform prediction + TensorBuffer outputBuffer = testModeleTflite.predict(inputImage); + + // Process the output to get bounding boxes + List<BoundingBox> boxes = testModeleTflite.processOutput(outputBuffer); + + if (boxes == null || boxes.isEmpty()) { + textView.setText("No objects detected in the image."); + } else { + // Output results to the console + for (BoundingBox box : boxes) { + System.out.println("Class: " + box.clsName); + System.out.println("Confidence: " + box.cnf); + System.out.println("----------------------------"); + textView.setText("Class: " + box.clsName + " Confidence : " + box.cnf); + } + + } + } catch (IOException e) { + throw new RuntimeException(e); + } + + //textView.setText("bonjour"); } diff --git a/app/src/main/java/com/example/myapplication/NoSpeciesRecognizedException.java b/app/src/main/java/com/example/myapplication/NoSpeciesRecognizedException.java new file mode 100644 index 0000000000000000000000000000000000000000..a23697cd73f2b89794485f176c7dc6b9609d55b2 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/NoSpeciesRecognizedException.java @@ -0,0 +1,5 @@ +package com.example.myapplication; + +public class NoSpeciesRecognizedException extends Exception{ + +} diff --git a/app/src/main/java/com/example/myapplication/OutputPredictedImage.java b/app/src/main/java/com/example/myapplication/OutputPredictedImage.java new file mode 100644 index 0000000000000000000000000000000000000000..950de8ae765b65bc013c9dc9a00fc32ad0106f90 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OutputPredictedImage.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; + +import java.util.Map; + +/** + * this class purpose is to store information of the output of the recognation species + */ +public class OutputPredictedImage { + private Bitmap annotatedImage; + private Map<String, Integer> predictionResults; + + public OutputPredictedImage(Bitmap annotatedImage, Map<String,Integer> predictionResults){ + this.annotatedImage = annotatedImage; + this.predictionResults = predictionResults; + } + + @Override + public String toString(){ + StringBuilder result = new StringBuilder(); + for (Map.Entry<String, Integer> entry : predictionResults.entrySet()) { + // Append the key (species) and value (probability) in the specified format + result.append(entry.getKey()) + .append(" : ") + .append(entry.getValue()) // Format the float to 2 decimal places + .append("\n"); // Add a newline for separation + } + + // Return the concatenated string + return result.toString(); // Remove the last newline + } + + public Bitmap getAnnotatedImage() { + return annotatedImage; + } + + public Map<String, Integer> getPredictionResults() { + return predictionResults; + } + +} diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentBecasseau.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentBecasseau.java new file mode 100644 index 0000000000000000000000000000000000000000..43092ee17f22f621cc9827387e84ab273ad2dde7 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentBecasseau.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentBecasseau extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_becasseau, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_becasseau); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentBernache.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentBernache.java new file mode 100644 index 0000000000000000000000000000000000000000..e93978725d2fb0fbedce7a9aaa6b09561058d848 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentBernache.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentBernache extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_bernache, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_bernache); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentChevalier.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentChevalier.java new file mode 100644 index 0000000000000000000000000000000000000000..09673ec52c06505f2061aa608f93d167918fa517 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentChevalier.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentChevalier extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_chevalier, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_chevalier); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentCormoran.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentCormoran.java new file mode 100644 index 0000000000000000000000000000000000000000..16bc12f0608f132706f908f485efd2d8feb37f6d --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentCormoran.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentCormoran extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_cormoran, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_cormoran); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentForm.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentForm.java new file mode 100644 index 0000000000000000000000000000000000000000..b213f426dd5593809171f006fa789a896ec1822b --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentForm.java @@ -0,0 +1,47 @@ +package com.example.myapplication; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.Spinner; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentForm extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + View view = inflater.inflate(R.layout.fragment_form, container, false); + return inflater.inflate(R.layout.fragment_form, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.submit_form_button); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentFoulque.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentFoulque.java new file mode 100644 index 0000000000000000000000000000000000000000..324ad8539cf333ba7a1d3cb278046bdb5cf3081c --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentFoulque.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentFoulque extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_foulque, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_foulque); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentGoeland.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentGoeland.java new file mode 100644 index 0000000000000000000000000000000000000000..ffc31366f988684c6acf9af72ed84f4c9a579e76 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentGoeland.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentGoeland extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_goeland, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_goeland); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentMouette.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentMouette.java new file mode 100644 index 0000000000000000000000000000000000000000..47948e28e67e1d29d1efd65d0e156db30e49a8ae --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentMouette.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentMouette extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_mouette, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_mouette); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentPluvier.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentPluvier.java new file mode 100644 index 0000000000000000000000000000000000000000..7fab249a17260288785e28ea4d0c6acee16cc0bc --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentPluvier.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentPluvier extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_pluvier, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_pluvier); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/OverlayDialogFragmentTadorne.java b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentTadorne.java new file mode 100644 index 0000000000000000000000000000000000000000..1ca876cb47d5b75d0271a8f8c3454c3f5b409562 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/OverlayDialogFragmentTadorne.java @@ -0,0 +1,43 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +public class OverlayDialogFragmentTadorne extends DialogFragment { + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + // Inflate the layout for this dialog fragment + return inflater.inflate(R.layout.fragment_overlay_dialog_tadorne, container, false); + } + + @Override + public void onStart() { + super.onStart(); + if (getDialog() != null && getDialog().getWindow() != null) { + getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent); // Transparent background + } + Button goBackButton=(Button) this.getView().findViewById(R.id.return_tadorne); + + View.OnClickListener listenerGoBackButton=new View.OnClickListener() { + @Override + public void onClick(View view) { + goBack(); + } + }; + + goBackButton.setOnClickListener(listenerGoBackButton); + } + + private void goBack() { + this.getDialog().dismiss(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/PhotoPage.java b/app/src/main/java/com/example/myapplication/PhotoPage.java index b8bb3f19f1ccdad45d64c6903c603d3e8216e4ea..6db91977fec58413c59e63c8221a51ba0766f9d3 100644 --- a/app/src/main/java/com/example/myapplication/PhotoPage.java +++ b/app/src/main/java/com/example/myapplication/PhotoPage.java @@ -1,10 +1,14 @@ package com.example.myapplication; import android.Manifest; +import android.content.ContentResolver; import android.content.Intent; import android.content.pm.PackageManager; +import android.graphics.Bitmap; +import android.net.Uri; import android.os.Build; import android.os.Bundle; +import com.example.myapplication.R; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -13,18 +17,28 @@ import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import android.provider.MediaStore; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.Spinner; import android.widget.TextView; +import java.io.IOException; public class PhotoPage extends Fragment { + private static final int CAMERA_REQUEST_CODE = 3; + private static final int GALLERY_REQUEST_CODE = 1; + private static final int CAMERA_PERMISSION_REQUEST_CODE = 100; + Button cameraButton, folderButton; - TextView textView,txtView; + TextView textPredictionOutput, textProbabilityOutput; ImageView imageView; + FrameLayout formLayout; + int imageSize = 256; @@ -32,13 +46,15 @@ public class PhotoPage extends Fragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_photo_page, container, false); - // Initialize UI elements cameraButton = view.findViewById(R.id.camera_button); folderButton = view.findViewById(R.id.folder_button); - textView = view.findViewById(R.id.textView); - txtView = view.findViewById(R.id.txtView); - imageView = view.findViewById(R.id.imageView); + textPredictionOutput = view.findViewById(R.id.textPredictionOutput); + textProbabilityOutput = view.findViewById(R.id.textProbabilityOutput); + imageView = view.findViewById(R.id.main_image_display); + Button seeTutoButton = view.findViewById(R.id.see_tuto); + + // Set up button click listeners cameraButton.setOnClickListener(new View.OnClickListener() { @@ -47,9 +63,9 @@ public class PhotoPage extends Fragment { public void onClick(View v) { if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); - startActivityForResult(cameraIntent, 3); + startActivityForResult(cameraIntent, CAMERA_REQUEST_CODE); } else { - requestPermissions(new String[]{Manifest.permission.CAMERA}, 100); + requestPermissions(new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_REQUEST_CODE); } } }); @@ -58,10 +74,110 @@ public class PhotoPage extends Fragment { @Override public void onClick(View v) { Intent folderIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); - startActivityForResult(folderIntent, 1); + startActivityForResult(folderIntent, GALLERY_REQUEST_CODE); + } }); + View.OnClickListener lSeeTutoButton = new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(getActivity(), HomeActivity.class); + intent.putExtra("FROM_PHOTO_PAGE", true); + startActivity(intent); + getActivity().finish(); + } + }; + + seeTutoButton.setOnClickListener(lSeeTutoButton); + return view; } -} \ No newline at end of file + + @Override + public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + + if (data == null || resultCode != getActivity().RESULT_OK) { + Log.e("PhotoPage", "Error: Data is null or result not OK"); + return; + } + + switch (requestCode) { + case CAMERA_REQUEST_CODE: + // Handle photo taken with camera + Bitmap cameraImage = (Bitmap) data.getExtras().get("data"); + if (cameraImage != null) { + imageView.setImageBitmap(cameraImage); + processImage(cameraImage); // Pass the image for further processing + showOverlayForm(); + } + break; + + case GALLERY_REQUEST_CODE: + // Handle image picked from the gallery + Uri selectedImageUri = data.getData(); + if (selectedImageUri != null) { + try { + ContentResolver resolver = getContext().getContentResolver(); + Bitmap galleryImage = MediaStore.Images.Media.getBitmap(resolver, selectedImageUri); + imageView.setImageBitmap(galleryImage); + + processImage(galleryImage); // Pass the image for further processing + } catch (IOException e) { + e.printStackTrace(); + Log.e("PhotoPage", "Error loading image from gallery: " + e.getMessage()); + } + } + break; + } + + } + + private void processImage(Bitmap bitmap) { + // Resize and/or preprocess the image for your recognition program + Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, imageSize, imageSize, true); + + // You can pass this `scaledBitmap` to your prediction program + Log.d("PhotoPage", "Bitmap processed for prediction: " + scaledBitmap.toString()); + + try { + TestModeleTflite testModeleTflite = new TestModeleTflite(this.getContext()); + + OutputPredictedImage outputPredictedImage = testModeleTflite.recognizeSpeciesClass(bitmap); + Bitmap annotatedImage = outputPredictedImage.getAnnotatedImage(); + double height = 1.5 * annotatedImage.getHeight(); + double width = 1.5 * annotatedImage.getWidth(); + scaledBitmap = Bitmap.createScaledBitmap(annotatedImage, (int) width, (int) height, true); + imageView.setImageBitmap(scaledBitmap); + //TextView textView = getView().findViewById(R.id.textView2); + textPredictionOutput.setText(outputPredictedImage.toString()); + + } catch (IOException e) { + throw new RuntimeException(e); + } catch (NoSpeciesRecognizedException e) { + textPredictionOutput.setText("Cette espèce n'est pas encore répertoriée."); + } + } + + @RequiresApi(api = Build.VERSION_CODES.M) + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + + if (requestCode == CAMERA_PERMISSION_REQUEST_CODE) { + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); + startActivityForResult(cameraIntent, CAMERA_REQUEST_CODE); + } else { + Log.e("PhotoPage", "Camera permission denied"); + textPredictionOutput.setText("Camera permission denied. Please allow it to use this feature."); + } + } + + } + public void showOverlayForm() { + OverlayDialogFragmentForm overlayDialogForm = new OverlayDialogFragmentForm(); + overlayDialogForm.show(getParentFragmentManager(), "overlayDialogForm"); + } +} diff --git a/app/src/main/java/com/example/myapplication/PublicActivity.java b/app/src/main/java/com/example/myapplication/PublicActivity.java index b26759c3326cf3298f8096d967619a9f4eb09484..fe0336871e3cde8d7bd9a3befa5e7267f5acd643 100644 --- a/app/src/main/java/com/example/myapplication/PublicActivity.java +++ b/app/src/main/java/com/example/myapplication/PublicActivity.java @@ -4,13 +4,11 @@ package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; +import android.content.Intent; import android.os.Bundle; -import android.view.MenuItem; import com.google.android.material.bottomnavigation.BottomNavigationView; -import java.util.Objects; - public class PublicActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { @@ -32,12 +30,14 @@ public class PublicActivity extends AppCompatActivity { bottomNavigationView.setSelectedItemId(R.id.navigation_statistiques); break; case "SettingsPage": + Intent intent = new Intent(PublicActivity.this, PublicActivity.class); + intent.putExtra("TARGET_FRAGMENT", "SettingsPage"); loadFragment(new SettingsPage()); bottomNavigationView.setSelectedItemId(R.id.navigation_parametres); break; case "PhotoPage": loadFragment(new PhotoPage()); - bottomNavigationView.setSelectedItemId(R.id.navigation_documenter); + bottomNavigationView.setSelectedItemId(R.id.navigation_identifier); break; } @@ -52,8 +52,13 @@ public class PublicActivity extends AppCompatActivity { selectedFragment = new StatsPage(); } else if (item.getItemId() == R.id.navigation_parametres) { selectedFragment = new SettingsPage(); - } else { + } else if (item.getItemId() == R.id.navigation_identifier) { selectedFragment = new PhotoPage(); + } else { + selectedFragment=null; + Intent intent = new Intent(PublicActivity.this, HomeActivity.class); + startActivity(intent); + finish(); } loadFragment(selectedFragment); return true; diff --git a/app/src/main/java/com/example/myapplication/SettingsPage.java b/app/src/main/java/com/example/myapplication/SettingsPage.java index d7b6f43eb7211e3ae4db5b055a215ca030e78560..37ef4a1d6a0524c4dc3bc63e8f5a035ea55fab7a 100644 --- a/app/src/main/java/com/example/myapplication/SettingsPage.java +++ b/app/src/main/java/com/example/myapplication/SettingsPage.java @@ -1,12 +1,28 @@ package com.example.myapplication; +import static android.content.Context.MODE_PRIVATE; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.net.Uri; import android.os.Bundle; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.core.content.FileProvider; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.prefs.Preferences; /** * A simple {@link Fragment} subclass. @@ -14,6 +30,8 @@ import android.view.ViewGroup; * create an instance of this fragment. */ public class SettingsPage extends Fragment { + private Button nightModeButton; + private Button downloadButton; // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER @@ -61,4 +79,88 @@ public class SettingsPage extends Fragment { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_settings_page, container, false); } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + // Load the saved theme mode + SharedPreferences preferences = requireContext().getSharedPreferences("theme_prefs", requireContext().MODE_PRIVATE); + int currentMode = preferences.getInt("theme_mode", AppCompatDelegate.MODE_NIGHT_NO); + + nightModeButton = view.findViewById(R.id.night_mode_button); + nightModeButton.setOnClickListener(v -> { + // Toggle between light and dark modes + int newMode = (currentMode == AppCompatDelegate.MODE_NIGHT_NO) + ? AppCompatDelegate.MODE_NIGHT_YES + : AppCompatDelegate.MODE_NIGHT_NO; + + // Apply the theme globally + AppCompatDelegate.setDefaultNightMode(newMode); + + // Save the preference + saveThemeMode(newMode); + }); + + downloadButton = view.findViewById(R.id.download_tuto_button); + downloadButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + // Copy the PDF file from assets to internal storage + File pdfFile = copyPdfToInternalStorage(); + + // Open the PDF if successfully copied + if (pdfFile != null) { + openPdfFile(pdfFile); + } else { + System.out.println("Failed to copy PDF file."); + } + } + }); + } + + private void saveThemeMode(int mode) { + SharedPreferences.Editor editor = requireContext() + .getSharedPreferences("theme_prefs", requireContext().MODE_PRIVATE).edit(); + editor.putInt("theme_mode", mode); + editor.apply(); + } + + private File copyPdfToInternalStorage() { + File outputFile = new File(requireContext().getFilesDir(), "tuto.pdf"); + + // Check if the file already exists to avoid unnecessary copying + if (!outputFile.exists()) { + try (InputStream inputStream = requireContext().getAssets().open("tuto.pdf"); + FileOutputStream outputStream = new FileOutputStream(outputFile)) { + + byte[] buffer = new byte[1024]; + int length; + while ((length = inputStream.read(buffer)) > 0) { + outputStream.write(buffer, 0, length); + } + + System.out.println("PDF successfully copied to: " + outputFile.getAbsolutePath()); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + return outputFile; + } + + private void openPdfFile(File file) { + // Generate a URI using FileProvider + Uri fileUri = FileProvider.getUriForFile(requireContext(), requireContext().getPackageName() + ".fileprovider", file); + + // Create an Intent to view the PDF + Intent viewPdfIntent = new Intent(Intent.ACTION_VIEW); + viewPdfIntent.setDataAndType(fileUri, "application/pdf"); + viewPdfIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + + // Start the activity to open the PDF + Intent chooser = Intent.createChooser(viewPdfIntent, "Open PDF with..."); + startActivity(chooser); + } } \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/Stats.java b/app/src/main/java/com/example/myapplication/Stats.java deleted file mode 100644 index b30e4be17753a652e3ab10c0d95ffd307bd2c929..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/myapplication/Stats.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.example.myapplication; - -import android.os.Bundle; - -import androidx.fragment.app.Fragment; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -public class Stats extends Fragment { - - @Nullable - @Override - public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, - @Nullable Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.fragment_stats, container, false); - -// // Display some sample stats here -// TextView statsText = view.findViewById(R.id.statsText); -// statsText.setText("Here are the stats after successful login!"); - - return view; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/StatsPage.java b/app/src/main/java/com/example/myapplication/StatsPage.java index f56385e68261613a10acda0390c0a0d86c6aac9c..c253f7f8ecd8e44da3b51a20a7c6fd3a11d56d7a 100644 --- a/app/src/main/java/com/example/myapplication/StatsPage.java +++ b/app/src/main/java/com/example/myapplication/StatsPage.java @@ -14,51 +14,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; public class StatsPage extends Fragment { - private static final String VALID_USERNAME = "user"; - private static final String VALID_PASSWORD = "password"; - - private EditText usernameField; - private EditText passwordField; - private Button loginButton; - @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_stats_page, container, false); - usernameField = view.findViewById(R.id.usernameField); - passwordField = view.findViewById(R.id.passwordField); - loginButton = view.findViewById(R.id.loginButton); - - loginButton.setOnClickListener(v -> authenticateUser()); - return view; } - - private void authenticateUser() { - String username = usernameField.getText().toString(); - String password = passwordField.getText().toString(); - - if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) { - Toast.makeText(getContext(), "Please enter both username and password", Toast.LENGTH_SHORT).show(); - return; - } - - if (username.equals(VALID_USERNAME) && password.equals(VALID_PASSWORD)) { - // Navigate to the stats content (replace fragment or show stats content here) - Toast.makeText(getContext(), "Login successful!", Toast.LENGTH_SHORT).show(); - showStatsContent(); - } else { - Toast.makeText(getContext(), "Invalid username or password", Toast.LENGTH_SHORT).show(); - } - } - - private void showStatsContent() { - // Replace the login layout with the stats content once authenticated - // For example, you could replace this fragment or just update the view - getFragmentManager().beginTransaction() - .replace(R.id.fragment_container, new Stats()) - .commit(); - } } \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/TestModeleTflite.java b/app/src/main/java/com/example/myapplication/TestModeleTflite.java new file mode 100644 index 0000000000000000000000000000000000000000..0a1c267ea8d76698decbf36d0631270914e86d0b --- /dev/null +++ b/app/src/main/java/com/example/myapplication/TestModeleTflite.java @@ -0,0 +1,304 @@ +package com.example.myapplication; + +import static android.graphics.Paint.*; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.RectF; + +import org.tensorflow.lite.DataType; +import org.tensorflow.lite.Interpreter; +import org.tensorflow.lite.support.common.FileUtil; +import org.tensorflow.lite.support.common.ops.CastOp; +import org.tensorflow.lite.support.common.ops.NormalizeOp; +import org.tensorflow.lite.support.image.ImageProcessor; +import org.tensorflow.lite.support.image.TensorImage; +import org.tensorflow.lite.support.tensorbuffer.TensorBuffer; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.MappedByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TestModeleTflite { + private static final String MODEL_PATH = "model_float32.tflite"; + private static final String LABEL_PATH = "labels.txt"; + + private static final float INPUT_MEAN = 0f; + private static final float INPUT_STANDARD_DEVIATION = 255f; + private static final DataType INPUT_IMAGE_TYPE = DataType.FLOAT32; + private static final DataType OUTPUT_IMAGE_TYPE = DataType.FLOAT32; + private static final float CONFIDENCE_THRESHOLD = 0.3F; + private static final float IOU_THRESHOLD = 0.5F; + + private Interpreter interpreter; + private int tensorWidth; + private int tensorHeight; + private int numChannel; + private int numElements; + private List<String> labels = new ArrayList<>(); + private ImageProcessor imageProcessor; + + public TestModeleTflite(Context context) throws IOException { + // Load the model + MappedByteBuffer model = FileUtil.loadMappedFile(context, MODEL_PATH); + + // Set interpreter options + Interpreter.Options options = new Interpreter.Options(); + options.setNumThreads(4); + interpreter = new Interpreter(model, options); + + // Get tensor shapes + int[] inputShape = interpreter.getInputTensor(0).shape(); + int[] outputShape = interpreter.getOutputTensor(0).shape(); + + tensorWidth = inputShape[1]; + tensorHeight = inputShape[2]; + numChannel = outputShape[1]; + numElements = outputShape[2]; + + // Load labels + try (InputStream inputStream = context.getAssets().open(LABEL_PATH); + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { + String line; + while ((line = reader.readLine()) != null && !line.isEmpty()) { + labels.add(line); + } + } + + // Initialize image processor + imageProcessor = new ImageProcessor.Builder() + .add(new NormalizeOp(INPUT_MEAN, INPUT_STANDARD_DEVIATION)) + .add(new CastOp(INPUT_IMAGE_TYPE)) + .build(); + } + + public TensorBuffer predict(Bitmap bitmap) { + // Resize bitmap to model's input size + Bitmap resizedBitmap = Bitmap.createScaledBitmap(bitmap, tensorWidth, tensorHeight, false); + + // Preprocess input image + TensorImage tensorImage = new TensorImage(DataType.FLOAT32); + tensorImage.load(resizedBitmap); + TensorImage processedImage = imageProcessor.process(tensorImage); + + // Prepare output buffer + TensorBuffer outputBuffer = TensorBuffer.createFixedSize( + new int[]{1, numChannel, numElements}, + OUTPUT_IMAGE_TYPE + ); + + // Run inference + interpreter.run(processedImage.getBuffer(), outputBuffer.getBuffer()); + + return outputBuffer; + } + + public List<String> getLabels() { + return labels; + } + + public void close() { + if (interpreter != null) { + interpreter.close(); + interpreter = null; + } + } + + public List<BoundingBox> processOutput(TensorBuffer outputBuffer) { + float[] outputArray = outputBuffer.getFloatArray(); + return bestBox(outputArray); + } + + public Bitmap annotateImage(Bitmap inputImage, List<BoundingBox> boxes) { + return drawBoundingBoxes(inputImage, boxes); + } + + private List<BoundingBox> bestBox(float[] array) { + List<BoundingBox> boundingBoxes = new ArrayList<>(); + + for (int c = 0; c < numElements; c++) { + float maxConf = -1.0f; + int maxIdx = -1; + int j = 4; + int arrayIdx = c + numElements * j; + + while (j < numChannel) { + if (array[arrayIdx] > maxConf) { + maxConf = array[arrayIdx]; + maxIdx = j - 4; + } + j++; + arrayIdx += numElements; + } + + if (maxConf > CONFIDENCE_THRESHOLD) { + String clsName = labels.get(maxIdx); + float cx = array[c]; + float cy = array[c + numElements]; + float w = array[c + numElements * 2]; + float h = array[c + numElements * 3]; + float x1 = cx - (w / 2F); + float y1 = cy - (h / 2F); + float x2 = cx + (w / 2F); + float y2 = cy + (h / 2F); + + if (x1 < 0F || x1 > 1F || y1 < 0F || y1 > 1F || x2 < 0F || x2 > 1F || y2 < 0F || y2 > 1F) + continue; + + boundingBoxes.add(new BoundingBox(x1, y1, x2, y2, cx, cy, w, h, maxConf, maxIdx, clsName)); + } + } + + if (boundingBoxes.isEmpty()) return null; + + return applyNMS(boundingBoxes); + } + + private List<BoundingBox> applyNMS(List<BoundingBox> boxes) { + List<BoundingBox> sortedBoxes = new ArrayList<>(boxes); + sortedBoxes.sort((b1, b2) -> Float.compare(b2.cnf, b1.cnf)); // Sort by confidence descending + List<BoundingBox> selectedBoxes = new ArrayList<>(); + + while (!sortedBoxes.isEmpty()) { + BoundingBox first = sortedBoxes.remove(0); + selectedBoxes.add(first); + + sortedBoxes.removeIf(nextBox -> calculateIoU(first, nextBox) >= IOU_THRESHOLD); + } + + return selectedBoxes; + } + + private float calculateIoU(BoundingBox box1, BoundingBox box2) { + float x1 = Math.max(box1.x1, box2.x1); + float y1 = Math.max(box1.y1, box2.y1); + float x2 = Math.min(box1.x2, box2.x2); + float y2 = Math.min(box1.y2, box2.y2); + + float intersectionArea = Math.max(0F, x2 - x1) * Math.max(0F, y2 - y1); + float box1Area = box1.w * box1.h; + float box2Area = box2.w * box2.h; + + return intersectionArea / (box1Area + box2Area - intersectionArea); + } + + + + private Bitmap drawBoundingBoxes(Bitmap bitmap, List<BoundingBox> boxes) { + Bitmap mutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true); + Canvas canvas = new Canvas(mutableBitmap); + + Paint paint = new Paint(); + paint.setColor(Color.RED); + paint.setStyle(Style.STROKE); + paint.setStrokeWidth(8f); + + Paint textPaint = new Paint(); + textPaint.setColor(Color.WHITE); + textPaint.setTextSize(40f); + //textPaint.setTypeface(Paint.DEFAULT_BOLD); + + for (BoundingBox box : boxes) { + RectF rect = new RectF( + box.x1 * mutableBitmap.getWidth(), + box.y1 * mutableBitmap.getHeight(), + box.x2 * mutableBitmap.getWidth(), + box.y2 * mutableBitmap.getHeight() + ); + canvas.drawRect(rect, paint); + canvas.drawText(box.clsName, rect.left, rect.bottom, textPaint); + canvas.drawText(new StringBuilder().append("prob : ").append(String.format("%.2f", box.cnf)).toString(), rect.left, rect.top, textPaint); + } + + return mutableBitmap; + } + + /** + * Loads an image from the specified file path and converts it to a Bitmap. + * + * @param fileName Path to the image file. + * @return Bitmap representation of the image or null if an error occurs. + */ + public static Bitmap loadImage(String fileName, Context context) { + try (InputStream inputStream = context.getAssets().open(fileName)) { + return BitmapFactory.decodeStream(inputStream); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + public Bitmap recognizeSpecies(Bitmap inputImage){ + TensorBuffer outputBuffer = predict(inputImage); + List<BoundingBox> boxes = processOutput(outputBuffer); + return annotateImage(inputImage, boxes); + } + + public OutputPredictedImage recognizeSpeciesClass(Bitmap inputImage) throws NoSpeciesRecognizedException { + //ArrayList<String> speciesNames = new ArrayList<>(); + Map<String, Integer> predictionResults = new HashMap<>(); + TensorBuffer outputBuffer = predict(inputImage); + List<BoundingBox> boxes = processOutput(outputBuffer); + if(boxes != null){ + for(BoundingBox box:boxes){ + if(predictionResults.containsKey(box.clsName)){ + int previousNumber = predictionResults.get(box.clsName); + predictionResults.put(box.clsName, previousNumber + 1); + }else{ + predictionResults.put(box.clsName, 1); + } + + } + Bitmap annotatedImage = annotateImage(inputImage, boxes); + return new OutputPredictedImage(annotatedImage, predictionResults); + }else throw new NoSpeciesRecognizedException(); + } + + + public static void main(String [] args){ + /* + TestModeleTflite testModeleTflite = new TestModeleTflite(this); + String imagePath = "../../res/drawable/bernache_cravant.jpg"; + Bitmap inputImage = TestModeleTflite.loadImage(imagePath); + + if (inputImage == null) { + System.out.println("Failed to load the image. Check the file path."); + return; + } + + // Perform prediction + TensorBuffer outputBuffer = testModeleTflite.predict(inputImage); + + // Process the output to get bounding boxes + List<BoundingBox> boxes = testModeleTflite.processOutput(outputBuffer); + + if (boxes == null || boxes.isEmpty()) { + System.out.println("No objects detected in the image."); + } else { + // Output results to the console + for (BoundingBox box : boxes) { + System.out.println("Class: " + box.clsName); + System.out.println("Confidence: " + box.cnf); + System.out.println("----------------------------"); + } + }*/ + String currentDir = System.getProperty("user.dir"); + System.out.println("Current working directory: " + currentDir); + } + + + +} + diff --git a/app/src/main/java/com/example/myapplication/TutorialActivity.java b/app/src/main/java/com/example/myapplication/TutorialActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..9749d0026ec28f764835c03ab945d1071d485d4f --- /dev/null +++ b/app/src/main/java/com/example/myapplication/TutorialActivity.java @@ -0,0 +1,79 @@ +package com.example.myapplication; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.content.ContextCompat; +import androidx.viewpager2.widget.ViewPager2; + +import java.util.Arrays; +import java.util.List; + +public class TutorialActivity extends AppCompatActivity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_tutorial); + + ViewPager2 viewPager2=findViewById(R.id.tutorial_viewpager); + + List<Integer> layouts = Arrays.asList( + R.layout.fragment_tutorial_page1, + R.layout.fragment_tutorial_page2, + R.layout.fragment_tutorial_page3 + ); + TutorialFragmentAdapter adapter = new TutorialFragmentAdapter(this, layouts); + viewPager2.setAdapter(adapter); + LinearLayout dotsLayout = findViewById(R.id.dots_layout); + Button tutoEndButton = findViewById(R.id.tuto_end_button); + + View.OnClickListener lTutoEndButton = new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(TutorialActivity.this, HomeActivity.class); + intent.putExtra("PREFERENCES", false); + startActivity(intent); + finish(); + } + }; + tutoEndButton.setOnClickListener(lTutoEndButton); + + // Add dots based on page count + int pageCount = layouts.size(); + ImageView[] dots = new ImageView[pageCount]; + for (int i = 0; i < pageCount; i++) { + dots[i] = new ImageView(this); + dots[i].setImageDrawable(ContextCompat.getDrawable(this, R.drawable.dot_inactive)); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.WRAP_CONTENT + ); + params.setMargins(8, 0, 8, 0); + dots[i].setLayoutParams(params); + dotsLayout.addView(dots[i]); + } + + // Highlight the first dot + dots[0].setImageDrawable(ContextCompat.getDrawable(this, R.drawable.dot_active)); + + // Update dots on page change + viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { + @Override + public void onPageSelected(int position) { + if (position==2) tutoEndButton.setVisibility(View.VISIBLE); + else tutoEndButton.setVisibility(View.INVISIBLE); + for (int i = 0; i < pageCount; i++) { + dots[i].setImageDrawable(ContextCompat.getDrawable( + getApplicationContext(), + i == position ? R.drawable.dot_active : R.drawable.dot_inactive + )); + } + } + }); + } +} diff --git a/app/src/main/java/com/example/myapplication/TutorialFragmentAdapter.java b/app/src/main/java/com/example/myapplication/TutorialFragmentAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..1deec3b60cf50807ef9c57a7af0f5620bce3e79b --- /dev/null +++ b/app/src/main/java/com/example/myapplication/TutorialFragmentAdapter.java @@ -0,0 +1,29 @@ +package com.example.myapplication; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.viewpager2.adapter.FragmentStateAdapter; + +import java.util.List; + +public class TutorialFragmentAdapter extends FragmentStateAdapter { + private final List<Integer> layouts; + + public TutorialFragmentAdapter(@NonNull FragmentActivity fragmentActivity, List<Integer> layouts) { + super(fragmentActivity); + this.layouts = layouts; + } + + @NonNull + @Override + public Fragment createFragment(int position) { + return TutorialPageFragment.newInstance(layouts.get(position)); + } + + @Override + public int getItemCount() { + return layouts.size(); + } +} + diff --git a/app/src/main/java/com/example/myapplication/TutorialPageFragment.java b/app/src/main/java/com/example/myapplication/TutorialPageFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..803cea3530f0dd9caa401dd308558164ef06744d --- /dev/null +++ b/app/src/main/java/com/example/myapplication/TutorialPageFragment.java @@ -0,0 +1,30 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +public class TutorialPageFragment extends Fragment { + private static final String ARG_LAYOUT_ID = "layout_id"; + + public static TutorialPageFragment newInstance(int layoutId) { + TutorialPageFragment fragment = new TutorialPageFragment(); + Bundle args = new Bundle(); + args.putInt(ARG_LAYOUT_ID, layoutId); + fragment.setArguments(args); + return fragment; + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + int layoutId = getArguments() != null ? getArguments().getInt(ARG_LAYOUT_ID) : 0; + return inflater.inflate(layoutId, container, false); + } +} diff --git a/app/src/main/logo-playstore.png b/app/src/main/logo-playstore.png new file mode 100644 index 0000000000000000000000000000000000000000..93c4f249eb552b997b33b9b85447358c39a0fa95 Binary files /dev/null and b/app/src/main/logo-playstore.png differ diff --git a/app/src/main/logo2-playstore.png b/app/src/main/logo2-playstore.png new file mode 100644 index 0000000000000000000000000000000000000000..302370633cf0f22a85e3fb18b46aec10a6aec845 Binary files /dev/null and b/app/src/main/logo2-playstore.png differ diff --git a/app/src/main/plunv_logo-playstore.png b/app/src/main/plunv_logo-playstore.png new file mode 100644 index 0000000000000000000000000000000000000000..951f24dddfde53f12743c1d9ea8a64fe1f7426be Binary files /dev/null and b/app/src/main/plunv_logo-playstore.png differ diff --git a/app/src/main/res/drawable/avi_main.png b/app/src/main/res/drawable/avi_main.png new file mode 100644 index 0000000000000000000000000000000000000000..4330ea4282dc8a3a26aaa2762619d4b5be788bf8 Binary files /dev/null and b/app/src/main/res/drawable/avi_main.png differ diff --git a/app/src/main/res/drawable/avi_main_black.png b/app/src/main/res/drawable/avi_main_black.png new file mode 100644 index 0000000000000000000000000000000000000000..95e0a0482f4589557a04345bb797ce7968112e77 Binary files /dev/null and b/app/src/main/res/drawable/avi_main_black.png differ diff --git a/app/src/main/res/drawable/becasseau_sanderling.png b/app/src/main/res/drawable/becasseau_sanderling.png new file mode 100644 index 0000000000000000000000000000000000000000..43a59703f0ede679c7cdc48509df047c74d1b8d4 Binary files /dev/null and b/app/src/main/res/drawable/becasseau_sanderling.png differ diff --git a/app/src/main/res/drawable/becasseau_sanderling_2.png b/app/src/main/res/drawable/becasseau_sanderling_2.png new file mode 100644 index 0000000000000000000000000000000000000000..1e5d1d1186ecd6657b8ddad037eb2955bcb26876 Binary files /dev/null and b/app/src/main/res/drawable/becasseau_sanderling_2.png differ diff --git a/app/src/main/res/drawable/bernache_cravant.jpg b/app/src/main/res/drawable/bernache_cravant.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9ecd3dcdb3c3a7103a14a750a9554c68d2f602e5 Binary files /dev/null and b/app/src/main/res/drawable/bernache_cravant.jpg differ diff --git a/app/src/main/res/drawable/camera.png b/app/src/main/res/drawable/camera.png index 2d8c79f06f4f539e734c4e202de19070188be598..62de7e7f8a3d36074c34d9b2ebc042d1a27e81b1 100644 Binary files a/app/src/main/res/drawable/camera.png and b/app/src/main/res/drawable/camera.png differ diff --git a/app/src/main/res/drawable/camera_tiny.png b/app/src/main/res/drawable/camera_tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..97495e62d1f21e4ccd95aa1e8c8b50145f513316 Binary files /dev/null and b/app/src/main/res/drawable/camera_tiny.png differ diff --git a/app/src/main/res/drawable/chevalier_gambette.jpg b/app/src/main/res/drawable/chevalier_gambette.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8e34286f40aacdc6c74f55090926c70d675d54a1 Binary files /dev/null and b/app/src/main/res/drawable/chevalier_gambette.jpg differ diff --git a/app/src/main/res/drawable/dot_active.xml b/app/src/main/res/drawable/dot_active.xml new file mode 100644 index 0000000000000000000000000000000000000000..65e93ce484a9ac144c3df6ee5ca5f4c901db3910 --- /dev/null +++ b/app/src/main/res/drawable/dot_active.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <corners android:radius="50dp"/> + <solid android:color="@color/white"/> + <size android:width="16dp" android:height="16dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/dot_inactive.xml b/app/src/main/res/drawable/dot_inactive.xml new file mode 100644 index 0000000000000000000000000000000000000000..49a1c479a3912c9bf1916f20ea7848b67f854823 --- /dev/null +++ b/app/src/main/res/drawable/dot_inactive.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <corners android:radius="50dp"/> + <solid android:color="#777777"/> + <size android:width="12dp" android:height="12dp"/> +</shape> diff --git a/app/src/main/res/drawable/folder.png b/app/src/main/res/drawable/folder.png new file mode 100644 index 0000000000000000000000000000000000000000..58d61251a8604a183cf1867068252bef8cc648f7 Binary files /dev/null and b/app/src/main/res/drawable/folder.png differ diff --git a/app/src/main/res/drawable/foulque_macroule.jpg b/app/src/main/res/drawable/foulque_macroule.jpg new file mode 100644 index 0000000000000000000000000000000000000000..60efbe4e30d17a876e9366056ef481418b3028d4 Binary files /dev/null and b/app/src/main/res/drawable/foulque_macroule.jpg differ diff --git a/app/src/main/res/drawable/gallery.png b/app/src/main/res/drawable/gallery.png new file mode 100644 index 0000000000000000000000000000000000000000..48ff824023c65cab7f6f03fc82b0ac01dc0f5417 Binary files /dev/null and b/app/src/main/res/drawable/gallery.png differ diff --git a/app/src/main/res/drawable/goeland.jpg b/app/src/main/res/drawable/goeland.jpg new file mode 100644 index 0000000000000000000000000000000000000000..49dccd0ce39448482e0fb050f8578ad6da93a1a3 Binary files /dev/null and b/app/src/main/res/drawable/goeland.jpg differ diff --git a/app/src/main/res/drawable/goeland_2.jpg b/app/src/main/res/drawable/goeland_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a2234d6d412cc124414247ce2fbcfcc53320795 Binary files /dev/null and b/app/src/main/res/drawable/goeland_2.jpg differ diff --git a/app/src/main/res/drawable/goeland_3.jpg b/app/src/main/res/drawable/goeland_3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bd66bdfecf3dbd3d27651992bb630cffbd352c51 Binary files /dev/null and b/app/src/main/res/drawable/goeland_3.jpg differ diff --git a/app/src/main/res/drawable/goeland_argente.jpeg b/app/src/main/res/drawable/goeland_argente.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4bebcf8db9418e09d37569ee0884e030094b08a7 Binary files /dev/null and b/app/src/main/res/drawable/goeland_argente.jpeg differ diff --git a/app/src/main/res/drawable/grand_cormoran.jpg b/app/src/main/res/drawable/grand_cormoran.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f9f03fd20966ce52c65b6c82de6c4a9536d34dbf Binary files /dev/null and b/app/src/main/res/drawable/grand_cormoran.jpg differ diff --git a/app/src/main/res/drawable/image_1.png b/app/src/main/res/drawable/image_1.png index 3f812ae09bcf8f7a63372ac96dc4dfc23257fa87..22b879d3af8c89003cdbe6f42f3d437efa2ea5ac 100644 Binary files a/app/src/main/res/drawable/image_1.png and b/app/src/main/res/drawable/image_1.png differ diff --git a/app/src/main/res/drawable/item_background_selector.xml b/app/src/main/res/drawable/item_background_selector.xml new file mode 100644 index 0000000000000000000000000000000000000000..dde2608565ddd983dfc8ceb32a15f072c15729f3 --- /dev/null +++ b/app/src/main/res/drawable/item_background_selector.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid + android:color="#3D5062"/> + <corners + android:radius="50dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/learn.png b/app/src/main/res/drawable/learn.png new file mode 100644 index 0000000000000000000000000000000000000000..77eb3dfe7e0dd1ebf07577b326809e20069f783c Binary files /dev/null and b/app/src/main/res/drawable/learn.png differ diff --git a/app/src/main/res/drawable/line_1.png b/app/src/main/res/drawable/line_1.png new file mode 100644 index 0000000000000000000000000000000000000000..078434dab950e3cf3c1fda5a155c947f03498b53 Binary files /dev/null and b/app/src/main/res/drawable/line_1.png differ diff --git a/app/src/main/res/drawable/line_2.png b/app/src/main/res/drawable/line_2.png new file mode 100644 index 0000000000000000000000000000000000000000..762f936140319731be058b5b453687eb55979dc8 Binary files /dev/null and b/app/src/main/res/drawable/line_2.png differ diff --git a/app/src/main/res/drawable/line_3.png b/app/src/main/res/drawable/line_3.png new file mode 100644 index 0000000000000000000000000000000000000000..301662b5eae2fd24fd411414bb01fe2c8716e2ab Binary files /dev/null and b/app/src/main/res/drawable/line_3.png differ diff --git a/app/src/main/res/drawable/line_4.png b/app/src/main/res/drawable/line_4.png new file mode 100644 index 0000000000000000000000000000000000000000..6861591a717c1df0ba17991e2407c064c1223099 Binary files /dev/null and b/app/src/main/res/drawable/line_4.png differ diff --git a/app/src/main/res/drawable/line_5.png b/app/src/main/res/drawable/line_5.png new file mode 100644 index 0000000000000000000000000000000000000000..06cac791b7eeead352ea16ec479e626d3efa8e76 Binary files /dev/null and b/app/src/main/res/drawable/line_5.png differ diff --git a/app/src/main/res/drawable/line_6.png b/app/src/main/res/drawable/line_6.png new file mode 100644 index 0000000000000000000000000000000000000000..03473bb64723ce01f39d3339cf2be3b4d9d9953e Binary files /dev/null and b/app/src/main/res/drawable/line_6.png differ diff --git a/app/src/main/res/drawable/logo_main.png b/app/src/main/res/drawable/logo_main.png new file mode 100644 index 0000000000000000000000000000000000000000..fa4236f74d6ae14358950bf86c8c9c4091d3d9a4 Binary files /dev/null and b/app/src/main/res/drawable/logo_main.png differ diff --git a/app/src/main/res/drawable/logo_main_black.png b/app/src/main/res/drawable/logo_main_black.png new file mode 100644 index 0000000000000000000000000000000000000000..b0ecc205545c40782691e4bc26f613e099acb408 Binary files /dev/null and b/app/src/main/res/drawable/logo_main_black.png differ diff --git a/app/src/main/res/drawable/moon.png b/app/src/main/res/drawable/moon.png new file mode 100644 index 0000000000000000000000000000000000000000..f73bbf6ab82905ef0cea45b1c550d4d182956518 Binary files /dev/null and b/app/src/main/res/drawable/moon.png differ diff --git a/app/src/main/res/drawable/mouette_rieuse.jpg b/app/src/main/res/drawable/mouette_rieuse.jpg new file mode 100644 index 0000000000000000000000000000000000000000..91d4dd930610d28a3f495182419cea0c6f4c5e46 Binary files /dev/null and b/app/src/main/res/drawable/mouette_rieuse.jpg differ diff --git a/app/src/main/res/drawable/nav_item_background_selector.xml b/app/src/main/res/drawable/nav_item_background_selector.xml new file mode 100644 index 0000000000000000000000000000000000000000..28bd142da564b67c825b14dbdf70dedd5d107661 --- /dev/null +++ b/app/src/main/res/drawable/nav_item_background_selector.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/item_background_selector" android:state_selected="true" /> + <item android:drawable="@drawable/transparent"/> +</selector> diff --git a/app/src/main/res/drawable/navigation_button_left.png b/app/src/main/res/drawable/navigation_button_left.png new file mode 100644 index 0000000000000000000000000000000000000000..1b28249dc18b68de7bfbd05d9f31d9e32446d6cf Binary files /dev/null and b/app/src/main/res/drawable/navigation_button_left.png differ diff --git a/app/src/main/res/drawable/navigation_button_right.png b/app/src/main/res/drawable/navigation_button_right.png new file mode 100644 index 0000000000000000000000000000000000000000..da494ccce7171007074f0446db995683cc8c7f33 Binary files /dev/null and b/app/src/main/res/drawable/navigation_button_right.png differ diff --git a/app/src/main/res/drawable/openstreetmap.png b/app/src/main/res/drawable/openstreetmap.png new file mode 100644 index 0000000000000000000000000000000000000000..2c825c14aeed1e83cbe425d0caa32b35ac94d6d5 Binary files /dev/null and b/app/src/main/res/drawable/openstreetmap.png differ diff --git a/app/src/main/res/drawable/plunv.png b/app/src/main/res/drawable/plunv.png new file mode 100644 index 0000000000000000000000000000000000000000..6dcd807a458121cf6083a38467f788bb8fc0c241 Binary files /dev/null and b/app/src/main/res/drawable/plunv.png differ diff --git a/app/src/main/res/drawable/plunv_black.png b/app/src/main/res/drawable/plunv_black.png new file mode 100644 index 0000000000000000000000000000000000000000..de25ae8254c2e4f963ed79b30a4f1bbb4189cda4 Binary files /dev/null and b/app/src/main/res/drawable/plunv_black.png differ diff --git a/app/src/main/res/drawable/plunv_logo.png b/app/src/main/res/drawable/plunv_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..154f25bb36d3362a8e2fe2541b8f70e855ddd2ee Binary files /dev/null and b/app/src/main/res/drawable/plunv_logo.png differ diff --git a/app/src/main/res/drawable/plunv_logo_foreground.xml b/app/src/main/res/drawable/plunv_logo_foreground.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ba4d7d01446287e92473c77259c9c0bcd39f4fd --- /dev/null +++ b/app/src/main/res/drawable/plunv_logo_foreground.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <group android:scaleX="0.46" + android:scaleY="0.46" + android:translateX="29.16" + android:translateY="29.16"> + <group android:translateY="132.82031"> + </group> + </group> +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/pluvier_argente.jpg b/app/src/main/res/drawable/pluvier_argente.jpg new file mode 100644 index 0000000000000000000000000000000000000000..56e0430e0b8e26d73f31c96078e893a7405eea1b Binary files /dev/null and b/app/src/main/res/drawable/pluvier_argente.jpg differ diff --git a/app/src/main/res/drawable/polygon_10.png b/app/src/main/res/drawable/polygon_10.png new file mode 100644 index 0000000000000000000000000000000000000000..3057c3a93b54fd8ae4ed9d2a6df59ea58f6811c8 Binary files /dev/null and b/app/src/main/res/drawable/polygon_10.png differ diff --git a/app/src/main/res/drawable/polygon_11.png b/app/src/main/res/drawable/polygon_11.png new file mode 100644 index 0000000000000000000000000000000000000000..2f51179594555dd88bc7d2a834a9a8a51584d28a Binary files /dev/null and b/app/src/main/res/drawable/polygon_11.png differ diff --git a/app/src/main/res/drawable/polygon_12.png b/app/src/main/res/drawable/polygon_12.png new file mode 100644 index 0000000000000000000000000000000000000000..4d63a0cced8ae283030cea7a510c86bc93c8893c Binary files /dev/null and b/app/src/main/res/drawable/polygon_12.png differ diff --git a/app/src/main/res/drawable/polygon_13.png b/app/src/main/res/drawable/polygon_13.png new file mode 100644 index 0000000000000000000000000000000000000000..03b3529f522522127155df0b5c2065d4125f97af Binary files /dev/null and b/app/src/main/res/drawable/polygon_13.png differ diff --git a/app/src/main/res/drawable/polygon_14.png b/app/src/main/res/drawable/polygon_14.png new file mode 100644 index 0000000000000000000000000000000000000000..5196f858fac9a6ce8e5bad078e79b7433a57be1a Binary files /dev/null and b/app/src/main/res/drawable/polygon_14.png differ diff --git a/app/src/main/res/drawable/polygon_15.png b/app/src/main/res/drawable/polygon_15.png new file mode 100644 index 0000000000000000000000000000000000000000..637e9b7d47bb2444a43ae4fe9d562b2105513ea5 Binary files /dev/null and b/app/src/main/res/drawable/polygon_15.png differ diff --git a/app/src/main/res/drawable/polygon_4.png b/app/src/main/res/drawable/polygon_4.png index f91b4398dfc34c48615cd6cb879e785c7c590030..8c8b0ec782c7fb4c55d79a35fd4a1674f0a67ac1 100644 Binary files a/app/src/main/res/drawable/polygon_4.png and b/app/src/main/res/drawable/polygon_4.png differ diff --git a/app/src/main/res/drawable/polygon_5.png b/app/src/main/res/drawable/polygon_5.png new file mode 100644 index 0000000000000000000000000000000000000000..c7b78e33bd52fec28ae6e980af507fc78dc763f0 Binary files /dev/null and b/app/src/main/res/drawable/polygon_5.png differ diff --git a/app/src/main/res/drawable/polygon_6.png b/app/src/main/res/drawable/polygon_6.png new file mode 100644 index 0000000000000000000000000000000000000000..ffc0e9acbf3abc9fd7cc58544a8375ba3f60b267 Binary files /dev/null and b/app/src/main/res/drawable/polygon_6.png differ diff --git a/app/src/main/res/drawable/polygon_7.png b/app/src/main/res/drawable/polygon_7.png new file mode 100644 index 0000000000000000000000000000000000000000..4b8f59f91a77324de60666327752d6bab45690b0 Binary files /dev/null and b/app/src/main/res/drawable/polygon_7.png differ diff --git a/app/src/main/res/drawable/polygon_8.png b/app/src/main/res/drawable/polygon_8.png new file mode 100644 index 0000000000000000000000000000000000000000..216664e051d44efd0f3205a7f0a93d6b938a47f7 Binary files /dev/null and b/app/src/main/res/drawable/polygon_8.png differ diff --git a/app/src/main/res/drawable/polygon_9.png b/app/src/main/res/drawable/polygon_9.png new file mode 100644 index 0000000000000000000000000000000000000000..9e8475b398ddfc01621d79cbf6ff3b1af89586ec Binary files /dev/null and b/app/src/main/res/drawable/polygon_9.png differ diff --git a/app/src/main/res/drawable/rectangle_2.png b/app/src/main/res/drawable/rectangle_2.png new file mode 100644 index 0000000000000000000000000000000000000000..6b38713648851de242fbd0878bebe2a09fadea8a Binary files /dev/null and b/app/src/main/res/drawable/rectangle_2.png differ diff --git a/app/src/main/res/drawable/shape.xml b/app/src/main/res/drawable/shape.xml index ec7bf812f8af5efd7f5563b4d18b6cb971e4d5b4..5e316d3fb35d164c4ffd58e033996d869c51c503 100644 --- a/app/src/main/res/drawable/shape.xml +++ b/app/src/main/res/drawable/shape.xml @@ -3,7 +3,7 @@ android:shape="rectangle" > <solid - android:color="@color/white" > + android:color="@color/white"> </solid> <stroke @@ -19,7 +19,7 @@ </padding> <corners - android:radius="15dp" > + android:radius="8dp"> </corners> </shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_1.png b/app/src/main/res/drawable/shape_1.png new file mode 100644 index 0000000000000000000000000000000000000000..b32468f0fdbe3e773e13e4847694b5cf3dc1b72b Binary files /dev/null and b/app/src/main/res/drawable/shape_1.png differ diff --git a/app/src/main/res/drawable/shape_2.png b/app/src/main/res/drawable/shape_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e41a777f136836a2e4d5e176eaa499a5297abaab Binary files /dev/null and b/app/src/main/res/drawable/shape_2.png differ diff --git a/app/src/main/res/drawable/shape_3.png b/app/src/main/res/drawable/shape_3.png new file mode 100644 index 0000000000000000000000000000000000000000..fd261cf00d47f04860a7787caebf1ba29c89ad66 Binary files /dev/null and b/app/src/main/res/drawable/shape_3.png differ diff --git a/app/src/main/res/drawable/shape_transparent.xml b/app/src/main/res/drawable/shape_transparent.xml new file mode 100644 index 0000000000000000000000000000000000000000..e867f3d78ce1e06de009a5d18d505928f91adf01 --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent.xml @@ -0,0 +1,19 @@ +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle" > + + <solid + android:color="#F0D9D9D9"> + </solid> + + <padding + android:left="5dp" + android:top="5dp" + android:right="5dp" + android:bottom="5dp" > + </padding> + + <corners + android:radius="8dp"> + </corners> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_transparent_black.xml b/app/src/main/res/drawable/shape_transparent_black.xml new file mode 100644 index 0000000000000000000000000000000000000000..d6891cb45cdd5fa74a15deb588af7946487a16ac --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent_black.xml @@ -0,0 +1,19 @@ +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle" > + + <solid + android:color="#F0121212"> + </solid> + + <padding + android:left="5dp" + android:top="5dp" + android:right="5dp" + android:bottom="5dp" > + </padding> + + <corners + android:radius="8dp"> + </corners> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_transparent_black_bottom_rounded.xml b/app/src/main/res/drawable/shape_transparent_black_bottom_rounded.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb3763d8a3672cdba55742c7cae91ec69c9c6e77 --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent_black_bottom_rounded.xml @@ -0,0 +1,15 @@ +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + + <solid android:color="#F0121212"/> + + <padding + android:bottom="5dp" + android:left="5dp" + android:right="5dp" + android:top="5dp"/> + + <corners + android:bottomLeftRadius="8dp" + android:bottomRightRadius="8dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_transparent_black_top_rounded.xml b/app/src/main/res/drawable/shape_transparent_black_top_rounded.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c2ee235716446e268d053fac16b06fb25fc96c5 --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent_black_top_rounded.xml @@ -0,0 +1,20 @@ +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle" > + + <solid + android:color="#F0121212"> + </solid> + + <padding + android:left="5dp" + android:top="5dp" + android:right="5dp" + android:bottom="5dp" > + </padding> + + <corners + android:topLeftRadius="8dp" + android:topRightRadius="8dp"> + </corners> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_transparent_blue.xml b/app/src/main/res/drawable/shape_transparent_blue.xml new file mode 100644 index 0000000000000000000000000000000000000000..353b83ad1352ff88dd96c4c165e87d43eea4179b --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent_blue.xml @@ -0,0 +1,25 @@ +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle" > + + <solid + android:color="@color/white"> + </solid> + + <stroke + android:width="2dp" + android:color="#00FFFFFF" > + </stroke> + + <padding + android:left="5dp" + android:top="5dp" + android:right="5dp" + android:bottom="5dp" > + </padding> + + <corners + android:radius="8dp"> + </corners> + <solid android:color="#E6517293" /> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_transparent_bottom_rounded.xml b/app/src/main/res/drawable/shape_transparent_bottom_rounded.xml new file mode 100644 index 0000000000000000000000000000000000000000..c2ffc78262bc19f8215b0ab8fbe2f3e877867262 --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent_bottom_rounded.xml @@ -0,0 +1,20 @@ +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + + <solid + android:color="#F0D9D9D9"> + </solid> + + <padding + android:left="5dp" + android:top="5dp" + android:right="5dp" + android:bottom="5dp" > + </padding> + + <corners + android:bottomLeftRadius="8dp" + android:bottomRightRadius="8dp"> + </corners> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_transparent_top_rounded.xml b/app/src/main/res/drawable/shape_transparent_top_rounded.xml new file mode 100644 index 0000000000000000000000000000000000000000..fb12f2df1356697faad8c80378e9561115a1b613 --- /dev/null +++ b/app/src/main/res/drawable/shape_transparent_top_rounded.xml @@ -0,0 +1,20 @@ +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle" > + + <solid + android:color="#F0D9D9D9"> + </solid> + + <padding + android:left="5dp" + android:top="5dp" + android:right="5dp" + android:bottom="5dp" > + </padding> + + <corners + android:topLeftRadius="8dp" + android:topRightRadius="8dp"> + </corners> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/tadorne_de_belon.jpg b/app/src/main/res/drawable/tadorne_de_belon.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d62d0137427f6575d0be25836e13b5f6ae1b285d Binary files /dev/null and b/app/src/main/res/drawable/tadorne_de_belon.jpg differ diff --git a/app/src/main/res/drawable/transparent.xml b/app/src/main/res/drawable/transparent.xml new file mode 100644 index 0000000000000000000000000000000000000000..b9656fabc78352b1891fc33d2342da6059e92101 --- /dev/null +++ b/app/src/main/res/drawable/transparent.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid + android:color="#00000000"/> + <corners + android:radius="50dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/tuto_becasseau_desc.png b/app/src/main/res/drawable/tuto_becasseau_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b59d2d7bad5fc3f46a73e496686853dfd3d6a3 Binary files /dev/null and b/app/src/main/res/drawable/tuto_becasseau_desc.png differ diff --git a/app/src/main/res/font/tauri.xml b/app/src/main/res/font/tauri.xml new file mode 100644 index 0000000000000000000000000000000000000000..574c9d03abaad2ad0081a512b0d18e7b41ae2adf --- /dev/null +++ b/app/src/main/res/font/tauri.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<font-family xmlns:app="http://schemas.android.com/apk/res-auto" + app:fontProviderAuthority="com.google.android.gms.fonts" + app:fontProviderPackage="com.google.android.gms" + app:fontProviderQuery="Tauri" + app:fontProviderCerts="@array/com_google_android_gms_fonts_certs"> +</font-family> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index bc822ed17d580617a10d3c1f826228dbceb37b5c..ce1449d0a00570dd597447ff76ddce38179f42cd 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -9,34 +9,34 @@ tools:context=".PublicActivity"> <ImageView - android:alpha="0.4" android:id="@+id/image_1" android:layout_width="match_parent" android:layout_height="match_parent" + android:alpha="0.4" android:scaleType="centerCrop" android:src="@drawable/image_1" - app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toTopOf="@id/bottom_navigation" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"/> + app:layout_constraintTop_toTopOf="parent" /> <ImageView + style="@style/BigPolygon" android:id="@+id/polygon_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start|center_vertical" android:layout_marginBottom="25dp" - android:alpha="0.75" - android:src="@drawable/polygon_2" /> + android:alpha="0.75" /> <ImageView + style="@style/BottomPolygon" android:id="@+id/polygon_4" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:src="@drawable/polygon_4" - android:alpha="0.75" android:layout_gravity="center_horizontal|bottom" - /> + android:alpha="0.75" + android:scaleType="fitXY" /> <ImageView android:id="@+id/image_2" @@ -44,111 +44,102 @@ android:layout_height="48.6dp" android:layout_gravity="bottom|center_horizontal" android:layout_marginBottom="20dp" - android:src="@drawable/image_2" - /> + android:src="@drawable/image_2" /> <ImageView + style="@style/MiniRectangle" android:id="@+id/rectangle_5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginBottom="266dp" - android:src="@drawable/rectangle_1" - /> + android:layout_marginBottom="266dp" /> <Button android:id="@+id/learning_button" + style="@style/ButtonAppearance" android:layout_width="168dp" android:layout_height="124dp" + android:layout_gravity="center_vertical" android:layout_marginStart="34dp" android:layout_marginBottom="266dp" - android:layout_gravity="center_vertical" - android:backgroundTint="#517293" android:drawableLeft="@drawable/book" android:fontFamily="@font/inter" - android:text="@string/learn" - android:textSize="20sp" - android:rotation="-5" - android:paddingRight="5dp" android:paddingLeft="5dp" - style="@style/ButtonAppearance"/> + android:paddingRight="5dp" + android:rotation="-5" + android:text="@string/learn" + android:textSize="20sp" /> <ImageView + style="@style/MiniRectangle" android:id="@+id/rectangle_6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginBottom="97dp" - android:src="@drawable/rectangle_1" - /> + android:layout_marginBottom="97dp" /> + + <ImageView + style="@style/MiniRectangle" + android:id="@+id/rectangle_8" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginTop="241dp" /> <Button android:id="@+id/settings_button" + style="@style/ButtonAppearance" android:layout_width="168dp" android:layout_height="124dp" + android:layout_gravity="center_vertical" android:layout_marginStart="34dp" android:layout_marginTop="241dp" - android:layout_gravity="center_vertical" - android:backgroundTint="#517293" android:drawableLeft="@drawable/param" android:fontFamily="@font/inter" - android:text="@string/settings" - android:textSize="20sp" - android:rotation="-5" - android:paddingRight="5dp" android:paddingLeft="5dp" - style="@style/ButtonAppearance"/> + android:paddingRight="5dp" + android:rotation="-5" + android:text="@string/settings" + android:textSize="20sp" /> <ImageView + style="@style/MiniRectangle" android:id="@+id/rectangle_7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginTop="72dp" - android:src="@drawable/rectangle_1" - /> + android:layout_marginTop="72dp" /> <Button android:id="@+id/photo_button" + style="@style/ButtonAppearance" android:layout_width="168dp" android:layout_height="124dp" + android:layout_gravity="center_vertical" android:layout_marginStart="34dp" android:layout_marginTop="72dp" - android:layout_gravity="center_vertical" - android:backgroundTint="#517293" android:drawableLeft="@drawable/camera" android:fontFamily="@font/inter" - android:text="@string/photo" - android:textSize="20sp" - android:rotation="-5" - android:paddingRight="3.75dp" android:paddingLeft="3.75dp" - style="@style/ButtonAppearance"/> - - <ImageView - android:id="@+id/rectangle_8" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:layout_marginTop="241dp" - android:src="@drawable/rectangle_1" - /> + android:paddingRight="3.75dp" + android:rotation="-5" + android:text="@string/photo" + android:textSize="20sp" /> <Button android:id="@+id/stats_button" + style="@style/ButtonAppearance" android:layout_width="168dp" android:layout_height="124dp" + android:layout_gravity="center_vertical" android:layout_marginStart="34dp" android:layout_marginBottom="97dp" - android:layout_gravity="center_vertical" - android:backgroundTint="#517293" android:drawableLeft="@drawable/stats" android:fontFamily="@font/inter" - android:text="@string/stats" - android:textSize="20sp" - android:rotation="-5" - android:paddingRight="3.75dp" android:paddingLeft="3.75dp" - style="@style/ButtonAppearance"/> + android:paddingRight="3.75dp" + android:rotation="-5" + android:text="@string/stats" + android:textSize="20sp" /> </FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index e024e1b82a6afa25a744b6da52c98a8460332219..1e9d1ced2b628ab531ed39ee1e59a0d1fe46badf 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,104 +1,56 @@ <!-- Auto layout, variables, and unit scale are not yet supported --> <FrameLayout + style="@style/MainBackground" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/welcomescre" android:layout_width="match_parent" android:layout_height="match_parent" - android:clipToOutline="true" - android:background="@color/black"> + android:clipToOutline="true" > - <ImageView - android:alpha="0.4" - android:id="@+id/image_1" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scaleType="centerCrop" - android:src="@drawable/image_1"/> - - - <TextView - android:id="@+id/sell_rad" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="13dp" - android:layout_marginTop="14dp" - android:fontFamily="@font/mclaren" - android:layout_gravity="start|center" - android:text="@string/sell_rad" - android:textAppearance="@style/sell_rad" /> - - <ImageView - android:id="@+id/image_2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom|center_horizontal" - android:layout_marginBottom="50dp" - android:src="@drawable/image_2" - /> <ImageView - android:id="@+id/polygon_3" + style="@style/NameMain" + android:id="@+id/imageView6" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/polygon_3" - android:alpha="0.75" - android:layout_gravity="end|bottom" - /> + android:paddingHorizontal="70dp" + android:layout_gravity="bottom" + android:layout_marginBottom="240dp"/> <ImageView - android:id="@+id/rectangle_1" + style="@style/LogoMain" + android:id="@+id/imageView7" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="start|center_vertical" - android:layout_marginTop="250dp" - android:layout_marginStart="33dp" - android:alpha="0.75" - android:background="@drawable/rectangle_5" - /> + android:layout_gravity="center" + android:paddingBottom="430dp" + android:paddingTop="174dp" + android:paddingHorizontal="37dp"/> <ImageView - android:id="@+id/rectangle_2" + style="@style/SubNameMain" + android:id="@+id/imageView8" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="start" - android:layout_marginTop="167dp" - android:layout_marginEnd="250dp" - android:alpha="0.75" - android:background="@drawable/rectangle_5" - /> + android:paddingHorizontal="60dp" + android:layout_gravity="bottom" + android:layout_marginBottom="220dp"/> <ImageView - android:id="@+id/rectangle_3" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="start" - android:layout_marginTop="150dp" - android:layout_marginEnd="300dp" - android:alpha="0.75" - android:background="@drawable/rectangle_5" - /> - - <ImageView - android:id="@+id/rectangle_4" - android:layout_width="wrap_content" + style="@style/BottomPolygonMain" + android:id="@+id/imageView9" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="end|center_vertical" - android:layout_marginTop="75dp" - android:layout_marginEnd="70dp" - android:alpha="0.75" - android:background="@drawable/rectangle_5" - /> + android:scaleType="fitXY" + android:layout_gravity="bottom"/> <ImageView - android:id="@+id/polygon_1" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/polygon_1" - android:layout_gravity="end|center_vertical" - android:layout_marginBottom="25dp" - android:alpha="0.75" - /> - + android:id="@+id/imageView10" + android:layout_width="147dp" + android:layout_height="49dp" + app:srcCompat="@drawable/image_2" + android:layout_gravity="bottom|center_horizontal" + android:layout_marginBottom="18.4dp"/> </FrameLayout> diff --git a/app/src/main/res/layout/activity_main1.xml b/app/src/main/res/layout/activity_main1.xml new file mode 100644 index 0000000000000000000000000000000000000000..cef990d60adfec3638eeb610bbb7e15ef5d96b9f --- /dev/null +++ b/app/src/main/res/layout/activity_main1.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <TextView + android:id="@+id/testInference" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="avifaune" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <Button + android:id="@+id/buttonRecognize" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="256dp" + android:onClick="testPredict" + android:text="Recognize" + 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/layout/activity_public.xml b/app/src/main/res/layout/activity_public.xml index cf1b83220e734dc8f7659b8e5ce9613a5d8d675b..76f19b61bb95cda0ea279413cdf465453430fe4c 100644 --- a/app/src/main/res/layout/activity_public.xml +++ b/app/src/main/res/layout/activity_public.xml @@ -29,11 +29,13 @@ android:layout_above="@id/bottom_navigation"/> <com.google.android.material.bottomnavigation.BottomNavigationView + style="@style/BottomNavTint" android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="#b9d6f2" + app:itemTextColor="#D9D9D9" + app:itemRippleColor="#3D5062" app:menu="@menu/bottom_nav_menu" app:layout_constraintBottom_toBottomOf="parent" app:labelVisibilityMode="labeled" diff --git a/app/src/main/res/layout/activity_tutorial.xml b/app/src/main/res/layout/activity_tutorial.xml new file mode 100644 index 0000000000000000000000000000000000000000..4f6b328cb67b42118e3df396511285f24f9e1bea --- /dev/null +++ b/app/src/main/res/layout/activity_tutorial.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/public_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/black" + tools:context=".TutorialActivity"> + + <ImageView + android:id="@+id/image_1" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:alpha="0.4" + android:scaleType="centerCrop" + android:src="@drawable/image_1" + app:layout_constraintBottom_toTopOf="@id/bottom_navigation" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.viewpager2.widget.ViewPager2 + android:id="@+id/tutorial_viewpager" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <LinearLayout + android:id="@+id/dots_layout" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|center_horizontal" + android:layout_marginBottom="19dp" + android:gravity="center" + android:orientation="horizontal" + android:padding="8dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/tuto_end_button" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="60dp" + android:fontFamily="@font/inter" + android:text="@string/tuto_end" /> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_form.xml b/app/src/main/res/layout/fragment_form.xml new file mode 100644 index 0000000000000000000000000000000000000000..48e806cbff52fd6687723df126792b5bd8744d88 --- /dev/null +++ b/app/src/main/res/layout/fragment_form.xml @@ -0,0 +1,96 @@ + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/form_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="@drawable/shape" + android:padding="20dp" + tools:context=".PhotoPage"> + + <!-- Title for the form --> + <TextView + android:id="@+id/form_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Saisissez les détails du localisation" + android:textSize="18sp" + android:textColor="#333333" + android:textStyle="bold" + android:layout_gravity="center_horizontal" + android:layout_marginTop="20dp" /> + + <!-- Location Input --> + <EditText + android:id="@+id/location_input" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:hint="Localisation (qu'est ce que vous voyez?)" + android:padding="20dp" + android:textColor="#000000" /> + + <TextView + android:id="@+id/form_zonage" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Saisissez la zone correspondante" + android:textSize="18sp" + android:textColor="#333333" + android:textStyle="bold" + android:layout_gravity="center_horizontal" + android:layout_marginTop="20dp" /> + + <EditText + android:id="@+id/zone_input" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:hint="Dans quelle zone vous situez" + android:padding="20dp" + android:textColor="#000000" /> + <Button + android:id="@+id/form_zoneInfo" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Plus d'info sur les zones" + android:textSize="12sp" + android:textColor="#4B0076" + android:layout_gravity="right" + android:backgroundTint="#FFFFFF" + android:layout_marginTop="5dp" /> + + <!-- Date Picker (Optional) --> + + <!-- Submit Button --> + <TextView + android:id="@+id/form_date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Saisissez la date de la prise de la photo" + android:textSize="18sp" + android:textColor="#333333" + android:textStyle="bold" + android:layout_gravity="center_horizontal" + android:layout_marginTop="5dp" /> + + <DatePicker + android:id="@+id/date_picker" + android:layout_width="wrap_content" + android:layout_height="250dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="20dp" /> + + <Button + android:id="@+id/submit_form_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="30dp" + android:text="Envoyer" + android:textColor="#FFFFFF" + android:backgroundTint="#517293" + style="@style/ButtonAppearance" /> +</LinearLayout> diff --git a/app/src/main/res/layout/fragment_learning_page.xml b/app/src/main/res/layout/fragment_learning_page.xml index 6455cc084bd0c947585651bf1352955361968cbe..ef16fc6a33058e9d0be718a3fd4e846ef44d6320 100644 --- a/app/src/main/res/layout/fragment_learning_page.xml +++ b/app/src/main/res/layout/fragment_learning_page.xml @@ -1,171 +1,431 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- res/layout/fragment_apprendre.xml --> -<ScrollView - xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="16dp"> - -<LinearLayout -android:layout_width="match_parent" -android:layout_height="wrap_content" -android:orientation="vertical"> - -<!-- Header Text --> -<TextView - android:id="@+id/headerText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="En savoir plus sur l’avifaune présente dans la vasière" - android:textSize="18sp" - android:textColor="@android:color/white" - android:background="@android:color/darker_gray" - android:padding="16dp" - android:layout_gravity="center_horizontal" - android:layout_marginBottom="16dp"/> - -<!-- First Section Header --> -<TextView - android:id="@+id/sectionHeader1" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Espèces" - android:textSize="16sp" - android:textStyle="bold" - android:layout_marginBottom="8dp" - android:padding="8dp"/> - -<!-- Grid of Species Images (First Section) --> -<GridLayout - android:id="@+id/firstGrid" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:columnCount="3" - android:rowCount="3" - android:layout_marginBottom="16dp" - android:layout_gravity="center_horizontal"> - - <!-- Placeholder for each species image --> - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_row="0" - android:layout_column="1" - android:layout_margin="8dp" - android:background="@android:color/darker_gray" /> - - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <!-- Add more ImageViews as needed --> - -</GridLayout> + android:orientation="vertical"> + <TextView - android:id="@+id/sectionHeader1.1" - android:layout_width="wrap_content" - android:layout_height="132dp" - android:layout_marginBottom="8dp" - android:padding="8dp" - android:text="Un total de 98 espèces d’oiseaux d’eau a été recensé, regroupant 21 600 individus sur l’année. La Bernache cravant (3 000 individus) et la Foulque macroule (672 individus) figurent parmi les espèces les plus abondantes. -En janvier 2021, le dénombrement a montré des pics de présence dans la Petite Mer de Gâvres (environ 10 000 individus), la sortie de la rade, et d'autres sites comme le Blavet maritime." - android:textSize="16sp" - android:textStyle="bold" /> - -<!-- Second Section Header --> - <TextView - android:id="@+id/sectionHeader2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Oiseaux Nicheurs" - android:textSize="16sp" - android:textStyle="bold" - android:layout_marginBottom="8dp" - android:padding="8dp"/> - -<!-- Grid of Species Images (Second Section) --> -<GridLayout - android:id="@+id/secondGrid" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:columnCount="3" - android:rowCount="2" - android:layout_gravity="center_horizontal"> - - <!-- Placeholder for each species image --> - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <!-- Add more ImageViews as needed --> - -</GridLayout> - - <!-- 3rd Section Header --> - <TextView - android:id="@+id/sectionHeader3" + style="@style/PageTitleAppearance" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="Enjeux de Conservation" - android:textSize="16sp" - android:textStyle="bold" - android:layout_marginBottom="8dp" - android:padding="8dp"/> - - <!-- Grid of Species Images (Second Section) --> - <GridLayout - android:id="@+id/thirdGrid" + android:layout_marginTop="50dp" + android:layout_marginBottom="60dp" + android:paddingTop="30dp" + android:paddingEnd="50dp" + android:text="@string/apprendre" + android:textSize="38sp" /> + + <ScrollView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:columnCount="3" - android:rowCount="2" - android:layout_gravity="center_horizontal"> - - <!-- Placeholder for each species image --> - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <ImageView - android:layout_width="100dp" - android:layout_height="100dp" - android:layout_margin="8dp" - android:background="@android:color/darker_gray"/> - - <!-- Add more ImageViews as needed --> - - </GridLayout> - -</LinearLayout> + android:layout_height="match_parent" + android:paddingTop="16dp" + android:paddingBottom="80dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <!-- Header Text --> + <TextView + android:id="@+id/header_text" + style="@style/TopTopAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:padding="10dp" + android:text="@string/learning_page_header" + android:textAlignment="center" + android:textSize="18sp" /> + + <TextView + android:id="@+id/becasseau" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/becasseau" /> + + <LinearLayout + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal" + android:paddingVertical="12dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:src="@drawable/becasseau_sanderling" /> + + <Button + android:id="@+id/button_becasseau" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/bernache" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/bernache" /> + + <LinearLayout + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal" + android:paddingVertical="12dp"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/bernache_cravant" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_bernache" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/goeland" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/goeland" /> + + <LinearLayout + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal" + android:paddingVertical="12dp"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/goeland_argente" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_goeland" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/mouette" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/mouette" /> + + <LinearLayout + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal" + android:paddingVertical="12dp"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/mouette_rieuse" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_mouette" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/pluvier" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/pluvier_argente" /> + + <LinearLayout + style="@style/BottomAppearance" + android:paddingVertical="12dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/pluvier_argente" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_pluvier" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/cormoran" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/grand_cormoran" /> + + <LinearLayout + style="@style/BottomAppearance" + android:paddingVertical="12dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/grand_cormoran" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_cormoran" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/foulque" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/foulque_macroule" /> + + <LinearLayout + style="@style/BottomAppearance" + android:paddingVertical="12dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/foulque_macroule" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_foulque" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/tadorne" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/tadorne_de_belon" /> + + <LinearLayout + style="@style/BottomAppearance" + android:paddingVertical="12dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/tadorne_de_belon" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_tadorne" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + <TextView + android:id="@+id/chevalier" + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" + android:text="@string/chevalier_gambette" /> + + <LinearLayout + style="@style/BottomAppearance" + android:paddingVertical="12dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:orientation="horizontal"> + + <com.google.android.material.imageview.ShapeableImageView + android:layout_width="120dp" + android:layout_height="78dp" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:adjustViewBounds="true" + android:scaleType="centerCrop" + android:src="@drawable/chevalier_gambette" + app:shapeAppearanceOverlay="@style/RoundedImageView" /> + + <Button + android:id="@+id/button_chevalier" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="12dp" + android:fontFamily="@font/inter" + android:paddingLeft="12dp" + android:paddingRight="12dp" + android:text="@string/know_more" + android:textSize="16sp" /> + </LinearLayout> + + </LinearLayout> </ScrollView> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_overlay_dialog_becasseau.xml b/app/src/main/res/layout/fragment_overlay_dialog_becasseau.xml new file mode 100644 index 0000000000000000000000000000000000000000..0bd52657a313d245b1542b1989112de762c0a24b --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_becasseau.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description du becasseau Sanderling. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur le becasseau Sanderling --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/becasseau_sanderling" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_becasseau" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> diff --git a/app/src/main/res/layout/fragment_overlay_dialog_bernache.xml b/app/src/main/res/layout/fragment_overlay_dialog_bernache.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c34871f9b970cc1460f6f91bd2854421972e535 --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_bernache.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description du becasseau Sanderling. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur le becasseau Sanderling --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/bernache_cravant" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_bernache" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> diff --git a/app/src/main/res/layout/fragment_overlay_dialog_chevalier.xml b/app/src/main/res/layout/fragment_overlay_dialog_chevalier.xml new file mode 100644 index 0000000000000000000000000000000000000000..1bcf4cfd73dcff3af9404402524d67b9fc1cfd25 --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_chevalier.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description du Chevalier gambette. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur le Chevalier gambette --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/chevalier" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_chevalier" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_overlay_dialog_cormoran.xml b/app/src/main/res/layout/fragment_overlay_dialog_cormoran.xml new file mode 100644 index 0000000000000000000000000000000000000000..e1d2ed98f26d776ddae1883b86ee3bdd7bb6ea4f --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_cormoran.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description du cormoran. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur le cormoran --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/cormoran" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_cormoran" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_overlay_dialog_foulque.xml b/app/src/main/res/layout/fragment_overlay_dialog_foulque.xml new file mode 100644 index 0000000000000000000000000000000000000000..182a63b3b15a382357bac8c1e8058ce9be9dcbfc --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_foulque.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description de la foulque macroule. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur de la foulque macroule --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/foulque" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_foulque" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_overlay_dialog_goeland.xml b/app/src/main/res/layout/fragment_overlay_dialog_goeland.xml new file mode 100644 index 0000000000000000000000000000000000000000..c1e020da9e1c16b4627766fd1e82566e7f3610b0 --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_goeland.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description ICI. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur ICI --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/goeland_argente" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_goeland" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_overlay_dialog_mouette.xml b/app/src/main/res/layout/fragment_overlay_dialog_mouette.xml new file mode 100644 index 0000000000000000000000000000000000000000..245f18dba7b934c6fb239820dd7af9015278caab --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_mouette.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description Mouette. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur la mouette rieuse. --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/mouette_rieuse" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_mouette" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> diff --git a/app/src/main/res/layout/fragment_overlay_dialog_pluvier.xml b/app/src/main/res/layout/fragment_overlay_dialog_pluvier.xml new file mode 100644 index 0000000000000000000000000000000000000000..81db0d9e9615fad30af78228b0348ab7eb0f3cee --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_pluvier.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description Pluvier. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur le pluvier --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/pluvier" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_pluvier" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> diff --git a/app/src/main/res/layout/fragment_overlay_dialog_tadorne.xml b/app/src/main/res/layout/fragment_overlay_dialog_tadorne.xml new file mode 100644 index 0000000000000000000000000000000000000000..442515ce9638c1db2d825882d998c47d3116d65e --- /dev/null +++ b/app/src/main/res/layout/fragment_overlay_dialog_tadorne.xml @@ -0,0 +1,33 @@ +<!-- Overlay Dialog Fragment : Description le tadorne de Belon. + C'est en fait comme une fenetre pop-up nous donnant des informations sur + sur le tadorne de Belon --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <!-- Your custom overlay content here --> + <TextView + style="@style/OverlayAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:padding="15dp" + android:text="@string/tadorne" + android:textSize="16sp" /> + + <Button + android:id="@+id/return_tadorne" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginRight="20dp" + android:paddingLeft="50dp" + android:paddingRight="50dp" + android:text="@string/retour" /> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_photo_page.xml b/app/src/main/res/layout/fragment_photo_page.xml index f2b2a25fb7f3420e6d898064cc5691d24950c928..bb93ae6309d8819514a5a435e2ea98efccc91685 100644 --- a/app/src/main/res/layout/fragment_photo_page.xml +++ b/app/src/main/res/layout/fragment_photo_page.xml @@ -1,96 +1,123 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".PhotoPage"> + <!-- To see the tutorial again --> + <Button + android:id="@+id/see_tuto" + style="@style/ButtonAppearance" + android:layout_width="320dp" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="180dp" + android:fontFamily="@font/inter" + android:text="@string/see_tuto" + android:textSize="15sp" /> + + <FrameLayout + style="@style/TopTopAppearance" + android:layout_width="320dp" + android:layout_height="386dp" + android:layout_gravity="center"> + + <!-- Camera Button --> + <Button + android:id="@+id/camera_button" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|start" + android:layout_marginStart="6dp" + android:drawableLeft="@drawable/camera_tiny" + android:fontFamily="@font/inter" + android:text="@string/camera" + android:textSize="20sp" /> + + <!-- Folder Button --> + <Button + android:id="@+id/folder_button" + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|end" + android:layout_marginEnd="6dp" + android:drawableLeft="@drawable/folder" + android:fontFamily="@font/inter" + android:text="@string/galerie" + android:textSize="20sp" /> + + <!-- Main Image Display --> + <ImageView + android:id="@+id/main_image_display" + android:layout_width="209dp" + android:layout_height="209dp" + android:layout_gravity="center" + app:layout_constraintBottom_toTopOf="@+id/textPredictionOutput" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.507" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.101" + tools:srcCompat="@tools:sample/avatars" /> + + <Button + style="@style/ButtonAppearance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|top" + android:layout_marginTop="20dp" + android:fontFamily="@font/inter" + android:paddingHorizontal="40dp" + android:text="@string/especes" + android:textSize="15sp" /> + </FrameLayout> + <!-- Prediction Text --> <TextView - android:id="@+id/textView" - android:layout_width="9dp" - android:layout_height="0dp" - android:layout_marginBottom="200dp" + android:id="@+id/textPredictionOutput" + android:layout_width="351dp" + android:layout_height="28dp" + android:layout_gravity="bottom|center_horizontal" + android:layout_marginBottom="146dp" android:text="" android:textColor="#F12B2B" android:textSize="17sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> + android:textStyle="bold" /> <!-- Accuracy Text --> <TextView - android:id="@+id/txtView" + android:id="@+id/textProbabilityOutput" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="106dp" android:text="" android:textColor="#F12B2B" android:textSize="17sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.476" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/textView" - app:layout_constraintVertical_bias="0.331" /> - - <!-- Camera Button --> - <Button - android:id="@+id/camera_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="16dp" - android:layout_marginBottom="340dp" - android:text="Camera" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/folder_button" - app:layout_constraintHorizontal_bias="0.5" - app:layout_constraintStart_toStartOf="parent" - android:backgroundTint="#517293" - style="@style/ButtonAppearance" /> - - <!-- Folder Button --> - <Button - android:id="@+id/folder_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginBottom="340dp" - android:text="Folder" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/camera_button" - android:backgroundTint="#517293" - style="@style/ButtonAppearance" /> - - <!-- Main Image Display --> - <ImageView - android:id="@+id/imageView" - android:layout_width="285dp" - android:layout_height="241dp" - app:layout_constraintBottom_toTopOf="@+id/textView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.507" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.101" - tools:srcCompat="@tools:sample/avatars" /> + android:textStyle="bold" /> <!-- Prediction Label --> <TextView - android:id="@+id/textView2" + android:id="@+id/prediction_label" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="28dp" + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="186dp" android:text="PREDICTION:" - android:textColor="#9E9595" + android:textColor="#D9D9D9" android:textSize="24sp" - android:textStyle="bold" - app:layout_constraintBottom_toTopOf="@+id/textView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.498" - app:layout_constraintStart_toStartOf="parent" /> + android:textStyle="bold" /> -</androidx.constraintlayout.widget.ConstraintLayout> + <TextView + style="@style/PageTitleAppearance" + android:id="@+id/learning_page_title" + android:layout_marginTop="50dp" + android:layout_marginBottom="60dp" + android:paddingTop="30dp" + android:paddingEnd="50dp" + android:text="@string/photo" /> +</FrameLayout> diff --git a/app/src/main/res/layout/fragment_settings_page.xml b/app/src/main/res/layout/fragment_settings_page.xml index 664a9e8024301740d0bc6f81fe7f95c7f039147f..e794c9853f00746a5534d99eb1c864760a07e382 100644 --- a/app/src/main/res/layout/fragment_settings_page.xml +++ b/app/src/main/res/layout/fragment_settings_page.xml @@ -1,13 +1,132 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:gravity="center"> + android:orientation="vertical"> <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Dashboard Page" - android:textSize="24sp" /> + style="@style/PageTitleAppearance" + android:layout_marginTop="50dp" + android:layout_marginBottom="60dp" + android:paddingTop="30dp" + android:paddingEnd="50dp" + android:text="@string/settings" /> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="16dp" + android:paddingBottom="80dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + style="@style/TopTopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:paddingTop="7dp" + android:paddingBottom="7dp" + android:text="@string/settings_gen" /> + + <TextView + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="8dp" + android:text="@string/mode" /> + + <LinearLayout + style="@style/BottomAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="23dp" + android:orientation="vertical"> + + <Button + android:id="@+id/night_mode_button" + style="@style/ModeSombreButtonAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="15dp" + android:layout_marginTop="5dp" + android:layout_marginRight="15dp" + android:layout_marginBottom="5dp" + android:textSize="15sp" + app:icon="@drawable/moon" + app:iconGravity="textStart" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:text="@string/mode_sombre_texte" /> + </LinearLayout> + + + <TextView + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="8dp" + android:text="@string/tutorial" + android:textSize="15sp" /> + + <LinearLayout + style="@style/BottomAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="23dp" + android:orientation="vertical"> + + <Button + android:id="@+id/download_tuto_button" + style="@style/ButtonAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="15dp" + android:layout_marginTop="5dp" + android:layout_marginRight="15dp" + android:layout_marginBottom="5dp" + android:text="@string/download" + android:textSize="15sp" + app:icon="@drawable/folder" + app:iconGravity="textStart" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:text="@string/download_text" /> + </LinearLayout> + + <TextView + style="@style/TopTopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:text="@string/settings_conf" /> + + <TextView + style="@style/TopAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="8dp" + android:text="@string/personal_data" /> + + <TextView + style="@style/BottomAppearance" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp" /> + </LinearLayout> + </ScrollView> </LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_stats.xml b/app/src/main/res/layout/fragment_stats.xml deleted file mode 100644 index 65b366659ae4a62019eb84a9bfc45862bc0f9ae0..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/fragment_stats.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- res/layout/fragment_actual_stats.xml --> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" - android:padding="16dp"> - - <TextView - android:id="@+id/statsText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="18sp" - android:text="Stats Content" - android:layout_gravity="center_horizontal"/> -</LinearLayout> diff --git a/app/src/main/res/layout/fragment_stats_page.xml b/app/src/main/res/layout/fragment_stats_page.xml index 7d5ab9769ff5cdd4e0b316907a27fb69d993eb85..1d27aa9814570cb5692db26e01d36f5d4ed588c0 100644 --- a/app/src/main/res/layout/fragment_stats_page.xml +++ b/app/src/main/res/layout/fragment_stats_page.xml @@ -1,84 +1,139 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- res/layout/fragment_stats.xml --> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:padding="16dp"> + android:orientation="vertical"> - <LinearLayout - android:layout_gravity="center" - android:layout_width="match_parent" + <TextView + style="@style/PageTitleAppearance" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="15dp" - android:layout_margin="25dp" - android:background="@drawable/shape"> - <TextView - android:layout_marginTop="10dp" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/user_name" - android:textSize="17sp"/> - <!-- <com.google.android.material.textfield.TextInputLayout - android:layout_width="match_parent" - android:layout_height="45dp"> + android:layout_marginTop="50dp" + android:layout_marginBottom="60dp" + android:paddingTop="30dp" + android:paddingEnd="50dp" + android:text="@string/stats" + android:textAlignment="center" + android:textSize="38sp" /> - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/usernameField" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </com.google.android.material.textfield.TextInputLayout> - --> + <ScrollView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="16dp" + android:paddingBottom="80dp"> - <!-- Username Field --> - <EditText - android:id="@+id/usernameField" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="text" - android:padding="12dp" - android:layout_marginBottom="12dp"/> + android:orientation="vertical"> - <TextView - android:layout_marginTop="10dp" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/password" - android:textSize="17sp"/> -<!-- <com.google.android.material.textfield.TextInputLayout - android:id="@+id/passwordField" - android:layout_width="match_parent" - android:layout_height="45dp"> + <Button + style="@style/ButtonAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="33dp" + android:fontFamily="@font/inter" + android:text="@string/csv_export_text" + android:textAlignment="center" + android:textSize="16sp" + app:icon="@drawable/folder" + app:iconGravity="textStart" /> - <com.google.android.material.textfield.TextInputEditText + <TextView + style="@style/TopAppearance" android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </com.google.android.material.textfield.TextInputLayout> ---> + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="8dp" + android:fontFamily="@font/inter" + android:gravity="center" + android:text="@string/nombre_de_photos_prises" + android:textAlignment="center" + android:textSize="16sp" /> - <!-- Password Field --> - <EditText - android:id="@+id/passwordField" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:inputType="textPassword" - android:padding="12dp" - android:layout_marginBottom="12dp"/> + <TextView + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp"/> - <!-- Login Button --> - <Button - android:layout_marginTop="10dp" - android:id="@+id/loginButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/login" - android:padding="12dp" - android:layout_marginBottom="16dp" - android:layout_gravity="center_horizontal" - android:backgroundTint="#517293" - style="@style/ButtonAppearance"/> - </LinearLayout> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/refreshed" + android:gravity="end" + android:layout_marginEnd="66dp" + android:layout_marginBottom="10dp" + android:fontFamily="@font/inter" + android:textColor="@color/white"/> + + <TextView + style="@style/TopAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="8dp" + android:fontFamily="@font/inter" + android:gravity="center" + android:text="@string/proportions" + android:textAlignment="center" + android:textSize="16sp" /> + + <TextView + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/refreshed" + android:gravity="end" + android:layout_marginEnd="66dp" + android:layout_marginBottom="10dp" + android:fontFamily="@font/inter" + android:textColor="@color/white"/> + + <TextView + style="@style/TopAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="8dp" + android:fontFamily="@font/inter" + android:gravity="center" + android:text="@string/nombre_ind" + android:textAlignment="center" + android:textSize="16sp" /> -</FrameLayout> + <TextView + style="@style/BottomAppearance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" + android:layout_marginBottom="10dp"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/refreshed" + android:gravity="end" + android:layout_marginEnd="66dp" + android:layout_marginBottom="10dp" + android:fontFamily="@font/inter" + android:textColor="@color/white"/> + </LinearLayout> + </ScrollView> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_tutorial_page1.xml b/app/src/main/res/layout/fragment_tutorial_page1.xml new file mode 100644 index 0000000000000000000000000000000000000000..afd4df3f14354c169837364bc24e0fb8bd65ee42 --- /dev/null +++ b/app/src/main/res/layout/fragment_tutorial_page1.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <ImageView + style="@style/TutoPage1" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="5.7dp" /> + + <ImageView + style="@style/TutoLine1" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:layout_marginTop="-131dp" /> + + <TextView + style="@style/TutorialTitles" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/tuto_id" + android:textSize="29sp" + android:fontFamily="@font/inter" + android:paddingHorizontal="36dp" + android:paddingVertical="13dp" + android:textColor="#D9D9D9" + android:textStyle="bold" + android:rotation="-5" + android:layout_gravity="center_vertical" + android:layout_marginBottom="250dp" + android:layout_marginLeft="-15dp"/> + + <FrameLayout + style="@style/TopTopAppearance" + android:layout_width="320dp" + android:layout_height="296dp" + android:layout_gravity="center" + android:layout_marginTop="75dp"> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:text="@string/tuto_cam" + android:textSize="16sp" + android:fontFamily="@font/inter" + android:paddingTop="12dp"/> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:src="@drawable/becasseau_sanderling_2" + android:paddingRight="15dp" + android:paddingLeft="15dp" + android:paddingTop="50dp" + android:paddingBottom="19dp"/> + </FrameLayout> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_tutorial_page2.xml b/app/src/main/res/layout/fragment_tutorial_page2.xml new file mode 100644 index 0000000000000000000000000000000000000000..12b032e9564d6ddc301847146822c5f4f4495f36 --- /dev/null +++ b/app/src/main/res/layout/fragment_tutorial_page2.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <ImageView + style="@style/TutoPage2" + android:id="@+id/imageView2" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="65dp" /> + + <ImageView + style="@style/TutoLine2" + android:id="@+id/imageView5" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:paddingTop="269dp" /> + + <FrameLayout + style="@style/TopTopAppearance" + android:layout_width="272dp" + android:layout_height="520dp" + android:layout_gravity="center" + android:layout_marginTop="70dp"> + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/gallery" + android:paddingHorizontal="24dp" + android:paddingTop="60dp" + android:paddingBottom="29dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:text="@string/tuto_gal" + android:textSize="16sp" + android:fontFamily="@font/inter" + android:paddingTop="12dp"/> + </FrameLayout> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_tutorial_page3.xml b/app/src/main/res/layout/fragment_tutorial_page3.xml new file mode 100644 index 0000000000000000000000000000000000000000..76b95fb8f50da8832df2f4b8f5debaa844208210 --- /dev/null +++ b/app/src/main/res/layout/fragment_tutorial_page3.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <ImageView + style="@style/TutoPage3" + android:id="@+id/imageView3" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="fitCenter" /> + + <ImageView + style="@style/TutoLine3" + android:id="@+id/imageView4" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingBottom="219.3dp" /> + + <TextView + style="@style/TutorialTitles" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/tuto_app" + android:textAlignment="center" + android:textSize="26sp" + android:fontFamily="@font/inter" + android:paddingHorizontal="27dp" + android:paddingVertical="13dp" + android:textColor="#D9D9D9" + android:textStyle="bold" + android:rotation="-5" + android:layout_gravity="center_horizontal" + android:layout_marginBottom="250dp" + android:layout_marginLeft="-25dp" + android:layout_marginTop="160dp"/> + + <FrameLayout + style="@style/TopTopAppearance" + android:layout_width="319dp" + android:layout_height="440dp" + android:layout_gravity="center" + android:layout_marginTop="90dp"> + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/learn" + android:paddingLeft="26dp" + android:paddingRight="63dp" + android:paddingBottom="96dp" + android:paddingTop="58dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:text="@string/tuto_page_app" + android:textSize="16sp" + android:fontFamily="@font/inter" + android:paddingTop="12dp"/> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/tuto_becasseau_desc" + android:paddingTop="318dp" + android:paddingRight="21dp" + android:paddingBottom="32dp" + android:paddingLeft="56dp"/> + </FrameLayout> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index c6fc173b9ec6d329c541ed17530d84624b9d67c7..19dd5372e5973851b74e672e07429382db752871 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -1,17 +1,26 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item + android:checkable="true" android:id="@+id/navigation_apprendre" android:icon="@drawable/book" android:title="Apprendre" /> <item + android:checkable="true" android:id="@+id/navigation_statistiques" android:icon="@drawable/stats" android:title="Stats" /> <item - android:id="@+id/navigation_documenter" + android:checkable="true" + android:id="@+id/navigation_accueil" + android:icon="@drawable/home" + android:title="Accueil"/> + <item + android:checkable="true" + android:id="@+id/navigation_identifier" android:icon="@drawable/camera" android:title="Documenter" /> <item + android:checkable="true" android:id="@+id/navigation_parametres" android:icon="@drawable/param" android:title="Paramètres" /> diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 6f3b755bf50c6b03d8714a9c6184705e6a08389f..0000000000000000000000000000000000000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> - <background android:drawable="@drawable/ic_launcher_background" /> - <foreground android:drawable="@drawable/ic_launcher_foreground" /> - <monochrome android:drawable="@drawable/ic_launcher_foreground" /> -</adaptive-icon> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 6f3b755bf50c6b03d8714a9c6184705e6a08389f..0000000000000000000000000000000000000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> - <background android:drawable="@drawable/ic_launcher_background" /> - <foreground android:drawable="@drawable/ic_launcher_foreground" /> - <monochrome android:drawable="@drawable/ic_launcher_foreground" /> -</adaptive-icon> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/plunv_logo.xml b/app/src/main/res/mipmap-anydpi-v26/plunv_logo.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb41709424ce4044d6445172d0e12cee3069e1b6 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/plunv_logo.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@mipmap/plunv_logo_background"/> + <foreground android:drawable="@mipmap/plunv_logo_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/plunv_logo_round.xml b/app/src/main/res/mipmap-anydpi-v26/plunv_logo_round.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb41709424ce4044d6445172d0e12cee3069e1b6 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/plunv_logo_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@mipmap/plunv_logo_background"/> + <foreground android:drawable="@mipmap/plunv_logo_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index c209e78ecd372343283f4157dcfd918ec5165bb3..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index b2dfe3d1ba5cf3ee31b3ecc1ced89044a1f3b7a9..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/plunv_logo.webp b/app/src/main/res/mipmap-hdpi/plunv_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..dead6d8a61442029084095f131a44c6775c9711b Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/plunv_logo.webp differ diff --git a/app/src/main/res/mipmap-hdpi/plunv_logo_background.webp b/app/src/main/res/mipmap-hdpi/plunv_logo_background.webp new file mode 100644 index 0000000000000000000000000000000000000000..9782699b34e7436548ed72487c449a5038af9faf Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/plunv_logo_background.webp differ diff --git a/app/src/main/res/mipmap-hdpi/plunv_logo_foreground.webp b/app/src/main/res/mipmap-hdpi/plunv_logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..9782699b34e7436548ed72487c449a5038af9faf Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/plunv_logo_foreground.webp differ diff --git a/app/src/main/res/mipmap-hdpi/plunv_logo_round.webp b/app/src/main/res/mipmap-hdpi/plunv_logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..1d2b27708689f204849e4a4f8eb39ed5f8716c4c Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/plunv_logo_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 4f0f1d64e58ba64d180ce43ee13bf9a17835fbca..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp deleted file mode 100644 index 62b611da081676d42f6c3f78a2c91e7bcedddedb..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/plunv_logo.webp b/app/src/main/res/mipmap-mdpi/plunv_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..16721515a38e8ca022018ea638c56c1cf1f99577 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/plunv_logo.webp differ diff --git a/app/src/main/res/mipmap-mdpi/plunv_logo_background.webp b/app/src/main/res/mipmap-mdpi/plunv_logo_background.webp new file mode 100644 index 0000000000000000000000000000000000000000..9eaa947372304518f7b18fab098e62ce39d8f066 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/plunv_logo_background.webp differ diff --git a/app/src/main/res/mipmap-mdpi/plunv_logo_foreground.webp b/app/src/main/res/mipmap-mdpi/plunv_logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..9eaa947372304518f7b18fab098e62ce39d8f066 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/plunv_logo_foreground.webp differ diff --git a/app/src/main/res/mipmap-mdpi/plunv_logo_round.webp b/app/src/main/res/mipmap-mdpi/plunv_logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..caee6b9ac93fd6849a12eeaea3177d05bae50694 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/plunv_logo_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index 948a3070fe34c611c42c0d3ad3013a0dce358be0..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index 1b9a6956b3acdc11f40ce2bb3f6efbd845cc243f..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/plunv_logo.webp b/app/src/main/res/mipmap-xhdpi/plunv_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..cd889d51361b8939c57be14b02e762ae3b91a746 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/plunv_logo.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/plunv_logo_background.webp b/app/src/main/res/mipmap-xhdpi/plunv_logo_background.webp new file mode 100644 index 0000000000000000000000000000000000000000..6f377f39f802d2e807bcb2628b4c7bc49a3159b2 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/plunv_logo_background.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/plunv_logo_foreground.webp b/app/src/main/res/mipmap-xhdpi/plunv_logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..6f377f39f802d2e807bcb2628b4c7bc49a3159b2 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/plunv_logo_foreground.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/plunv_logo_round.webp b/app/src/main/res/mipmap-xhdpi/plunv_logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..518c549104f0d96a477f06cb42ba179d0ea75b5a Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/plunv_logo_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index 28d4b77f9f036a47549d47db79c16788749dca10..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp deleted file mode 100644 index 9287f5083623b375139afb391af71cc533a7dd37..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/plunv_logo.webp b/app/src/main/res/mipmap-xxhdpi/plunv_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..21a87d4cb2ec30809ce24835e4cd7c6437fc1071 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/plunv_logo.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/plunv_logo_background.webp b/app/src/main/res/mipmap-xxhdpi/plunv_logo_background.webp new file mode 100644 index 0000000000000000000000000000000000000000..cacd5175d68e0f82f855180d00f43650bc495241 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/plunv_logo_background.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/plunv_logo_foreground.webp b/app/src/main/res/mipmap-xxhdpi/plunv_logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..cacd5175d68e0f82f855180d00f43650bc495241 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/plunv_logo_foreground.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/plunv_logo_round.webp b/app/src/main/res/mipmap-xxhdpi/plunv_logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..f6b52c2391ca300792a4e5a8eafc84f714a58bfd Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/plunv_logo_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index aa7d6427e6fa1074b79ccd52ef67ac15c5637e85..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp deleted file mode 100644 index 9126ae37cbc3587421d6889eadd1d91fbf1994d4..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/plunv_logo.webp b/app/src/main/res/mipmap-xxxhdpi/plunv_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..97f1af8eb3b84578d50123c5b0e8b3e653d3eb4d Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/plunv_logo.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/plunv_logo_background.webp b/app/src/main/res/mipmap-xxxhdpi/plunv_logo_background.webp new file mode 100644 index 0000000000000000000000000000000000000000..25810f1b43a3041c34ed3581e2746035cf6beb8a Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/plunv_logo_background.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/plunv_logo_foreground.webp b/app/src/main/res/mipmap-xxxhdpi/plunv_logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..25810f1b43a3041c34ed3581e2746035cf6beb8a Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/plunv_logo_foreground.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/plunv_logo_round.webp b/app/src/main/res/mipmap-xxxhdpi/plunv_logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..efe9115945960088e75bf84a2144ea37267d74fa Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/plunv_logo_round.webp differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index d25b0f2f61ec548c0334a453e602a4298a9e58af..b9a3cf863dad1101493a53c83efb68f798d2d7bd 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,7 +1,134 @@ -<resources xmlns:tools="http://schemas.android.com/tools"> +<resources xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> <style name="Base.Theme.MyApplication" parent="Theme.Material3.DayNight.NoActionBar"> <!-- Customize your dark theme here. --> <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> </style> + + <style name="ButtonAppearance" parent="ShapeAppearance.MaterialComponents.SmallComponent"> + <item name="cornerFamily">rounded</item> + <item name="cornerRadius">8dp</item> + <item name="backgroundTint">#565758</item> + <item name="iconTint">#D9D9D9</item> + <item name="android:textColor">#D9D9D9</item> + </style> + + + <style name="ModeSombreButtonAppearance" parent="ShapeAppearance.MaterialComponents.SmallComponent"> + <item name="cornerFamily">rounded</item> + <item name="cornerRadius">8dp</item> + <item name="backgroundTint">#565758</item> + <item name="iconTint">#D9D9D9</item> + <item name="android:textColor">#D9D9D9</item> + <item name="android:text">"Mode clair"</item> + </style> + + <style name="TopAppearance" parent=""> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:textColor">#D9D9D9</item> + <item name="android:background">@drawable/shape_transparent_black_top_rounded</item> + <item name="fontFamily">@font/inter</item> + <item name="android:gravity">center</item> + <item name="android:textAlignment">center</item> + <item name="android:textSize">16sp</item> + <item name="android:paddingTop">7dp</item> + <item name="android:paddingBottom">7dp</item> + </style> + + <style name="BottomAppearance" parent=""> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:background">@drawable/shape_transparent_black_bottom_rounded</item> + <item name="android:textColor">#1E1E1E</item> + </style> + + <style name="TopTopAppearance" parent=""> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:background">@drawable/shape_transparent_black</item> + <item name="android:fontFamily">@font/inter</item> + <item name="android:textAlignment">center</item> + <item name="android:textColor">#D9D9D9</item> + <item name="android:textSize">16sp</item> + </style> + + <style name="PageTitleAppearance" parent=""> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:background">@drawable/polygon_10</item> + <item name="android:textColor">#D9D9D9</item> + <item name="android:textAlignment">center</item> + <item name="android:textSize">38sp</item> + </style> + + <style name="MiniRectangle" parent=""> + <item name="android:src">@drawable/rectangle_2</item> + </style> + + <style name="BigPolygon" parent=""> + <item name="android:src">@drawable/polygon_11</item> + </style> + + <style name="BottomPolygon" parent=""> + <item name="android:src">@drawable/polygon_12</item> + </style> + + <style name="BottomPolygonMain" parent=""> + <item name="android:src">@drawable/polygon_12</item> + </style> + + <style name="LogoMain" parent=""> + <item name="android:src">@drawable/logo_main_black</item> + </style> + + <style name="MainBackground"> + <item name="android:background">#3f3f3f</item> + </style> + + <style name="NameMain" parent=""> + <item name="android:src">@drawable/plunv_black</item> + </style> + + <style name="SubNameMain"> + <item name="android:src">@drawable/avi_main_black</item> + </style> + + <style name="BottomNavTint"> + <item name="android:background">#E0121212</item> + <item name="itemIconTint">#D9D9D9</item> + </style> + + <style name="OverlayAppearance" parent=""> + <item name="android:background">@drawable/shape_transparent_black</item> + <item name="android:textColor">#D9D9D9</item> + </style> + + <style name="TutorialTitles" parent=""> + <item name="android:background">@drawable/shape_transparent_black</item> + </style> + + <style name="TutoPage1" parent=""> + <item name="android:src">@drawable/polygon_13</item> + </style> + + <style name="TutoLine1" parent=""> + <item name="android:src">@drawable/line_4</item> + </style> + + <style name="TutoPage2" parent=""> + <item name="android:src">@drawable/polygon_14</item> + </style> + + <style name="TutoLine2" parent=""> + <item name="android:src">@drawable/line_5</item> + </style> + + <style name="TutoPage3" parent=""> + <item name="android:src">@drawable/polygon_15</item> + </style> + + <style name="TutoLine3" parent=""> + <item name="android:src">@drawable/line_6</item> + </style> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/logo2_background.xml b/app/src/main/res/values/logo2_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..943ccf7ed93bdc9e1f1463e32773af02b961fa47 --- /dev/null +++ b/app/src/main/res/values/logo2_background.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="logo2_background">#2774AE</color> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/logo_background.xml b/app/src/main/res/values/logo_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..899cf9168222f461e0b448cc43c9f5b05fcd1b35 --- /dev/null +++ b/app/src/main/res/values/logo_background.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="logo_background">#FFFFFF</color> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/refs.xml b/app/src/main/res/values/refs.xml new file mode 100644 index 0000000000000000000000000000000000000000..a6b3daec9354f9ae75cdf8d94a67446c6227dd96 --- /dev/null +++ b/app/src/main/res/values/refs.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources></resources> \ 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 ffc2e4e093ab64f02e1491780c7b9e976941def1..80d188bf8431d280cfbd3a7e864b5e020505ed5d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ <resources> - <string name="app_name">My Application</string> + <string name="app_name">Sell Rad</string> <string name="sell_rad">Sell Rad</string> <string name="professionnel">Professionnel</string> <string name="label_text1">Apprendre</string> @@ -8,9 +8,83 @@ <string name="hello_blank_fragment">Hello blank fragment</string> <string name="learn">Apprendre</string> <string name="settings">Paramètres</string> - <string name="photo">Documenter</string> - <string name="stats">Statistiques</string> + <string name="photo">Identifier</string> + <string name="stats">Mode Pro</string> <string name="login">Se connecter</string> <string name="user_name">Nom d\'utilisateur</string> <string name="password">Password</string> + <string name="learning_page_header">Espèces présentes dans la baie</string> + <string name="becasseau">Bécasseau Sanderling</string> + <string name="goeland_argente"><u>Goëland argenté</u>\nJe ne m’éloigne guère de la mer, ni même au-delà d’un rayon de cent kilomètres + autour de mon lieu de naissance. Mon plumage noir sur le dos et mes yeux gris me différencient de mes cousins les goélands argenté et brun. + Ma taille imposante me permet de régner en seigneur sur les autres espèces de goélands, dont, à l’occasion, je peux mettre les plus jeunes à mon menu.</string> + <string name="connexion_text">Connexion</string> + <string name="apprendre">Apprendre</string> + <string name="know_more">En apprendre plus</string> + <string name="becasseau_sanderling"><u>Bécasseau Sanderling</u>\nJe suis un petit limicole court sur pattes et assez rondelet. + Très actif, je me déplace avec une agilité et une rapidité surprenante sur les plages, en quête de nourriture. + Il est même compliqué de distinguer le mouvement de mes pattes ! En hiver, mon plumage est uniformément gris argenté sur le dessus, + tandis que mon ventre est d’un blanc pur.</string> + <string name="retour">Retour</string> + <string name="bernache">Bernache Cravant</string> + <string name="bernache_cravant"><u>Bernache Cravant</u>\nLa bernache cravant est une oie migratrice qui + arrive de Sibérie, où elle se reproduit, pour hiverner sur nos côtes d’octobre à mars. + Herbivore, elle se nourrit sur les herbiers de zostères, dont elle broute les feuilles, et est largement inféodée à ces herbiers côtiers.</string> + <string name="goeland">Goëland argenté</string> + <string name="mouette">Mouette rieuse</string> + <string name="pluvier_argente">Pluvier Argenté</string> + <string name="grand_cormoran">Grand cormoran</string> + <string name="foulque_macroule">Foulque macroule</string> + <string name="tadorne_de_belon">Tadorne de Belon</string> + <string name="chevalier_gambette">Chevalier Gambette</string> + <string name="mouette_rieuse"><u>Mouette rieuse</u>\nMes ricanements très vexants m’ont valu mon nom. On dirait que je me moque du monde ! + Oiseau d’eau, je suis très commune dans toutes les villes fluviales auxquelles j’accède en remontant les cours d’eau. + Je préfère les eaux calmes des fleuves et des lacs pour me reproduire et le climat océanique pour passer l’hiver.</string> + <string name="pluvier"><u>Pluvier Argenté</u>\nLe saviez-vous ? Mon nom en vieux français signifie que j’arrive avec les pluies ! + J’ai un bec très court et un plumage aux couleurs de la vase, difficile de me repérer sur les vasières… + Je me reproduis dans le Grand Nord, dans la toundra arctique et j’arrive dans votre pays pour y passer l’hiver.</string> + <string name="cormoran"><u>Grand cormoran</u>\n« Cormoran » vient du vieux français « corbeau de mer ». + Comme mon nom l’indique, mon plumage est de couleur noir corbeau. Mon bec est jaune pâle et mes narines se ferment sous l’eau, + ce qui me permet de rester en apnée pendant soixante-dix secondes. En revanche, je ne suis pas que marin, n’aimant pas plonger trop profond, + les eaux des étangs et rivières me conviennent également.</string> + <string name="foulque"><u>Foulque macroule</u>\nLa Foulque macroule est un gros oiseau qui a l’air bossu quand il marche au sol, + ce qui n’est pas très fréquent car il passe la plupart de son temps sur les plans d’eau. + Ses plumes sont noires, ses yeux petits et rouges, son bec blanc est surmonté d’une espèce d’écusson blanc au front + (rappelons-nous, celui de la poule d’eau est rouge vif). Sa queue est courte et une bande blanche est visible en vol sur ses rémiges secondaires.</string> + <string name="tadorne"><u>Tadorne de Belon</u>\nJe ressemble à une oie mais j’ai un bec de canard bien rouge. + Si je suis un mâle, mon bec est surmonté d’un tubercule rouge également. + Au printemps vous pouvez observer mes petits cannetons gardés en groupe !</string> + <string name="chevalier"><u>Chevalier gambette</u>\nPlutôt solitaire et long sur pattes, + vous me reconnaîtrez à mes pattes et à mon bec bien rouges. Pour le reste je suis brun moucheté sur le dos et blanc sur le ventre, + une parfaite tenue de camouflage !</string> + <string name="tuto_cam">Avec sa caméra</string> + <string name="tuto_id">Identifier des espèces</string> + <string name="tuto_gal">Sur sa galerie</string> + <string name="tuto_app">En apprendre plus sur\nl\'avifaune présente à Lorient</string> + <string name="tuto_page_app">Sur la page Apprendre</string> + <string name="tuto_end">C\'est parti</string> + <string name="camera">Caméra</string> + <string name="galerie">Galerie</string> + <string name="especes">Espèce(s) identifiée(s)</string> + <string name="see_tuto">Revoir le tutoriel</string> + <string name="csv_export_text">Exporter au format CSV</string> + <string name="nombre_de_photos_prises">Nombre de photos prises</string> + <string name="refreshed">Actualisé le :</string> + <string name="proportions">Proportions par zone</string> + <string name="nombre_ind">Nombre d\'invidus par espèce</string> + <string name="settings_gen">Paramètres généraux</string> + <string name="mode">Affichage</string> + <string name="tutorial">Télécharger le tutoriel approfondi</string> + <string name="settings_conf">Paramètres de confidentialité</string> + <string name="personal_data">Traitement des données personnelles</string> + <string name="download">Télécharger</string> + <string name="mode_sombre">Mode sombre</string> + <string name="mode_sombre_texte">Le mode sombre économise votre batterie et lutte contre la fatigue visuelle</string> + <string name="download_text">Télécharge un guide d’utilisation approfondi de l’application au format pdf</string> + <string-array name="zone_array"> + <item>Zone 1</item> + <item>Zone 2</item> + <item>Zone 3</item> + <item>Zone 4</item> + </string-array> </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 7147040e585f129ed8f7b2d366abe10c83d75bb7..9fc7d521efbb9d5e529befbb098dcb350bf1a80e 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -6,8 +6,135 @@ </style> <style name="Theme.MyApplication" parent="Base.Theme.MyApplication" /> + <style name="ButtonAppearance" parent="ShapeAppearance.MaterialComponents.SmallComponent"> <item name="cornerFamily">rounded</item> <item name="cornerRadius">8dp</item> + <item name="backgroundTint">#517293</item> + <item name="iconTint">#D9D9D9</item> + </style> + + <style name="ModeSombreButtonAppearance" parent="ShapeAppearance.MaterialComponents.SmallComponent"> + <item name="cornerFamily">rounded</item> + <item name="cornerRadius">8dp</item> + <item name="backgroundTint">#517293</item> + <item name="iconTint">#D9D9D9</item> + <item name="android:text">"Mode sombre"</item> + </style> + + <style name="RoundedImageView" parent=""> + <item name="cornerFamily">rounded</item> + <item name="cornerSize">8dp</item> + <item name="cornerRadius">8dp</item> + <item name="color">@color/white</item> + </style> + + <style name="TopAppearance" parent=""> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:textColor">#1E1E1E</item> + <item name="android:background">@drawable/shape_transparent_top_rounded</item> + <item name="fontFamily">@font/inter</item> + <item name="android:gravity">center</item> + <item name="android:textAlignment">center</item> + <item name="android:textSize">16sp</item> + <item name="android:paddingTop">7dp</item> + <item name="android:paddingBottom">7dp</item> + </style> + + <style name="BottomAppearance" parent=""> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:background">@drawable/shape_transparent_bottom_rounded</item> + <item name="android:textColor">#D9D9D9</item> + </style> + + <style name="TopTopAppearance" parent=""> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:background">@drawable/shape_transparent</item> + <item name="android:fontFamily">@font/inter</item> + <item name="android:textAlignment">center</item> + <item name="android:textColor">#1E1E1E</item> + <item name="android:textSize">16sp</item> + </style> + + <style name="PageTitleAppearance" parent=""> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:background">@drawable/polygon_5</item> + <item name="android:textColor">#1E1E1E</item> + <item name="android:textAlignment">center</item> + <item name="android:textSize">38sp</item> + </style> + + <style name="MiniRectangle" parent=""> + <item name="android:src">@drawable/rectangle_1</item> + </style> + + <style name="BigPolygon" parent=""> + <item name="android:src">@drawable/polygon_2</item> + </style> + + <style name="BottomPolygon" parent=""> + <item name="android:src">@drawable/polygon_4</item> + </style> + + <style name="BottomPolygonMain" parent=""> + <item name="android:src">@drawable/polygon_9</item> + </style> + + <style name="LogoMain" parent=""> + <item name="android:src">@drawable/logo_main</item> + </style> + + <style name="MainBackground" parent=""> + <item name="android:background">@color/white</item> + </style> + + <style name="NameMain" parent=""> + <item name="android:src">@drawable/plunv</item> + </style> + + <style name="SubNameMain" parent=""> + <item name="android:src">@drawable/avi_main</item> + </style> + + <style name="BottomNavTint" parent=""> + <item name="android:background">#E0517293</item> + <item name="itemIconTint">#ABABAB</item> + </style> + + <style name="OverlayAppearance" parent=""> + <item name="android:background">@drawable/shape_transparent</item> + <item name="android:textColor">#1E1E1E</item> + </style> + + <style name="TutorialTitles" parent=""> + <item name="android:background">@drawable/shape_transparent_blue</item> + </style> + + <style name="TutoPage1" parent=""> + <item name="android:src">@drawable/polygon_6</item> + </style> + + <style name="TutoLine1" parent=""> + <item name="android:src">@drawable/line_1</item> + </style> + + <style name="TutoPage2" parent=""> + <item name="android:src">@drawable/polygon_7</item> + </style> + + <style name="TutoLine2" parent=""> + <item name="android:src">@drawable/line_2</item> + </style> + + <style name="TutoPage3" parent=""> + <item name="android:src">@drawable/polygon_8</item> + </style> + + <style name="TutoLine3" parent=""> + <item name="android:src">@drawable/line_3</item> </style> </resources> \ No newline at end of file diff --git a/app/src/main/res/xml/file_paths.xml b/app/src/main/res/xml/file_paths.xml new file mode 100644 index 0000000000000000000000000000000000000000..4448af3c040746e4a98720f8fe4d38e20331c1c1 --- /dev/null +++ b/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<paths> + <files-path name="internal_files" path="." /> +</paths> \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 69015798d8e861a3c3805d166ec9797072f917e4..6a037e25384d2dfe086b2113b911697a986fc9b0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,6 +8,9 @@ material = "1.12.0" activity = "1.9.2" constraintlayout = "2.1.4" flexboxVersion= "3.0.0" +readmoretextviewVersion= "1.0.2" +litertGpu = "1.0.1" +uiGraphicsAndroid = "1.7.5" [libraries] junit = { group = "junit", name = "junit", version.ref = "junit" } @@ -18,6 +21,9 @@ material = { group = "com.google.android.material", name = "material", version.r activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } flexboxlayout = {group="com.google.android.flexbox", name="flexbox", version.ref="flexboxVersion" } +readmoretextview = {group="com.github.colourmoon", name="readmore-textview", version.ref="readmoretextviewVersion"} +litert-gpu = { group = "com.google.ai.edge.litert", name = "litert-gpu", version.ref = "litertGpu" } +ui-graphics-android = { group = "androidx.compose.ui", name = "ui-graphics-android", version.ref = "uiGraphicsAndroid" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 5dc01897baab47e59edade0e8852810e5fc1d4c5..b34f49e4d2f52e775f8d696b3791645372d74da3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,6 +9,9 @@ pluginManagement { } mavenCentral() gradlePluginPortal() + maven { + url = uri("https://jitpack.io") + } } } dependencyResolutionManagement { @@ -16,6 +19,9 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven { + url = uri("https://jitpack.io") + } } }