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
df0d01ea
Commit
df0d01ea
authored
Apr 22, 2021
by
chris.crook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
> bigboi III
parent
16f8e758
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
327 additions
and
22 deletions
+327
-22
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
AdminMenu.java
...ain/java/com/example/summative_chris_crook/AdminMenu.java
+7
-7
CheckoutScreen.java
...ava/com/example/summative_chris_crook/CheckoutScreen.java
+1
-0
MainActivity.java
.../java/com/example/summative_chris_crook/MainActivity.java
+3
-3
MainBookingPage.java
...va/com/example/summative_chris_crook/MainBookingPage.java
+5
-5
MainShopPage.java
.../java/com/example/summative_chris_crook/MainShopPage.java
+39
-0
ShopDetails.java
...n/java/com/example/summative_chris_crook/ShopDetails.java
+96
-0
UserMenu.java
...main/java/com/example/summative_chris_crook/UserMenu.java
+3
-3
activity_main_booking_page.xml
app/src/main/res/layout/activity_main_booking_page.xml
+3
-3
activity_main_shop_page.xml
app/src/main/res/layout/activity_main_shop_page.xml
+133
-0
activity_shop_details.xml
app/src/main/res/layout/activity_shop_details.xml
+35
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
df0d01ea
...
@@ -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=
".CheckoutScreen"
></activity>
<activity
android:name=
".ShopDetails"
></activity>
<activity
android:name=
".CheckoutScreen"
/>
<activity
android:name=
".BookingDetails"
/>
<activity
android:name=
".BookingDetails"
/>
<activity
android:name=
".PasswordSettings"
/>
<activity
android:name=
".PasswordSettings"
/>
<activity
android:name=
".CurrencySelect"
/>
<activity
android:name=
".CurrencySelect"
/>
...
...
app/src/main/java/com/example/summative_chris_crook/AdminMenu.java
View file @
df0d01ea
...
@@ -36,13 +36,13 @@ public class AdminMenu extends AppCompatActivity {
...
@@ -36,13 +36,13 @@ public class AdminMenu extends AppCompatActivity {
String
[]
temploadarray
=
temp
.
split
(
"&"
);
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//bugfixing stuff
//bugfixing stuff
Toast
.
makeText
(
getApplicationContext
(),
temp
,
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temp, Toast.LENGTH_LONG).show();
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
i
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [i], Toast.LENGTH_LONG).show();
}
}
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Main Menu"
);
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Main Menu"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"Log Out"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"Log Out"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings"
);
...
@@ -57,7 +57,7 @@ public class AdminMenu extends AppCompatActivity {
...
@@ -57,7 +57,7 @@ public class AdminMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings"
);
}
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//load french button names
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//load french button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Menu principal"
);
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Menu principal"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"se déconnecter"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"se déconnecter"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"réservation"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"réservation"
);
...
@@ -72,7 +72,7 @@ public class AdminMenu extends AppCompatActivity {
...
@@ -72,7 +72,7 @@ public class AdminMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (FR)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (FR)"
);
}
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//load spanish button names
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//load spanish button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Menú principal"
);
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Menú principal"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (ESP)"
);
...
@@ -87,7 +87,7 @@ public class AdminMenu extends AppCompatActivity {
...
@@ -87,7 +87,7 @@ public class AdminMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (ESP)"
);
}
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//load german button names
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//load german button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Hauptmenü"
);
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Hauptmenü"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (DE)"
);
...
@@ -102,7 +102,7 @@ public class AdminMenu extends AppCompatActivity {
...
@@ -102,7 +102,7 @@ public class AdminMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (DE)"
);
}
}
else
{
//load a default set of button names
else
{
//load a default set of button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"Shop (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"Shop (something broke)"
);
...
...
app/src/main/java/com/example/summative_chris_crook/CheckoutScreen.java
View file @
df0d01ea
...
@@ -155,6 +155,7 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -155,6 +155,7 @@ public class CheckoutScreen extends AppCompatActivity {
bookingoutput
+=
"\n\nTotal: "
;
bookingoutput
+=
"\n\nTotal: "
;
if
(
temploadarray
[
3
].
equals
(
"£"
)){
if
(
temploadarray
[
3
].
equals
(
"£"
)){
bookingoutput
+=
"£"
;
bookingoutput
+=
"£"
;
bookingoutput
+=
totalprice
;
}
}
if
(
temploadarray
[
3
].
equals
(
"€"
)){
if
(
temploadarray
[
3
].
equals
(
"€"
)){
bookingoutput
+=
"€"
;
bookingoutput
+=
"€"
;
...
...
app/src/main/java/com/example/summative_chris_crook/MainActivity.java
View file @
df0d01ea
...
@@ -226,7 +226,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -226,7 +226,7 @@ public class MainActivity extends AppCompatActivity {
// user is an admin
// user is an admin
Toast
.
makeText
(
getApplicationContext
(),
"Signed in as "
+
magicwords
[
i
]
[
1
]
+
" (admin)"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Signed in as "
+
magicwords
[
i
]
[
1
]
+
" (admin)"
,
Toast
.
LENGTH_SHORT
).
show
();
String
writetotemp
=
magicwords
[
i
]
[
1
]
+
"&"
+
magicwords
[
i
]
[
3
]
+
"&"
+
magicwords
[
i
]
[
4
]
+
"&"
+
magicwords
[
i
]
[
5
]
+
"&"
+
magicwords
[
i
]
[
6
]
+
"&"
+
i
;
String
writetotemp
=
magicwords
[
i
]
[
1
]
+
"&"
+
magicwords
[
i
]
[
3
]
+
"&"
+
magicwords
[
i
]
[
4
]
+
"&"
+
magicwords
[
i
]
[
5
]
+
"&"
+
magicwords
[
i
]
[
6
]
+
"&"
+
i
;
Toast
.
makeText
(
getApplicationContext
(),
"Admin preferences loaded: "
+
writetotemp
,
Toast
.
LENGTH_SHORT
).
show
();
//
Toast.makeText(getApplicationContext(), "Admin preferences loaded: " + writetotemp, Toast.LENGTH_SHORT).show();
try
{
//writetotemp format: name,password,adminflag,currency,language,id
try
{
//writetotemp format: name,password,adminflag,currency,language,id
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
append
(
writetotemp
);
...
@@ -242,7 +242,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -242,7 +242,7 @@ public class MainActivity extends AppCompatActivity {
// user is an admin
// user is an admin
Toast
.
makeText
(
getApplicationContext
(),
"Signed in as "
+
magicwords
[
i
]
[
1
]
+
" (super admin)"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Signed in as "
+
magicwords
[
i
]
[
1
]
+
" (super admin)"
,
Toast
.
LENGTH_SHORT
).
show
();
String
writetotemp
=
magicwords
[
i
]
[
1
]
+
"&"
+
magicwords
[
i
]
[
3
]
+
"&"
+
magicwords
[
i
]
[
4
]
+
"&"
+
magicwords
[
i
]
[
5
]
+
"&"
+
magicwords
[
i
]
[
6
]
+
"&"
+
i
;
String
writetotemp
=
magicwords
[
i
]
[
1
]
+
"&"
+
magicwords
[
i
]
[
3
]
+
"&"
+
magicwords
[
i
]
[
4
]
+
"&"
+
magicwords
[
i
]
[
5
]
+
"&"
+
magicwords
[
i
]
[
6
]
+
"&"
+
i
;
Toast
.
makeText
(
getApplicationContext
(),
"Admin preferences loaded: "
+
writetotemp
,
Toast
.
LENGTH_SHORT
).
show
();
//
Toast.makeText(getApplicationContext(), "Admin preferences loaded: " + writetotemp, Toast.LENGTH_SHORT).show();
try
{
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
append
(
writetotemp
);
...
@@ -257,7 +257,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -257,7 +257,7 @@ public class MainActivity extends AppCompatActivity {
else
{
else
{
Toast
.
makeText
(
getApplicationContext
(),
"Signed in as "
+
magicwords
[
i
]
[
1
],
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Signed in as "
+
magicwords
[
i
]
[
1
],
Toast
.
LENGTH_SHORT
).
show
();
String
writetotemp
=
magicwords
[
i
]
[
1
]
+
"&"
+
magicwords
[
i
]
[
3
]
+
"&"
+
magicwords
[
i
]
[
4
]
+
"&"
+
magicwords
[
i
]
[
5
]
+
"&"
+
magicwords
[
i
]
[
6
]
+
"&"
+
i
;
// name,flag,currency,language,internalID
String
writetotemp
=
magicwords
[
i
]
[
1
]
+
"&"
+
magicwords
[
i
]
[
3
]
+
"&"
+
magicwords
[
i
]
[
4
]
+
"&"
+
magicwords
[
i
]
[
5
]
+
"&"
+
magicwords
[
i
]
[
6
]
+
"&"
+
i
;
// name,flag,currency,language,internalID
Toast
.
makeText
(
getApplicationContext
(),
"User preferences loaded: "
+
writetotemp
,
Toast
.
LENGTH_SHORT
).
show
();
//
Toast.makeText(getApplicationContext(), "User preferences loaded: " + writetotemp, Toast.LENGTH_SHORT).show();
try
{
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
append
(
writetotemp
);
...
...
app/src/main/java/com/example/summative_chris_crook/MainBookingPage.java
View file @
df0d01ea
...
@@ -48,7 +48,7 @@ public class MainBookingPage extends AppCompatActivity {
...
@@ -48,7 +48,7 @@ public class MainBookingPage extends AppCompatActivity {
String
[]
temploadarray
=
temp
.
split
(
"&"
);
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Bookings"
);
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
...
@@ -56,7 +56,7 @@ public class MainBookingPage extends AppCompatActivity {
...
@@ -56,7 +56,7 @@ public class MainBookingPage extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Menu de réservation"
);
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Menu de réservation"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"de retour"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"de retour"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
...
@@ -64,7 +64,7 @@ public class MainBookingPage extends AppCompatActivity {
...
@@ -64,7 +64,7 @@ public class MainBookingPage extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Menú de reserva"
);
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Menú de reserva"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"espalda"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
...
@@ -72,7 +72,7 @@ public class MainBookingPage extends AppCompatActivity {
...
@@ -72,7 +72,7 @@ public class MainBookingPage extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Buchungsmenü"
);
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Buchungsmenü"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"rückseite"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Suche nach Museum"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Suche nach Museum"
);
...
@@ -80,7 +80,7 @@ public class MainBookingPage extends AppCompatActivity {
...
@@ -80,7 +80,7 @@ public class MainBookingPage extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"kaufhaus"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"kaufhaus"
);
}
}
else
{
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Back"
);
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back (something broke)"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
...
...
app/src/main/java/com/example/summative_chris_crook/MainShopPage.java
View file @
df0d01ea
...
@@ -9,10 +9,16 @@ import android.widget.Button;
...
@@ -9,10 +9,16 @@ import android.widget.Button;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.util.Scanner
;
import
java.util.Scanner
;
public
class
MainShopPage
extends
AppCompatActivity
{
public
class
MainShopPage
extends
AppCompatActivity
{
String
filename1
=
"magicwords"
;
String
filename2
=
"appdatatxt"
;
File
file1
;
File
file2
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -90,4 +96,37 @@ public class MainShopPage extends AppCompatActivity {
...
@@ -90,4 +96,37 @@ public class MainShopPage extends AppCompatActivity {
Toast
.
makeText
(
getApplicationContext
(),
"read error"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"read error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
public
String
openandload
(){
try
{
Scanner
reader
=
new
Scanner
(
file1
);
String
temp
=
""
;
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
//Toast.makeText(getApplicationContext(), temp + " ", Toast.LENGTH_LONG).show();
return
temp
;
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"read error"
,
Toast
.
LENGTH_LONG
).
show
();
return
"&&&"
;
}
}
public
void
item1
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"02&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
);
}
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/ShopDetails.java
0 → 100644
View file @
df0d01ea
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.Button
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.util.Scanner
;
public
class
ShopDetails
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_shop_details
);
String
filename2
=
"appdatatxt"
;
File
file2
;
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
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,name,city,country,price
temp
+=
"&"
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
// name,password,adminflag,currency,language,id
String
title
;
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
i
]
,
Toast
.
LENGTH_LONG
).
show
();
}
String
passedtitle
=
passed
[
1
];
if
(
temploadarray
[
9
].
equals
(
"ENG"
)){
title
=
"Booking for: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView29
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button83
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
9
].
equals
(
"FRA"
)){
title
=
"Réservation pour: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView29
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button83
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
9
].
equals
(
"ESP"
)){
title
=
"Reserva para: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView29
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button83
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
9
].
equals
(
"DEU"
)){
title
=
"Buchung für: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView29
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button83
)).
setText
(
"rückseite"
);
}
else
{
title
=
"Booking for: (not ENG) "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView29
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button83
)).
setText
(
"Back"
);
}
((
EditText
)
findViewById
(
R
.
id
.
YEET3
)).
setText
(
temp
);
}
public
void
goback
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainShopPage
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/UserMenu.java
View file @
df0d01ea
...
@@ -34,9 +34,9 @@ public class UserMenu extends AppCompatActivity {
...
@@ -34,9 +34,9 @@ public class UserMenu extends AppCompatActivity {
String
[]
temploadarray
=
temp
.
split
(
"&"
);
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//bugfixing stuff
//bugfixing stuff
Toast
.
makeText
(
getApplicationContext
(),
temp
,
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temp, Toast.LENGTH_LONG).show();
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
i
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [i], Toast.LENGTH_LONG).show();
}
}
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
...
@@ -80,7 +80,7 @@ public class UserMenu extends AppCompatActivity {
...
@@ -80,7 +80,7 @@ public class UserMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
}
}
else
{
//load a default set of button names
else
{
//load a default set of button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//
Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop (something broke)"
);
...
...
app/src/main/res/layout/activity_main_booking_page.xml
View file @
df0d01ea
...
@@ -30,20 +30,20 @@
...
@@ -30,20 +30,20 @@
<TextView
<TextView
android:id=
"@+id/textView21"
android:id=
"@+id/textView21"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0px
"
android:text=
"TextView"
/>
android:text=
"TextView"
/>
<EditText
<EditText
android:id=
"@+id/editTextTextPersonName"
android:id=
"@+id/editTextTextPersonName"
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"
/>
<Button
<Button
android:id=
"@+id/button42"
android:id=
"@+id/button42"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0px
"
android:text=
"Button"
/>
android:text=
"Button"
/>
<TextView
<TextView
...
...
app/src/main/res/layout/activity_main_shop_page.xml
View file @
df0d01ea
...
@@ -23,6 +23,139 @@
...
@@ -23,6 +23,139 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:onClick=
"goback"
android:text=
"Back"
/>
android:text=
"Back"
/>
<TextView
android:id=
"@+id/textView30"
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:text=
"TextView"
/>
<EditText
android:id=
"@+id/editTextTextPersonName2"
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:ems=
"10"
android:inputType=
"textPersonName"
/>
<Button
android:id=
"@+id/button84"
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:text=
"Button"
/>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fillViewport=
"true"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button85"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"item1"
android:text=
"T-shirt"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView13"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button86"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Button"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView14"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button87"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Button"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView15"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button88"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Button"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView16"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button89"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Button"
/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_shop_details.xml
0 → 100644
View file @
df0d01ea
<?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=
".ShopDetails"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/textView29"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"TextView"
/>
<Button
android:id=
"@+id/button83"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:text=
"Button"
/>
<EditText
android:id=
"@+id/YEET3"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ems=
"10"
android:inputType=
"textPersonName"
android:text=
"Name"
/>
</LinearLayout>
</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