Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
com-ent-projet38-2024
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PFEFFER Melvil
com-ent-projet38-2024
Commits
9bd4a053
Commit
9bd4a053
authored
5 months ago
by
“kamon
Browse files
Options
Downloads
Patches
Plain Diff
Affichage prediction especes multiples
parent
9a38f359
Branches
Branches containing commit
No related tags found
1 merge request
!11
Affichage de prediction multiple
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/com/example/myapplication/PhotoPage.java
+17
-2
17 additions, 2 deletions
app/src/main/java/com/example/myapplication/PhotoPage.java
app/src/main/res/layout/fragment_photo_page.xml
+16
-13
16 additions, 13 deletions
app/src/main/res/layout/fragment_photo_page.xml
with
33 additions
and
15 deletions
app/src/main/java/com/example/myapplication/PhotoPage.java
+
17
−
2
View file @
9bd4a053
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/fragment_photo_page.xml
+
16
−
13
View file @
9bd4a053
...
...
@@ -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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment