Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Simmitive_Chris_Crook
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
chris.crook
Simmitive_Chris_Crook
Commits
167907f9
Commit
167907f9
authored
Apr 23, 2021
by
chris.crook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
> big boi IV (the voyage home)
parent
df0d01ea
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1263 additions
and
24 deletions
+1263
-24
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
BuyScreen.java
...ain/java/com/example/summative_chris_crook/BuyScreen.java
+77
-0
CheckoutScreen.java
...ava/com/example/summative_chris_crook/CheckoutScreen.java
+110
-1
MainActivity.java
.../java/com/example/summative_chris_crook/MainActivity.java
+78
-0
MainShopPage.java
.../java/com/example/summative_chris_crook/MainShopPage.java
+240
-2
ShopDetails.java
...n/java/com/example/summative_chris_crook/ShopDetails.java
+365
-4
activity_admin_register.xml
app/src/main/res/layout/activity_admin_register.xml
+8
-7
activity_buy_screen.xml
app/src/main/res/layout/activity_buy_screen.xml
+46
-0
activity_checkout_screen.xml
app/src/main/res/layout/activity_checkout_screen.xml
+14
-1
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-1
activity_main_booking_page.xml
app/src/main/res/layout/activity_main_booking_page.xml
+1
-1
activity_main_shop_page.xml
app/src/main/res/layout/activity_main_shop_page.xml
+238
-5
activity_shop_details.xml
app/src/main/res/layout/activity_shop_details.xml
+83
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
167907f9
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.Summative_Chris_Crook"
>
android:theme=
"@style/Theme.Summative_Chris_Crook"
>
<activity
android:name=
".ShopDetails"
></activity>
<activity
android:name=
".BuyScreen"
></activity>
<activity
android:name=
".ShopDetails"
/>
<activity
android:name=
".CheckoutScreen"
/>
<activity
android:name=
".CheckoutScreen"
/>
<activity
android:name=
".BookingDetails"
/>
<activity
android:name=
".BookingDetails"
/>
<activity
android:name=
".PasswordSettings"
/>
<activity
android:name=
".PasswordSettings"
/>
...
...
app/src/main/java/com/example/summative_chris_crook/BuyScreen.java
0 → 100644
View file @
167907f9
package
com
.
example
.
summative_chris_crook
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.util.Scanner
;
public
class
BuyScreen
extends
AppCompatActivity
{
String
filename5
=
"pass"
;
File
file5
;
Double
Euro
=
1.16
;
Double
USD
=
1.40
;
Double
HKD
=
10.85
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_buy_screen
);
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file5
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
String
[]
passed
=
temp
.
split
(
"&"
);
//id number,full_receipt,price(£)
((
TextView
)
findViewById
(
R
.
id
.
textView36
)).
setText
(
"Booking number: "
+
passed
[
0
]);
((
TextView
)
findViewById
(
R
.
id
.
textView37
)).
setText
(
"Price to pay: £"
+
passed
[
2
]
+
", all transactions are made in GBP."
);
}
public
void
goback
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
CheckoutScreen
.
class
);
startActivity
(
intent
);
}
public
void
YouWillPayForWhatYouHaveDone
(
View
view
){
String
filename6
=
"Booking"
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
filename7
=
"ItemShop"
;
File
file7
;
file7
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename7
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file7
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
CheckoutScreen
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/CheckoutScreen.java
View file @
167907f9
...
@@ -64,10 +64,21 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -64,10 +64,21 @@ public class CheckoutScreen extends AppCompatActivity {
//
//
}
}
String
[]
passed
=
temp
.
split
(
"&"
);
// id,name,city,country,price
String
[]
passed
=
temp
.
split
(
"&"
);
// id,name,city,country,price
String
filename7
=
"ItemShop"
;
// + passed[1] + passed[0];
File
file7
;
file7
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename7
+
".txt"
);
String
read
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file7
);
while
(
reader
.
hasNextLine
())
{
read
=
read
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
filename6
=
"Booking"
;
// + passed[1] + passed[0];
String
filename6
=
"Booking"
;
// + passed[1] + passed[0];
File
file6
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
read
=
""
;
String
items
=
read
;
read
=
""
;
try
{
try
{
Scanner
reader
=
new
Scanner
(
file6
);
Scanner
reader
=
new
Scanner
(
file6
);
while
(
reader
.
hasNextLine
())
{
while
(
reader
.
hasNextLine
())
{
...
@@ -82,6 +93,7 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -82,6 +93,7 @@ public class CheckoutScreen extends AppCompatActivity {
int
totalprice
=
0
;
int
totalprice
=
0
;
int
idint2
=
(
int
)
Math
.
round
(
Math
.
random
()
*
(
999999
-
100000
+
1
)
+
100000
);
int
idint2
=
(
int
)
Math
.
round
(
Math
.
random
()
*
(
999999
-
100000
+
1
)
+
100000
);
String
[]
loadbooking
=
read
.
split
(
"&"
);
String
[]
loadbooking
=
read
.
split
(
"&"
);
String
[]
loaditems
=
items
.
split
(
"&"
);
String
bookingoutput
=
"Cart ID: "
+
idint2
+
"\nBookings made:\n>"
;
String
bookingoutput
=
"Cart ID: "
+
idint2
+
"\nBookings made:\n>"
;
for
(
int
i
=
0
;
i
<
loadbooking
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
loadbooking
.
length
;
i
++){
if
(
i
%
12
==
1
){
if
(
i
%
12
==
1
){
...
@@ -152,6 +164,76 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -152,6 +164,76 @@ public class CheckoutScreen extends AppCompatActivity {
}
}
bookingoutput
+=
"\n\nOther Items:\n>"
;
bookingoutput
+=
"\n\nOther Items:\n>"
;
for
(
int
i
=
0
;
i
<
loaditems
.
length
;
i
++){
if
(
i
%
12
==
1
){
//museum name
bookingoutput
+=
loaditems
[
i
];
bookingoutput
+=
", "
;
}
if
(
i
%
12
==
2
){
//city
// bookingoutput += "(";
// bookingoutput += loaditems [i];
// bookingoutput += "), ";
}
if
(
i
%
12
==
9
){
//currency mode to select
}
if
(
i
%
12
==
4
){
//price
totalprice
+=
Integer
.
parseInt
(
loaditems
[
i
]);
bookingoutput
+=
" "
;
String
pricetest
=
loaditems
[
i
+
4
];
if
(
temploadarray
[
3
].
equals
(
"£"
)){
bookingoutput
+=
"£"
;
bookingoutput
+=
loaditems
[
i
];
}
if
(
temploadarray
[
3
].
equals
(
"€"
)){
bookingoutput
+=
"€"
;
double
price
=
Double
.
parseDouble
(
loaditems
[
i
]);
price
*=
Euro
;
bookingoutput
+=
price
;
bookingoutput
+=
"(£"
;
bookingoutput
+=
loaditems
[
i
];
bookingoutput
+=
")"
;
}
if
(
temploadarray
[
3
].
equals
(
"US$"
)){
bookingoutput
+=
"$"
;
double
price
=
Double
.
parseDouble
(
loaditems
[
i
]);
price
*=
USD
;
bookingoutput
+=
price
;
bookingoutput
+=
"(£"
;
bookingoutput
+=
loaditems
[
i
];
bookingoutput
+=
")"
;
}
if
(
temploadarray
[
3
].
equals
(
"HK$"
)){
bookingoutput
+=
"$"
;
double
price
=
Double
.
parseDouble
(
loaditems
[
i
]);
price
*=
HKD
;
bookingoutput
+=
price
;
bookingoutput
+=
"(£"
;
bookingoutput
+=
loaditems
[
i
];
bookingoutput
+=
")"
;
}
double
price
=
0
;
//bookingoutput += loadbooking [i];
bookingoutput
+=
", "
;
}
if
(
i
%
12
==
11
){
//time slot
bookingoutput
+=
loaditems
[
i
];
bookingoutput
+=
", "
;
}
if
(
i
%
12
==
0
){
//end of each booking entry
//bookingoutput += loadbooking [i];
bookingoutput
+=
"\n"
;
bookingoutput
+=
"> "
;
}
}
//bookingoutput += items;
bookingoutput
+=
"\n\nTotal: "
;
bookingoutput
+=
"\n\nTotal: "
;
if
(
temploadarray
[
3
].
equals
(
"£"
)){
if
(
temploadarray
[
3
].
equals
(
"£"
)){
bookingoutput
+=
"£"
;
bookingoutput
+=
"£"
;
...
@@ -190,6 +272,7 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -190,6 +272,7 @@ public class CheckoutScreen extends AppCompatActivity {
bookingoutput
+=
" All Prices Billed in GBP (£)"
;
bookingoutput
+=
" All Prices Billed in GBP (£)"
;
((
EditText
)
findViewById
(
R
.
id
.
outputcheckout
)).
setText
(
bookingoutput
);
((
EditText
)
findViewById
(
R
.
id
.
outputcheckout
)).
setText
(
bookingoutput
);
((
EditText
)
findViewById
(
R
.
id
.
YEET4
)).
setText
(
idint2
+
"&"
+
bookingoutput
+
"&"
+
totalprice
);
}
}
public
void
gobackfromtheshop
(
View
view
){
public
void
gobackfromtheshop
(
View
view
){
...
@@ -245,6 +328,19 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -245,6 +328,19 @@ public class CheckoutScreen extends AppCompatActivity {
Toast
.
makeText
(
getApplicationContext
(),
"Cart contents wiped"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Cart contents wiped"
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
filename7
=
"ItemShop"
;
File
file7
;
file7
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename7
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file7
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
...
@@ -254,5 +350,18 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -254,5 +350,18 @@ public class CheckoutScreen extends AppCompatActivity {
public
void
ChaChing
(
View
view
){
public
void
ChaChing
(
View
view
){
//buy
//buy
String
writetofile
=
((
EditText
)
findViewById
(
R
.
id
.
YEET4
)).
getText
().
toString
();
String
filename5
=
"pass"
;
// passthrough file (temp storage until overwritten)
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
writetofile
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BuyScreen
.
class
);
startActivity
(
intent
);
}
}
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/MainActivity.java
View file @
167907f9
...
@@ -234,6 +234,32 @@ public class MainActivity extends AppCompatActivity {
...
@@ -234,6 +234,32 @@ public class MainActivity extends AppCompatActivity {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
String
filename6
=
"Booking"
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
filename7
=
"ItemShop"
;
File
file7
;
file7
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename7
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file7
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
return
;
return
;
...
@@ -250,6 +276,32 @@ public class MainActivity extends AppCompatActivity {
...
@@ -250,6 +276,32 @@ public class MainActivity extends AppCompatActivity {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
String
filename6
=
"Booking"
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
filename7
=
"ItemShop"
;
File
file7
;
file7
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename7
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file7
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
return
;
return
;
...
@@ -265,6 +317,32 @@ public class MainActivity extends AppCompatActivity {
...
@@ -265,6 +317,32 @@ public class MainActivity extends AppCompatActivity {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
String
filename6
=
"Booking"
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
filename7
=
"ItemShop"
;
File
file7
;
file7
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename7
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file7
,
false
);
stream
.
append
(
""
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Cart contents wiped", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
UserMenu
.
class
);
Intent
intent
=
new
Intent
(
this
,
UserMenu
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
return
;
return
;
...
...
app/src/main/java/com/example/summative_chris_crook/MainShopPage.java
View file @
167907f9
...
@@ -97,6 +97,16 @@ public class MainShopPage extends AppCompatActivity {
...
@@ -97,6 +97,16 @@ public class MainShopPage extends AppCompatActivity {
}
}
}
}
public
void
tobooking
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainBookingPage
.
class
);
startActivity
(
intent
);
}
public
void
tocart
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
CheckoutScreen
.
class
);
startActivity
(
intent
);
}
public
String
openandload
(){
public
String
openandload
(){
try
{
try
{
Scanner
reader
=
new
Scanner
(
file1
);
Scanner
reader
=
new
Scanner
(
file1
);
...
@@ -113,14 +123,242 @@ public class MainShopPage extends AppCompatActivity {
...
@@ -113,14 +123,242 @@ public class MainShopPage extends AppCompatActivity {
return
"&&&"
;
return
"&&&"
;
}
}
}
}
// generic function to copy and paste whithin this page
public
void
item1
(
View
view
){
public
void
item1
(
View
view
){
String
filename5
=
"pass"
;
// passthrough file (temp storage until overwritten)
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"00&T-shirts&_&_&10"
);
// write format: id,item_name,blank,blank,price
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
// giftshop items
public
void
TShirt
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"01&T-shirts&_&_&10"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Hat
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"02&Hats&_&_&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
SnowGlobe
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"03&Snow Globe&_&_&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
KeyRing
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"04&Key Rings&_&_&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Bottle
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"05&Bottles&_&_&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Mug
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"06&Mugs&_&_&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Coaster
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"07&Coasters&_&_&2"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
// cafe items
public
void
Tea
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"01&Tea&_&_&1"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Water
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"02&Water&_&_&1"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Coffee
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"03&Coffee&_&_&2"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Flatbread
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"04&Flatbread&_&_&2"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Sandvich
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"05&T-Sandwich&_&_&2"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Sweetroll
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"06&Sweet Roll&_&_&2"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
ShopDetails
.
class
);
startActivity
(
intent
);
}
public
void
Salad
(
View
view
){
String
filename5
=
"pass"
;
String
filename5
=
"pass"
;
File
file5
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"0
2&T-shirts&_&_&10
"
);
stream
.
append
(
"0
7&Salad&_&_&2
"
);
stream
.
close
();
stream
.
close
();
}
catch
(
Exception
f
){
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
...
...
app/src/main/java/com/example/summative_chris_crook/ShopDetails.java
View file @
167907f9
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_admin_register.xml
View file @
167907f9
...
@@ -122,15 +122,15 @@
...
@@ -122,15 +122,15 @@
<TextView
<TextView
android:id=
"@+id/textView28"
android:id=
"@+id/textView28"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
90dp
"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"Default Currency"
/>
android:text=
"Default Currency
(Display only, transactions handled in GBP)
"
/>
<EditText
<EditText
android:id=
"@+id/WOAH"
android:id=
"@+id/WOAH"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0px
"
android:ems=
"10"
android:ems=
"10"
android:inputType=
"textPersonName"
android:inputType=
"textPersonName"
android:text=
"ENG"
/>
android:text=
"ENG"
/>
...
@@ -138,15 +138,16 @@
...
@@ -138,15 +138,16 @@
<EditText
<EditText
android:id=
"@+id/currencyStore"
android:id=
"@+id/currencyStore"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0px
"
android:ems=
"10"
android:ems=
"10"
android:inputType=
"textPersonName"
android:inputType=
"textPersonName"
android:text=
"£"
/>
android:text=
"£"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"222dp"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
android:translationY=
"-100dp"
>
<Button
<Button
android:id=
"@+id/button77"
android:id=
"@+id/button77"
...
...
app/src/main/res/layout/activity_buy_screen.xml
0 → 100644
View file @
167907f9
<?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"
tools:context=
".BuyScreen"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/textView35"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Payment"
/>
<Button
android:id=
"@+id/button111"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Back"
/>
<TextView
android:id=
"@+id/textView36"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"TextView"
/>
<TextView
android:id=
"@+id/textView37"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"TextView"
/>
<Button
android:id=
"@+id/button112"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"YouWillPayForWhatYouHaveDone"
android:text=
"Pay"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_checkout_screen.xml
View file @
167907f9
...
@@ -58,8 +58,21 @@
...
@@ -58,8 +58,21 @@
<EditText
<EditText
android:id=
"@+id/outputcheckout"
android:id=
"@+id/outputcheckout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"429dp"
android:layout_height=
"408dp"
android:clickable=
"false"
android:editable=
"false"
android:ems=
"10"
android:ems=
"10"
android:inputType=
"textLongMessage|textMultiLine"
/>
android:inputType=
"textLongMessage|textMultiLine"
/>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<EditText
android:id=
"@+id/YEET4"
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:ems=
"10"
android:inputType=
"textPersonName"
/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
167907f9
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<Button
<Button
android:id=
"@+id/button10"
android:id=
"@+id/button10"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0px
"
android:onClick=
"ohhshiiiiii"
android:onClick=
"ohhshiiiiii"
android:text=
"Button"
/>
android:text=
"Button"
/>
...
...
app/src/main/res/layout/activity_main_booking_page.xml
View file @
167907f9
...
@@ -210,7 +210,7 @@
...
@@ -210,7 +210,7 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
match_parent
"
android:layout_height=
"
0px
"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<ImageView
<ImageView
...
...
app/src/main/res/layout/activity_main_shop_page.xml
View file @
167907f9
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_shop_details.xml
View file @
167907f9
...
@@ -24,12 +24,94 @@
...
@@ -24,12 +24,94 @@
android:onClick=
"goback"
android:onClick=
"goback"
android:text=
"Button"
/>
android:text=
"Button"
/>
<TextView
android:id=
"@+id/textView33"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Price:"
/>
<TextView
android:id=
"@+id/textView34"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Select alocation to pick up:"
/>
<EditText
<EditText
android:id=
"@+id/YEET3"
android:id=
"@+id/YEET3"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0px
"
android:ems=
"10"
android:ems=
"10"
android:inputType=
"textPersonName"
android:inputType=
"textPersonName"
android:text=
"Name"
/>
android:text=
"Name"
/>
<Button
android:id=
"@+id/button101"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"loovie"
android:text=
"Louvre"
/>
<Button
android:id=
"@+id/button102"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"NMOC"
android:text=
"National Museum Of China"
/>
<Button
android:id=
"@+id/button103"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"VM"
android:text=
"Vatican Museums"
/>
<Button
android:id=
"@+id/button104"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"MMOA"
android:text=
"Metropolitan Museum Of Art"
/>
<Button
android:id=
"@+id/button105"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"BM"
android:text=
"British Museum"
/>
<Button
android:id=
"@+id/button106"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"TM"
android:text=
"Tate Modern"
/>
<Button
android:id=
"@+id/button107"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"NG"
android:text=
"National Gallery"
/>
<Button
android:id=
"@+id/button108"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"NHM"
android:text=
"Natural History Museum"
/>
<Button
android:id=
"@+id/button109"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"AMONH"
android:text=
"American Museum Of Natural History"
/>
<Button
android:id=
"@+id/button110"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"SHM"
android:text=
"State Hermatige Museum"
/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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