Commit 68f28ee7 authored by chris.crook's avatar chris.crook

> bigboi

parent 1c297cc8
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
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=".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=".MainBookingPage" />
<activity android:name=".AdminRegister" /> <activity android:name=".AdminRegister" />
<activity android:name=".AdminMenu" /> <activity android:name=".AdminMenu" />
......
...@@ -36,6 +36,11 @@ public class AdminMenu extends AppCompatActivity { ...@@ -36,6 +36,11 @@ public class AdminMenu extends AppCompatActivity {
startActivity(intent); startActivity(intent);
} }
public void CogwheelsTurning (View view){
Intent intent = new Intent(this,Settings.class);
startActivity(intent);
}
public void register2electricboogaloo (View view){ public void register2electricboogaloo (View view){
Intent intent = new Intent(this,AdminRegister.class); Intent intent = new Intent(this,AdminRegister.class);
startActivity(intent); startActivity(intent);
......
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
...@@ -169,11 +169,13 @@ public class MainActivity extends AppCompatActivity { ...@@ -169,11 +169,13 @@ public class MainActivity extends AppCompatActivity {
// dont add a '%' to the start // dont add a '%' to the start
tempload += "adminname&adminuser&" + "adminpassword".hashCode() + "&ADMIN&£&ENG"; tempload += "adminname&adminuser&" + "adminpassword".hashCode() + "&ADMIN&£&ENG";
tempload += "%examplename&exampleuser&" + "examplepassword".hashCode() + "&USER&£&ENG"; tempload += "%examplename&exampleuser&" + "examplepassword".hashCode() + "&USER&£&ENG";
tempload += "%frenchperson&france&" + "pass".hashCode() + "&USER&€&FRA";
} }
else{ else{
tempload += "%"; tempload += "%";
tempload += "adminname&adminuser&" + "adminpassword".hashCode() + "&ADMIN&£&ENG"; tempload += "adminname&adminuser&" + "adminpassword".hashCode() + "&ADMIN&£&ENG";
tempload += "%examplename&exampleuser&" + "examplepassword".hashCode() + "&USER&£&ENG"; tempload += "%examplename&exampleuser&" + "examplepassword".hashCode() + "&USER&£&ENG";
tempload += "%frenchperson&france&" + "pass".hashCode() + "&USER&€&FRA";
} }
String [] temploadarray = tempload.split("%"); String [] temploadarray = tempload.split("%");
size = temploadarray.length; size = temploadarray.length;
...@@ -223,9 +225,9 @@ public class MainActivity extends AppCompatActivity { ...@@ -223,9 +225,9 @@ public class MainActivity extends AppCompatActivity {
if (magicwords [i] [4].equals("ADMIN")){ if (magicwords [i] [4].equals("ADMIN")){
// 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] + "&" + 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{ //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);
stream.close(); stream.close();
...@@ -239,7 +241,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -239,7 +241,7 @@ public class MainActivity extends AppCompatActivity {
else if (magicwords [i] [4].equals("SUPER")){ else if (magicwords [i] [4].equals("SUPER")){
// 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] + "&" + 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);
...@@ -254,7 +256,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -254,7 +256,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] + "&" + 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);
......
...@@ -2,8 +2,10 @@ package com.example.summative_chris_crook; ...@@ -2,8 +2,10 @@ package com.example.summative_chris_crook;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
import java.io.File; import java.io.File;
...@@ -24,6 +26,38 @@ public class MainBookingPage extends AppCompatActivity { ...@@ -24,6 +26,38 @@ public class MainBookingPage extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_booking_page); 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(){ public String openandload(){
...@@ -124,12 +158,22 @@ public class MainBookingPage extends AppCompatActivity { ...@@ -124,12 +158,22 @@ public class MainBookingPage extends AppCompatActivity {
temp = temp + reader.nextLine(); temp = temp + reader.nextLine();
} }
} catch (Exception e) { } } catch (Exception e) { }
String [] datatolookat = temp.split("&"); String [] temploadarray = temp.split("&");
if( datatolookat [1].equals("ADMIN")){
// go to admin screen 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{ else{
// go to user menu Intent intent = new Intent(this,UserMenu.class);
startActivity(intent);
return;
} }
} }
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
import java.io.File; import java.io.File;
...@@ -16,6 +17,40 @@ public class MainShopPage extends AppCompatActivity { ...@@ -16,6 +17,40 @@ public class MainShopPage extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_shop_page); 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){ public void goback (View view){
...@@ -31,14 +66,17 @@ public class MainShopPage extends AppCompatActivity { ...@@ -31,14 +66,17 @@ public class MainShopPage extends AppCompatActivity {
} }
if (temp.equals("")){ if (temp.equals("")){
temp = "No user data"; 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); Intent intent = new Intent(this,AdminMenu.class);
startActivity(intent); startActivity(intent);
return; return;
} }
else if (temp.equals("SUPER")){ else if (temploadarray [2].equals("SUPER")){
Intent intent = new Intent(this,AdminMenu.class); Intent intent = new Intent(this,AdminMenu.class);
startActivity(intent); startActivity(intent);
return; return;
......
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
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
...@@ -5,6 +5,11 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -5,6 +5,11 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; 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 { public class UserMenu extends AppCompatActivity {
...@@ -12,6 +17,71 @@ public class UserMenu extends AppCompatActivity { ...@@ -12,6 +17,71 @@ public class UserMenu extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_menu); 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){ public void goback (View view){
...@@ -28,4 +98,9 @@ public class UserMenu extends AppCompatActivity { ...@@ -28,4 +98,9 @@ public class UserMenu extends AppCompatActivity {
Intent intent = new Intent(this,MainShopPage.class); Intent intent = new Intent(this,MainShopPage.class);
startActivity(intent); startActivity(intent);
} }
public void CogwheelsTurning (View view){
Intent intent = new Intent(this,Settings.class);
startActivity(intent);
}
} }
\ No newline at end of file
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
android:id="@+id/button24" android:id="@+id/button24"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="CogwheelsTurning"
android:text="Settings" /> android:text="Settings" />
<Button <Button
......
<?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
<?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
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="gobackfromtheshop" android:onClick="gobackfromtheshop"
android:text="back" /> android:text="Back" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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
<?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
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
android:id="@+id/button23" android:id="@+id/button23"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="CogwheelsTurning"
android:text="Settings" /> android:text="Settings" />
<Button <Button
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment