Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Sam_Markey
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sam.markey
Summative_Sam_Markey
Commits
9a68a5a5
Commit
9a68a5a5
authored
Apr 29, 2021
by
Sam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.0 push of World Museums
parent
4f5f7a62
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
22 deletions
+47
-22
booking.java
...rc/main/java/com/example/museumworld/booking/booking.java
+39
-22
strings.xml
app/src/main/res/values-fr/strings.xml
+4
-0
strings.xml
app/src/main/res/values/strings.xml
+4
-0
No files found.
app/src/main/java/com/example/museumworld/booking/booking.java
View file @
9a68a5a5
...
@@ -14,6 +14,7 @@ import android.widget.ImageView;
...
@@ -14,6 +14,7 @@ import android.widget.ImageView;
import
android.widget.Spinner
;
import
android.widget.Spinner
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.coordinatorlayout.widget.CoordinatorLayout
;
import
androidx.coordinatorlayout.widget.CoordinatorLayout
;
import
androidx.core.content.res.ResourcesCompat
;
import
androidx.core.content.res.ResourcesCompat
;
...
@@ -21,11 +22,13 @@ import androidx.fragment.app.DialogFragment;
...
@@ -21,11 +22,13 @@ import androidx.fragment.app.DialogFragment;
import
com.example.museumworld.R
;
import
com.example.museumworld.R
;
import
com.example.museumworld.cafe_shop.cafe_activity
;
import
com.example.museumworld.cafe_shop.cafe_activity
;
import
com.example.museumworld.checkout.Receipt
;
import
com.example.museumworld.details.MuseumDetails
;
import
com.example.museumworld.details.MuseumDetails
;
import
com.google.android.material.snackbar.Snackbar
;
import
com.google.android.material.snackbar.Snackbar
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -88,29 +91,8 @@ public class booking extends AppCompatActivity implements View.OnClickListener,
...
@@ -88,29 +91,8 @@ public class booking extends AppCompatActivity implements View.OnClickListener,
snackbarAlert
(
"Please Select a date"
,
true
);
snackbarAlert
(
"Please Select a date"
,
true
);
Log
.
d
(
"TEStB"
,
"TEST"
);
Log
.
d
(
"TEStB"
,
"TEST"
);
}
else
{
}
else
{
//select the spinner item
OpenDialogBox
(
getString
(
R
.
string
.
bookingTitle
));
switch
(
spinner
.
getSelectedItem
().
toString
())
{
case
"9-11am"
:
timeSelected
=
"09:00"
;
break
;
case
"11-1pm"
:
timeSelected
=
"11:00"
;
break
;
case
"1-3pm"
:
timeSelected
=
"13:00"
;
break
;
case
"3-5pm"
:
timeSelected
=
"15:00"
;
break
;
}
//start the cafe activity
Intent
cafe
=
new
Intent
(
this
,
cafe_activity
.
class
);
//put the URL image in the cafe activity
cafe
.
putExtra
(
"topURL"
,
topImgURL
);
startActivity
(
cafe
);
}
}
break
;
break
;
}
}
...
@@ -193,4 +175,39 @@ public class booking extends AppCompatActivity implements View.OnClickListener,
...
@@ -193,4 +175,39 @@ public class booking extends AppCompatActivity implements View.OnClickListener,
}
}
alert
.
show
();
alert
.
show
();
}
}
public
void
OpenDialogBox
(
String
title
)
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
,
R
.
style
.
AlertDialogTheme
);
builder
.
setTitle
(
title
)
.
setMessage
(
getString
(
R
.
string
.
bookingConfirm
)
+
" "
+
MuseumDetails
.
MuseumName
+
"\n"
+
getString
(
R
.
string
.
bookingConfirm2
)+
" "
+
dateSelected
+
"\n"
+
getString
(
R
.
string
.
bookingConfirm3
)
+
" "
+
spinner
.
getSelectedItem
().
toString
())
.
setPositiveButton
(
getResources
().
getString
(
R
.
string
.
yes
),
(
dialog
,
which
)
->
{
switch
(
spinner
.
getSelectedItem
().
toString
())
{
case
"9-11am"
:
timeSelected
=
"09:00"
;
break
;
case
"11-1pm"
:
timeSelected
=
"11:00"
;
break
;
case
"1-3pm"
:
timeSelected
=
"13:00"
;
break
;
case
"3-5pm"
:
timeSelected
=
"15:00"
;
break
;
}
//start the cafe activity
Intent
cafe
=
new
Intent
(
this
,
cafe_activity
.
class
);
//put the URL image in the cafe activity
cafe
.
putExtra
(
"topURL"
,
topImgURL
);
startActivity
(
cafe
);
}).
setNegativeButton
(
getResources
().
getString
(
R
.
string
.
no
),
(
dialog
,
which
)
->
{
});
builder
.
show
();
}
}
}
\ No newline at end of file
app/src/main/res/values-fr/strings.xml
View file @
9a68a5a5
...
@@ -82,4 +82,8 @@
...
@@ -82,4 +82,8 @@
<string
name=
"select_time"
>
Sélectionnez l\'heure
</string>
<string
name=
"select_time"
>
Sélectionnez l\'heure
</string>
<string
name=
"too_much_input"
>
Vous êtes trop entré
</string>
<string
name=
"too_much_input"
>
Vous êtes trop entré
</string>
<string
name=
"world_museums"
>
Musées du monde
</string>
<string
name=
"world_museums"
>
Musées du monde
</string>
<string
name=
"bookingConfirm"
>
Êtes-vous sûr de vouloir réserver:
</string>
<string
name=
"bookingConfirm2"
>
Daté:
</string>
<string
name=
"bookingConfirm3"
>
Temps:
</string>
<string
name=
"bookingTitle"
>
Confirmer la réservation
</string>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
9a68a5a5
...
@@ -73,6 +73,10 @@
...
@@ -73,6 +73,10 @@
<string
name=
"email_invalid"
>
Please Enter a Valid Email
</string>
<string
name=
"email_invalid"
>
Please Enter a Valid Email
</string>
<string
name=
"email_sent"
>
The Receipt Was sent to the email
</string>
<string
name=
"email_sent"
>
The Receipt Was sent to the email
</string>
<string
name=
"email_error"
>
Something went wrong please try again
</string>
<string
name=
"email_error"
>
Something went wrong please try again
</string>
<string
name=
"bookingConfirm"
>
Are you sure you want to book:
</string>
<string
name=
"bookingConfirm2"
>
Date:
</string>
<string
name=
"bookingConfirm3"
>
Time:
</string>
<string
name=
"bookingTitle"
>
Confirm Booking
</string>
<!-- LOGIN / REGISTER-->
<!-- LOGIN / REGISTER-->
<string
name=
"login_usernameError"
>
*Name has to be 5 characters long
</string>
<string
name=
"login_usernameError"
>
*Name has to be 5 characters long
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment