Skip to content
Snippets Groups Projects
Commit 9bd4a053 authored by “kamon's avatar “kamon
Browse files

Affichage prediction especes multiples

parent 9a38f359
Branches
No related tags found
1 merge request!11Affichage de prediction multiple
......@@ -37,7 +37,7 @@ public class PhotoPage extends Fragment {
private static String predictionOutput;
Button cameraButton, folderButton;
Button cameraButton, folderButton, identifiedSpeciesButton;
TextView textPredictionOutput, textProbabilityOutput;
ImageView imageView;
FrameLayout formLayout;
......@@ -48,12 +48,14 @@ public class PhotoPage extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
predictionOutput = null;
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);
identifiedSpeciesButton = view.findViewById(R.id.identified_species_button);
textPredictionOutput = view.findViewById(R.id.textPredictionOutput);
textProbabilityOutput = view.findViewById(R.id.textProbabilityOutput);
//textProbabilityOutput = view.findViewById(R.id.textProbabilityOutput);
imageView = view.findViewById(R.id.main_image_display);
Button seeTutoButton = view.findViewById(R.id.see_tuto);
......@@ -82,6 +84,17 @@ public class PhotoPage extends Fragment {
}
});
identifiedSpeciesButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(predictionOutput == null){
Toast.makeText(getContext(), "Veuillez prendre une photo ou charger une image depuis votre gallerie.", Toast.LENGTH_LONG).show();
}
else Toast.makeText(getContext(), predictionOutput, Toast.LENGTH_LONG).show();
}
});
View.OnClickListener lSeeTutoButton = new View.OnClickListener() {
@Override
public void onClick(View view) {
......@@ -90,6 +103,8 @@ public class PhotoPage extends Fragment {
startActivity(intent);
getActivity().finish();
}
};
seeTutoButton.setOnClickListener(lSeeTutoButton);
......
......@@ -65,6 +65,7 @@
tools:srcCompat="@tools:sample/avatars" />
<Button
android:id="@+id/identified_species_button"
style="@style/ButtonAppearance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -72,11 +73,17 @@
android:layout_marginTop="20dp"
android:fontFamily="@font/inter"
android:paddingHorizontal="40dp"
android:text="@string/especes"
android:text="Voir espèce(s) identifiée(s)"
android:textSize="15sp" />
</FrameLayout>
<!-- Prediction Text -->
<!-- Accuracy Text -->
<!-- Prediction Label -->
<TextView
android:id="@+id/textPredictionOutput"
android:layout_width="351dp"
......@@ -88,19 +95,7 @@
android:textSize="17sp"
android:textStyle="bold" />
<!-- Accuracy Text -->
<TextView
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" />
<!-- Prediction Label -->
<TextView
android:id="@+id/prediction_label"
android:layout_width="wrap_content"
......@@ -121,4 +116,12 @@
android:paddingEnd="50dp"
android:text="@string/photo" />
<EditText
android:id="@+id/editTextTextMultiLine4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:gravity="start|top"
android:inputType="textMultiLine" />
</FrameLayout>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment