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
68f28ee7
Commit
68f28ee7
authored
Apr 18, 2021
by
chris.crook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
> bigboi
parent
1c297cc8
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1195 additions
and
12 deletions
+1195
-12
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+5
-1
AdminMenu.java
...ain/java/com/example/summative_chris_crook/AdminMenu.java
+5
-0
CurrencySelect.java
...ava/com/example/summative_chris_crook/CurrencySelect.java
+63
-0
LanguageSelect.java
...ava/com/example/summative_chris_crook/LanguageSelect.java
+598
-0
MainActivity.java
.../java/com/example/summative_chris_crook/MainActivity.java
+6
-4
MainBookingPage.java
...va/com/example/summative_chris_crook/MainBookingPage.java
+48
-4
MainShopPage.java
.../java/com/example/summative_chris_crook/MainShopPage.java
+40
-2
PasswordSettings.java
...a/com/example/summative_chris_crook/PasswordSettings.java
+63
-0
Settings.java
...main/java/com/example/summative_chris_crook/Settings.java
+120
-0
UserMenu.java
...main/java/com/example/summative_chris_crook/UserMenu.java
+75
-0
activity_admin_menu.xml
app/src/main/res/layout/activity_admin_menu.xml
+1
-0
activity_currency_select.xml
app/src/main/res/layout/activity_currency_select.xml
+29
-0
activity_language_select.xml
app/src/main/res/layout/activity_language_select.xml
+55
-0
activity_main_booking_page.xml
app/src/main/res/layout/activity_main_booking_page.xml
+1
-1
activity_password_settings.xml
app/src/main/res/layout/activity_password_settings.xml
+29
-0
activity_settings.xml
app/src/main/res/layout/activity_settings.xml
+56
-0
activity_user_menu.xml
app/src/main/res/layout/activity_user_menu.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
68f28ee7
...
...
@@ -9,7 +9,11 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.Summative_Chris_Crook"
>
<activity
android:name=
".MainShopPage"
></activity>
<activity
android:name=
".PasswordSettings"
></activity>
<activity
android:name=
".CurrencySelect"
/>
<activity
android:name=
".LanguageSelect"
/>
<activity
android:name=
".Settings"
/>
<activity
android:name=
".MainShopPage"
/>
<activity
android:name=
".MainBookingPage"
/>
<activity
android:name=
".AdminRegister"
/>
<activity
android:name=
".AdminMenu"
/>
...
...
app/src/main/java/com/example/summative_chris_crook/AdminMenu.java
View file @
68f28ee7
...
...
@@ -36,6 +36,11 @@ public class AdminMenu extends AppCompatActivity {
startActivity
(
intent
);
}
public
void
CogwheelsTurning
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
Settings
.
class
);
startActivity
(
intent
);
}
public
void
register2electricboogaloo
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
AdminRegister
.
class
);
startActivity
(
intent
);
...
...
app/src/main/java/com/example/summative_chris_crook/CurrencySelect.java
0 → 100644
View file @
68f28ee7
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.Toast
;
import
java.io.File
;
import
java.util.Scanner
;
public
class
CurrencySelect
extends
AppCompatActivity
{
String
filename1
=
"magicwords"
;
String
filename2
=
"appdatatxt"
;
File
file1
;
File
file2
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_currency_select
);
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"rückseite"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"Back (something broke)"
);
}
}
public
void
goback
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
Settings
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/LanguageSelect.java
0 → 100644
View file @
68f28ee7
This diff is collapsed.
Click to expand it.
app/src/main/java/com/example/summative_chris_crook/MainActivity.java
View file @
68f28ee7
...
...
@@ -169,11 +169,13 @@ public class MainActivity extends AppCompatActivity {
// dont add a '%' to the start
tempload
+=
"adminname&adminuser&"
+
"adminpassword"
.
hashCode
()
+
"&ADMIN&£&ENG"
;
tempload
+=
"%examplename&exampleuser&"
+
"examplepassword"
.
hashCode
()
+
"&USER&£&ENG"
;
tempload
+=
"%frenchperson&france&"
+
"pass"
.
hashCode
()
+
"&USER&€&FRA"
;
}
else
{
tempload
+=
"%"
;
tempload
+=
"adminname&adminuser&"
+
"adminpassword"
.
hashCode
()
+
"&ADMIN&£&ENG"
;
tempload
+=
"%examplename&exampleuser&"
+
"examplepassword"
.
hashCode
()
+
"&USER&£&ENG"
;
tempload
+=
"%frenchperson&france&"
+
"pass"
.
hashCode
()
+
"&USER&€&FRA"
;
}
String
[]
temploadarray
=
tempload
.
split
(
"%"
);
size
=
temploadarray
.
length
;
...
...
@@ -223,9 +225,9 @@ public class MainActivity extends AppCompatActivity {
if
(
magicwords
[
i
]
[
4
].
equals
(
"ADMIN"
)){
// user is an admin
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
]
+
"&"
+
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
();
try
{
try
{
//writetotemp format: name,password,adminflag,currency,language,id
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
close
();
...
...
@@ -239,7 +241,7 @@ public class MainActivity extends AppCompatActivity {
else
if
(
magicwords
[
i
]
[
4
].
equals
(
"SUPER"
)){
// user is an admin
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
]
+
"&"
+
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
();
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
...
...
@@ -254,7 +256,7 @@ public class MainActivity extends AppCompatActivity {
}
else
{
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
]
+
"&"
+
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
();
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
...
...
app/src/main/java/com/example/summative_chris_crook/MainBookingPage.java
View file @
68f28ee7
...
...
@@ -2,8 +2,10 @@ 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.Toast
;
import
java.io.File
;
...
...
@@ -24,6 +26,38 @@ public class MainBookingPage extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main_booking_page
);
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"rückseite"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back (something broke)"
);
}
}
public
String
openandload
(){
...
...
@@ -124,12 +158,22 @@ public class MainBookingPage extends AppCompatActivity {
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
datatolookat
=
temp
.
split
(
"&"
);
if
(
datatolookat
[
1
].
equals
(
"ADMIN"
)){
// go to admin screen
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
2
].
equals
(
"ADMIN"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
if
(
temploadarray
[
2
].
equals
(
"SUPER"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
{
// go to user menu
Intent
intent
=
new
Intent
(
this
,
UserMenu
.
class
);
startActivity
(
intent
);
return
;
}
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/MainShopPage.java
View file @
68f28ee7
...
...
@@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Toast
;
import
java.io.File
;
...
...
@@ -16,6 +17,40 @@ public class MainShopPage extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main_shop_page
);
String
filename2
=
"appdatatxt"
;
File
file2
;
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button26
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button26
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button26
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button26
)).
setText
(
"rückseite"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button26
)).
setText
(
"Back (something broke)"
);
}
}
public
void
goback
(
View
view
){
...
...
@@ -31,14 +66,17 @@ public class MainShopPage extends AppCompatActivity {
}
if
(
temp
.
equals
(
""
)){
temp
=
"No user data"
;
return
;
}
if
(
temp
.
equals
(
"ADMIN"
)){
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
2
].
equals
(
"ADMIN"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
if
(
temp
.
equals
(
"SUPER"
)){
else
if
(
temp
loadarray
[
2
]
.
equals
(
"SUPER"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
...
...
app/src/main/java/com/example/summative_chris_crook/PasswordSettings.java
0 → 100644
View file @
68f28ee7
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.Toast
;
import
java.io.File
;
import
java.util.Scanner
;
public
class
PasswordSettings
extends
AppCompatActivity
{
String
filename1
=
"magicwords"
;
String
filename2
=
"appdatatxt"
;
File
file1
;
File
file2
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_password_settings
);
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button36
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button36
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button36
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button36
)).
setText
(
"rückseite"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button36
)).
setText
(
"Back (something broke)"
);
}
}
public
void
goback
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
Settings
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/Settings.java
0 → 100644
View file @
68f28ee7
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.Toast
;
import
java.io.File
;
import
java.util.Scanner
;
public
class
Settings
extends
AppCompatActivity
{
String
filename1
=
"magicwords"
;
String
filename2
=
"appdatatxt"
;
File
file1
;
File
file2
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_settings
);
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"Language"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"Currency"
);
((
Button
)
findViewById
(
R
.
id
.
button29
)).
setText
(
"Password"
);
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"Details"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"de retour"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"Langue"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"monnaie"
);
((
Button
)
findViewById
(
R
.
id
.
button29
)).
setText
(
"passe"
);
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"Détails"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"lenguaje"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"moneda"
);
((
Button
)
findViewById
(
R
.
id
.
button29
)).
setText
(
"clave"
);
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"detalles"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"Sprache"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"Währung"
);
((
Button
)
findViewById
(
R
.
id
.
button29
)).
setText
(
"Passwort"
);
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"Details"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"Back (something broke)"
);
}
}
public
void
gobackfromtheshop
(
View
view
){
//
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
2
].
equals
(
"ADMIN"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
if
(
temploadarray
[
2
].
equals
(
"SUPER"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
{
Intent
intent
=
new
Intent
(
this
,
UserMenu
.
class
);
startActivity
(
intent
);
return
;
}
}
public
void
LanguageMrStark
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
LanguageSelect
.
class
);
startActivity
(
intent
);
}
public
void
WhatWasItAgain
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
PasswordSettings
.
class
);
startActivity
(
intent
);
}
public
void
HK
$IsntWorthless
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
CurrencySelect
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/UserMenu.java
View file @
68f28ee7
...
...
@@ -5,6 +5,11 @@ import androidx.appcompat.app.AppCompatActivity;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.util.Scanner
;
public
class
UserMenu
extends
AppCompatActivity
{
...
...
@@ -12,6 +17,71 @@ public class UserMenu extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_user_menu
);
String
filename2
=
"appdatatxt"
;
File
file2
;
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//bugfixing stuff
Toast
.
makeText
(
getApplicationContext
(),
temp
,
Toast
.
LENGTH_LONG
).
show
();
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
i
],
Toast
.
LENGTH_LONG
).
show
();
}
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Log Out"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button20
)).
setText
(
"Cart and checkout"
);
((
Button
)
findViewById
(
R
.
id
.
button23
)).
setText
(
"Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//load french button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"se déconnecter"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"réservation"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"boutique"
);
((
Button
)
findViewById
(
R
.
id
.
button20
)).
setText
(
"chariot et caisse"
);
((
Button
)
findViewById
(
R
.
id
.
button23
)).
setText
(
"Paramètres"
);
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"supprimer le compte"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//load spanish button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button20
)).
setText
(
"Cart and checkout"
);
((
Button
)
findViewById
(
R
.
id
.
button23
)).
setText
(
"Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//load german button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button20
)).
setText
(
"Cart and checkout"
);
((
Button
)
findViewById
(
R
.
id
.
button23
)).
setText
(
"Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
}
else
{
//load a default set of button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button20
)).
setText
(
"Cart and checkout (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button23
)).
setText
(
"Settings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account (something broke)"
);
}
}
public
void
goback
(
View
view
){
...
...
@@ -28,4 +98,9 @@ public class UserMenu extends AppCompatActivity {
Intent
intent
=
new
Intent
(
this
,
MainShopPage
.
class
);
startActivity
(
intent
);
}
public
void
CogwheelsTurning
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
Settings
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/res/layout/activity_admin_menu.xml
View file @
68f28ee7
...
...
@@ -48,6 +48,7 @@
android:id=
"@+id/button24"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"CogwheelsTurning"
android:text=
"Settings"
/>
<Button
...
...
app/src/main/res/layout/activity_currency_select.xml
0 → 100644
View file @
68f28ee7
<?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=
".CurrencySelect"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:layout_editor_absoluteX=
"175dp"
tools:layout_editor_absoluteY=
"209dp"
>
<TextView
android:id=
"@+id/textView19"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Currency selection"
/>
<Button
android:id=
"@+id/button35"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:text=
"Back"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_language_select.xml
0 → 100644
View file @
68f28ee7
<?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=
".LanguageSelect"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/textView18"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Select language"
/>
<Button
android:id=
"@+id/button31"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:text=
"Back"
/>
<Button
android:id=
"@+id/button32"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"EnglandIsMyCity"
android:text=
"ENG"
/>
<Button
android:id=
"@+id/button33"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"WhiteFlagsAgain"
android:text=
"FRA"
/>
<Button
android:id=
"@+id/button34"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"TortillasAreBeMySecondFavoriteFood"
android:text=
"ESP"
/>
<Button
android:id=
"@+id/button37"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"MoreReliableThanATigerII"
android:text=
"DEU"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main_booking_page.xml
View file @
68f28ee7
...
...
@@ -24,6 +24,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"gobackfromtheshop"
android:text=
"
b
ack"
/>
android:text=
"
B
ack"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_password_settings.xml
0 → 100644
View file @
68f28ee7
<?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=
".PasswordSettings"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:layout_editor_absoluteX=
"247dp"
tools:layout_editor_absoluteY=
"152dp"
>
<TextView
android:id=
"@+id/textView20"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Password reset"
/>
<Button
android:id=
"@+id/button36"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:text=
"Back"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_settings.xml
0 → 100644
View file @
68f28ee7
<?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=
".Settings"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:layout_editor_absoluteX=
"145dp"
tools:layout_editor_absoluteY=
"179dp"
>
<TextView
android:id=
"@+id/textView16"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"TextView"
/>
<Button
android:id=
"@+id/button25"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"gobackfromtheshop"
android:text=
"Button"
/>
<Button
android:id=
"@+id/button27"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"LanguageMrStark"
android:text=
"Button"
/>
<Button
android:id=
"@+id/button28"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"HK$IsntWorthless"
android:text=
"Button"
/>
<Button
android:id=
"@+id/button29"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"WhatWasItAgain"
android:text=
"Button"
/>
<Button
android:id=
"@+id/button30"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Button"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_user_menu.xml
View file @
68f28ee7
...
...
@@ -48,6 +48,7 @@
android:id=
"@+id/button23"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"CogwheelsTurning"
android:text=
"Settings"
/>
<Button
...
...
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