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
f2fa3135
Commit
f2fa3135
authored
5 months ago
by
PFEFFER Melvil
Browse files
Options
Downloads
Patches
Plain Diff
Corrected problem with time format
parent
7dc10802
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/com/example/myapplication/OverlayDialogFragmentForm.java
+8
-4
8 additions, 4 deletions
.../com/example/myapplication/OverlayDialogFragmentForm.java
with
8 additions
and
4 deletions
app/src/main/java/com/example/myapplication/OverlayDialogFragmentForm.java
+
8
−
4
View file @
f2fa3135
...
...
@@ -47,7 +47,7 @@ public class OverlayDialogFragmentForm extends DialogFragment {
private
String
surroundingsDescription
;
private
String
unknownSpeciesDescription
;
private
String
unknownSpeciesDescription
=
""
;
// Linking the Google Forms
private
final
Retrofit
retrofit
=
new
Retrofit
.
Builder
().
baseUrl
(
"https://docs.google.com/"
).
addConverterFactory
(
GsonConverterFactory
.
create
()).
build
();
...
...
@@ -114,12 +114,14 @@ public class OverlayDialogFragmentForm extends DialogFragment {
// Set the time picker settings
TimePicker
timePicker
=
view
.
findViewById
(
R
.
id
.
time_picker
);
timePicker
.
setIs24HourView
(
true
);
time
=
timePicker
.
getHour
()
+
":"
+
timePicker
.
getMinute
();
if
(
timePicker
.
getHour
()<
10
)
time
=
"0"
+
timePicker
.
getHour
()
+
":"
+
timePicker
.
getMinute
();
else
time
=
timePicker
.
getHour
()
+
":"
+
timePicker
.
getMinute
();
// If time is changed we retain its value
timePicker
.
setOnTimeChangedListener
(
new
TimePicker
.
OnTimeChangedListener
()
{
@Override
public
void
onTimeChanged
(
TimePicker
timePicker
,
int
i
,
int
i1
)
{
time
=
timePicker
.
getHour
()
+
":"
+
timePicker
.
getMinute
();
if
(
timePicker
.
getHour
()<
10
)
time
=
"0"
+
timePicker
.
getHour
()
+
":"
+
timePicker
.
getMinute
();
else
time
=
timePicker
.
getHour
()
+
":"
+
timePicker
.
getMinute
();
}
});
...
...
@@ -129,6 +131,7 @@ public class OverlayDialogFragmentForm extends DialogFragment {
TextView
predictionDisplay
=
view
.
findViewById
(
R
.
id
.
prediction_output
);
String
predictionText
=
"Nous avons détecté sur votre photo :\n"
+
finalPredictionOutput
;
predictionDisplay
.
setText
(
predictionText
);
unknownSpeciesDescription
=
"Pas d'espèces fournies."
;
}
else
{
EditText
unknownSpeciesInput
=
view
.
findViewById
(
R
.
id
.
unknown_species_input
);
unknownSpeciesInput
.
setVisibility
(
EditText
.
VISIBLE
);
...
...
@@ -267,9 +270,10 @@ public class OverlayDialogFragmentForm extends DialogFragment {
getDialog
().
dismiss
();
}
else
{
if
(!
isZoneSelected
)
Toast
.
makeText
(
getContext
(),
"Veuillez sélectionner une zone"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getContext
(),
"Erreur : "
+
response
.
code
(),
Toast
.
LENGTH_SHORT
).
show
();
}
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getContext
(),
"Error: ${e.m
essage
}"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getContext
(),
e
.
getM
essage
()
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
...
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