Commit e1d5b9ec authored by Yassine Marzouki's avatar Yassine Marzouki

Initial commit

parents
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="disableWrapperSourceDistributionNotification" value="true" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
/build
\ No newline at end of file
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.museum_assessment"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
package com.example.museum_assessment;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.museum_assessment", appContext.getPackageName());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.museum_assessment">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Museum_assessment">
<activity android:name=".Receipt"></activity>
<activity android:name=".ss_view" />
<meta-data
android:name="com.google.android.actions"
android:resource="@xml/styles" />
<activity android:name=".museum_view" />
<activity
android:name=".ui.home.HomeFragment"
tools:ignore="Instantiatable" />
<activity
android:name=".ui.cafe.CafeFragment"
tools:ignore="Instantiatable" />
<activity
android:name=".ui.souvenirs.SouvenirsFragment"
tools:ignore="Instantiatable" />
<activity android:name=".registery_page" />
<activity
android:name=".MuseumActivity"
android:label="@string/title_activity_museum"
android:theme="@style/Theme.Museum_assessment.NoActionBar" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.example.museum_assessment;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.ArrayList;
public class Basket extends Fragment {
static int payment_amount;
static int Order_total = 0;
static int change = 0;
String Order_text;
String cafe_text ="";
String souvenirs_text ="";
String museum_text ="";
private TextView order;
private EditText pay;
private Button add;
private Button minus;
private TextView total;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_basket, container, false);
order = root.findViewById(R.id.order);
pay = root.findViewById(R.id.pay);
add = root.findViewById(R.id.add);
minus = root.findViewById(R.id.minus);
total = root.findViewById(R.id.total);
museum_management museum_management = new museum_management();
ArrayList<Mdata> cafe = museum_management.getList();
ArrayList<Mdata> souvenirs = museum_management.getList2();
ArrayList<Mdata> museum = museum_management.getList3();
int index1 = 0;
for (Mdata i : cafe) {
if(index1 == 0){
cafe_text = "Cafe Order:\n";
}
cafe_text = cafe_text +i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
Order_total = Order_total + (i.getPrice() * i.getQuantity());
index1++;
}
int index2 = 0;
for (Mdata i : souvenirs) {
if(index2 == 0){
souvenirs_text = "\nSouvenir Order:\n";
}
souvenirs_text = souvenirs_text + i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
Order_total = Order_total + (i.getPrice() * i.getQuantity());
index2++;
}
int index3 = 0;
for (Mdata i : museum) {
if (index3==0){
museum_text = "\nMuseum Order:\n";
}
museum_text = museum_text + "museum = " + i.getName() + "\ndate = "+ i.getDate() + " tickets x" + String.valueOf(i.getQuantity()) + "\n";
Order_total = Order_total + (i.getPrice() * i.getQuantity());
index3++;
}
Order_text = cafe_text + souvenirs_text + museum_text;
if(Order_text == ""){
order.setText("(Nothing in Basket!)");
total.setText("Total Cost = £0");
}else{
order.setText(cafe_text + souvenirs_text + museum_text);
total.setText("Total Cost = £" + Order_total);
}
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(pay.getText().toString() != "" && Order_total != 0){
String sText = pay.getText().toString();
int sInt= new Integer(sText).intValue();
if(sInt >= Order_total){
payment_amount = sInt;//sets how much is payed
change = (sInt - Order_total);//sets change amount
Intent intent = new Intent(v.getContext(), Receipt.class);
startActivity(intent);
}else{
total.setText("Total Cost = £" + Order_total + "\nPlease Enter a Correct Amount");
}
}
}
});
minus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
cafe.clear();
souvenirs.clear();
museum.clear();
order.setText("(Nothing in Basket!)");
total.setText("Total Cost = £0");
Order_total = 0;
}
});
return root;
}
}
\ No newline at end of file
package com.example.museum_assessment;
public class Data {
private int id;
private String name;
private String small_desc;
private String big_desc;
private String city;
private String country;
private int price;
//Default Constructor
public Data(int i, String s, String s1, String s2, String s3,String s4,String s5, int i1) {
}
//Constructor with parameter
public Data(int id, String name, String small_desc, String big_desc ,String city, String country ,int price) {
this.id = id;
this.name = name;
this.small_desc = small_desc;
this.big_desc = big_desc;
this.city = city;
this.country = country;
this.price = price;
}
//Getters and Setters
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSmall_desc() {
return small_desc;
}
public void setSmall_desc(String small_desc){
this.small_desc = small_desc;
}
public String getBig_desc() {
return big_desc;
}
public void setBig_desc(String big_desc) {
this.big_desc = big_desc;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@Override
public String toString() {
return "Data{" +
"id=" + id +
", name='" + name + '\'' +
", small_desc ='" + small_desc + '\'' +
", city ='" + city + '\'' +
", country ='" + country + '\'' +
", price ='" + price + '\'' +
'}';
}
}
package com.example.museum_assessment;
public class Data_ss {
private int id;
private String name;
private int price;
private int shop_code;
//Default Constructor
public Data_ss(int i, String s, int i2) {
}
//Constructor with parameter
public Data_ss(int id, String name, int price, int shop_code) {
this.id = id;
this.name = name;
this.price = price;
this.shop_code = shop_code;
}
//Getters and Setters
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getShop_code() {
return shop_code;
}
public void setShop_code(int shop_code) {
this.shop_code = shop_code;
}
@Override
public String toString() {
return "Data{" +
"id =" + id +
", name ='" + name + '\'' +
", price ='" + price + '\'' +
", shop_CODE ='" + shop_code + '\'' +
'}';
}
}
package com.example.museum_assessment;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class Db_management extends SQLiteOpenHelper {
static String Name = "";
// structure of db - columns of the table
private static final int DB_VERSION = 1;
private static final String DB_NAME = "Museum.db";
private static final String TABLE_Users = "Users";
private static final String COLUMN_ID = "UsersID";
private static final String COLUMN_FirstName = "FirstName";
private static final String COLUMN_LastName = "LastName";
private static final String COLUMN_UserName = "UserName";
private static final String COLUMN_Password = "Password";
//constructor for creating db
public Db_management(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, DB_NAME, factory, DB_VERSION);
}
//creates table
@Override
public void onCreate(SQLiteDatabase db) {
//query to create the table
String CREATE_table = "CREATE TABLE "+
TABLE_Users + "(" +
COLUMN_ID + " INTEGER PRIMARY KEY," +
COLUMN_FirstName + " TEXT," +
COLUMN_LastName + " TEXT," +
COLUMN_UserName + " TEXT," +
COLUMN_Password + " TEXT" + ")";
//executing the query
db.execSQL(CREATE_table);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
//method for adding new users
public void addNewUser(String firstname, String lastname, String username, String password){
ContentValues values = new ContentValues();//creates object for new row
//add values to table names
values.put(COLUMN_FirstName, firstname);
values.put(COLUMN_LastName, lastname);
values.put(COLUMN_UserName, username);
values.put(COLUMN_Password, password);
//accesses the database (writable)
SQLiteDatabase db = this.getReadableDatabase();
//stores user details in db
db.insert(TABLE_Users, null, values);
//closes the db
db.close();
}
//method to check details on sign in
public boolean checkLogin(String username, String password){
boolean result = false;
String check_query = "SELECT * FROM " + TABLE_Users + " WHERE " + COLUMN_UserName + " = \"" + username + "\"" ;
//accesses the database (writable)
SQLiteDatabase db = this.getWritableDatabase();
//executes query
Cursor cursor = db.rawQuery(check_query, null,null);
while(cursor.moveToNext()) {
if(cursor.getString(cursor.getColumnIndex("Password")).equals(password)){
result = true;
Name = cursor.getString(cursor.getColumnIndex("FirstName")) +" "+ cursor.getString(cursor.getColumnIndex("LastName"));
}
}
//closes database
cursor.close();
db.close();
return result;
}
//method to check username availability
public boolean findUser(String username){
boolean result = false;
String query = "SELECT * FROM " + TABLE_Users + " WHERE " + COLUMN_UserName + " = \"" + username + "\"" ;
//accesses the database (writable)
SQLiteDatabase db = this.getReadableDatabase();
//executes query
Cursor cursor = db.rawQuery(query, null);
if(cursor.getCount()>=1){
System.out.println(cursor.getCount());
result = true;
}
//closes database
cursor.close();
db.close();
return result;
}
}
package com.example.museum_assessment;
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.Toast;
import org.w3c.dom.Text;
public class MainActivity extends AppCompatActivity {
static String Name ="";
private Button register_btn;
private Button login_btn;
private EditText username_login;
private EditText password_login;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
username_login = findViewById(R.id.username);
password_login = findViewById(R.id.password);
register_btn = findViewById(R.id.register_btn);
register_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, registery_page.class);
startActivity(intent);
}
});
login_btn = findViewById(R.id.login_btn);
login_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
login();
}
});
}
public void login(){
Db_management manage = new Db_management(this,null,null,1);
String username = username_login.getText().toString();
String password = password_login.getText().toString();
if(manage.checkLogin(username,password)){
Intent intent = new Intent(MainActivity.this, MuseumActivity.class);
Name = manage.Name;
startActivity(intent);
}else{
Toast.makeText(getApplicationContext(), "Incorrect Username or Password", Toast.LENGTH_LONG).show();
}
}
}
package com.example.museum_assessment;
public class Mdata {
private String name;
private int price;
private int quantity;
private StringBuilder date;
private String time;
public Mdata(String name, int price , int quantity) {
this.name = name;
this.price = price;
this.quantity = quantity;
}
public Mdata(String name, int price , int quantity, StringBuilder date, String time) {
this.name = name;
this.price = price;
this.quantity = quantity;
this.date = date;
this.time = time;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public StringBuilder getDate() {
return date;
}
public void setDate(StringBuilder date) {
this.date = date;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
// @Override
public String toString() {
return "name = " + name + "; price = " + price + "; quantity = " + quantity;
}
}
package com.example.museum_assessment;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.Menu;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.navigation.NavigationView;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
public class MuseumActivity extends AppCompatActivity {
private AppBarConfiguration mAppBarConfiguration;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_museum);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow, R.id.basket)
.setDrawerLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}
\ No newline at end of file
package com.example.museum_assessment;
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 java.util.ArrayList;
import java.util.Random;
public class Receipt extends AppCompatActivity {
private String Order_text;
private String cafe_text="";
private String souvenirs_text="";
private String museum_text="";
private TextView txt;
private TextView order;
private TextView total;
private Button add;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_receipt);
order = findViewById(R.id.order);
txt = findViewById(R.id.txt);
add = findViewById(R.id.add);
total = findViewById(R.id.total);
museum_management museum_management = new museum_management();
ArrayList<Mdata> cafe = museum_management.getList();
ArrayList<Mdata> souvenirs = museum_management.getList2();
ArrayList<Mdata> museum = museum_management.getList3();
int index1 = 0;
for (Mdata i : cafe) {
if(index1 == 0){
cafe_text = "\nCafe Order:\n";
}
cafe_text = cafe_text +i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
index1++;
}
int index2 = 0;
for (Mdata i : souvenirs) {
if(index2 == 0){
souvenirs_text = "\nSouvenir Order:\n";
}
souvenirs_text = souvenirs_text + i.getName() + " quantity x" + String.valueOf(i.getQuantity()) + "\n";
index2++;
}
int index3 = 0;
for (Mdata i : museum) {
if (index3==0){
museum_text = "Museum Order:\n";
}
museum_text = museum_text + "museum = " + i.getName() + "\ndate = "+ i.getDate() +" time = "+ i.getTime() + "\ntickets x" + String.valueOf(i.getQuantity()) + "\n";
index3++;
}
//gets money values from basket
Basket basket = new Basket();
int payment_amount = basket.payment_amount;
int order_total = basket.Order_total;
int change = basket.change;
///gets users full name
MainActivity main = new MainActivity();
String name = main.Name;
Order_text = museum_text + cafe_text + souvenirs_text ;
order.setText("Full name: "+name +"\n"+Order_text+"\n");
total.setText("Total Cost: £" + order_total+"\nAmount Paid: £"+payment_amount+"\nChange Due: £"+change);
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String random = Random();
txt.setText("Your Confirmation code:\n"+random);
add.setVisibility(View.GONE);
}
});
}
public static String Random() {
Random rnd = new Random();
int number = rnd.nextInt(999999);
if(number == 0){
number = rnd.nextInt(999999);
}
return String.format("%06d", number);
}
}
package com.example.museum_assessment;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
public class RecycleViewAdapter extends RecyclerView.Adapter<RecycleViewAdapter.RecyclerViewHolder> {
private List<Data> dataList;
// declare view holder inner class
class RecyclerViewHolder extends RecyclerView.ViewHolder {
TextView ID;
TextView Price;
TextView Name;
TextView City;
TextView Country;
TextView Small_desc;
LinearLayout llItemView;
public RecyclerViewHolder(View itemView) {
super(itemView);
llItemView = itemView.findViewById(R.id.llItemView);
ID = itemView.findViewById(R.id.ID);
Price = itemView.findViewById(R.id.Price);
Name = itemView.findViewById(R.id.Name);
City = itemView.findViewById(R.id.City);
Country = itemView.findViewById(R.id.Country);
Small_desc = itemView.findViewById(R.id.Small_desc);
}
}
//create constructor with list
public RecycleViewAdapter(List<Data> dataList) {
this.dataList = dataList;
}
@NonNull
@Override
public RecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecyclerViewHolder viewHolder;
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item, parent, false);
viewHolder = new RecyclerViewHolder(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerViewHolder holder, int position) {
holder.ID.setText(String.valueOf(dataList.get(position).getId()));
holder.Name.setText(dataList.get(position).getName());
holder.Price.setText("£ " + String.valueOf(dataList.get(position).getPrice()) + " Per Person");
holder.City.setText(dataList.get(position).getCity());
holder.Country.setText(dataList.get(position).getCountry());
holder.Small_desc.setText(dataList.get(position).getSmall_desc());
holder.llItemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(),museum_view.class);
museum_view museum_view;
intent.putExtra("selected_museum", dataList.get(position).getId());
v.getContext().startActivity(intent);
}
});
}
@Override
public long getItemId(int position) {
return super.getItemId(position);
}
@Override
public int getItemCount() {
return dataList.size();
}
}
package com.example.museum_assessment;
import android.content.Intent;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.ui.cafe.CafeFragment;
import com.example.museum_assessment.ui.home.HomeFragment;
import com.example.museum_assessment.ui.souvenirs.SouvenirsFragment;
import org.w3c.dom.Text;
import java.util.List;
public class RecycleViewAdapter_ss extends RecyclerView.Adapter<RecycleViewAdapter_ss.RecyclerViewHolder_ss> {
private List<Data_ss> dataList2;
private int full_total = 0;
// declare view holder inner class
class RecyclerViewHolder_ss extends RecyclerView.ViewHolder {
TextView ID;
TextView Price;
TextView Name;
TextView Total;
ImageView Plus;
ImageView Minus;
LinearLayout llItemView;
public RecyclerViewHolder_ss(View itemView) {
super(itemView);
llItemView = itemView.findViewById(R.id.llItemView2);
ID = itemView.findViewById(R.id.id);
Price = itemView.findViewById(R.id.price);
Name = itemView.findViewById(R.id.name);
}
}
//create constructor with list
public RecycleViewAdapter_ss(List<Data_ss> dataList2) {
this.dataList2 = dataList2;
}
@NonNull
@Override
public RecyclerViewHolder_ss onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecyclerViewHolder_ss viewHolder;
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item_cs, parent, false);
viewHolder = new RecyclerViewHolder_ss(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerViewHolder_ss holder, int position) {
int shopcode = dataList2.get(position).getShop_code();
holder.ID.setText(String.valueOf(dataList2.get(position).getId()));
holder.Name.setText(dataList2.get(position).getName());
holder.Price.setText("£ " + String.valueOf(dataList2.get(position).getPrice()));
holder.llItemView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(),ss_view.class);
museum_view museum_view;
System.out.println("hi" + dataList2.get(position).getId());
intent.putExtra("selected_item", new int[]{dataList2.get(position).getId(), shopcode});
v.getContext().startActivity(intent);
}
});
}
@Override
public long getItemId(int position) {
return super.getItemId(position);
}
@Override
public int getItemCount() {
return dataList2.size();
}
}
package com.example.museum_assessment;
import java.util.ArrayList;
public class museum_management {
static ArrayList<Mdata> cafe = new ArrayList<Mdata>();
static ArrayList<Mdata> museum = new ArrayList<Mdata>();
static ArrayList<Mdata> souvenirs = new ArrayList<Mdata>();
//initialising array of objects
//static Object[][] cafe = new Object[5][3];
//static Object[][] museum = new Object[5][5];
//static Object[][] souvenirs = new Object[5][3];
public void add_to_array(String name, int price, int quantity, String array){
if(array == "cafe"){
cafe.add(new Mdata(name,price,quantity));
}else if(array == "souvenirs"){
souvenirs.add(new Mdata(name, price,quantity));
}
}
public void add_to_museum_basket(String name, int price, int quantity, StringBuilder date, String time){
museum.add(new Mdata(name, price, quantity, date,time));
}
public ArrayList<Mdata> getList() {
return cafe;
}
public ArrayList<Mdata> getList2() {
return souvenirs;
}
public ArrayList<Mdata> getList3() {
return museum;
}
}
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.museum_assessment.ui.cafe.CafeFragment;
import com.example.museum_assessment.ui.home.HomeFragment;
import com.example.museum_assessment.ui.souvenirs.SouvenirsFragment;
import java.util.Calendar;
import java.util.List;
public class museum_view extends AppCompatActivity {
private List<Data> dataList;
private ImageButton back;
private ImageView museum_pic;
private TextView Name;
private TextView City;
private TextView Country;
private TextView Big_desc;
private TextView Price;
private Spinner spinner;
private TextView date;
private Button date_add;
private Button Add;
private EditText tickets;
private TextView cost;
private int Year;
private int Month;
private int Day;
private String time;
static final int DATE_DIALOG_ID = 0;
private int TotalCost;
@Override
protected void onCreate(Bundle savedInstanceState) {
//times in drop down menu
String[] times = new String[]{"9-11 am", "11-1 pm", "1-3 pm", "3-5 pm"};
//gets intent info from home fragment
Intent intent = getIntent();
int selected_museum = intent.getIntExtra("selected_museum",0);
//gets museum list from home fragment
HomeFragment obj = new HomeFragment();
//creates instance of view
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_museum_view);
//sets id's
museum_pic = findViewById(R.id.museum_pic);
spinner = findViewById(R.id.dropdown_menu);
date = findViewById(R.id.date);
date_add = findViewById(R.id.date_add);
Name = findViewById(R.id.Name);
City = findViewById(R.id.City);
Country = findViewById(R.id.Country);
Big_desc= findViewById(R.id.Big_desc);
Price = findViewById(R.id.Price);
back = findViewById(R.id.back);
tickets = findViewById(R.id.tickets);
cost = findViewById(R.id.cost);
Add = findViewById(R.id.add);
//checks to see if value entered into ticket amount and if has then updates cost amount
tickets.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence c, int start, int before, int count) {
try{
String sText = tickets.getText().toString();
int sInt= new Integer(sText).intValue();
sInt = sInt * obj.getList().get(selected_museum -1).getPrice();
cost.setText("Total Cost £ " + sInt);
} catch(NumberFormatException ex){
cost.setText("Total Cost £ 0");
}
}
public void beforeTextChanged(CharSequence c, int start, int count, int after) {
}
public void afterTextChanged(Editable c) {
}
});
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
museum_management museum_management = new museum_management();
String sText = tickets.getText().toString();
int sInt= new Integer(sText).intValue();
String name = obj.getList().get(selected_museum -1).getName();
int price = obj.getList().get(selected_museum -1).getPrice();
StringBuilder date_final = new StringBuilder()
.append(Day).append("-")
.append(Month + 1).append("-")
.append(Year).append(" ");
museum_management.add_to_museum_basket(name,price,sInt,date_final,time);
Toast.makeText(getApplicationContext(), "Added to Basket", Toast.LENGTH_SHORT).show();
}
});
date_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDialog(DATE_DIALOG_ID);
}
});
//checks to see if back button is pressed
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(museum_view.this, MuseumActivity.class);
startActivity(intent);
}
});
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
time = times[arg2];
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
});
//sets spinner value
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, times);
spinner.setAdapter(adapter);
//gets current date
final Calendar c = Calendar.getInstance();
Year = c.get(Calendar.YEAR);
Month = c.get(Calendar.MONTH);
Day = c.get(Calendar.DAY_OF_MONTH);
// display the current date
updateDisplay();
//sets text from list
Name.setText(obj.getList().get(selected_museum -1).getName());
City.setText(obj.getList().get(selected_museum -1).getCity());
Country.setText(obj.getList().get(selected_museum -1).getCountry());
Big_desc.setText(obj.getList().get(selected_museum -1).getBig_desc());
Price.setText("£ " + String.valueOf(obj.getList().get(selected_museum -1).getPrice()) + " Per Person");
tickets.setTransformationMethod(new NumericKeyBoardTransformationMethod());
setPicture(selected_museum);
}
private void updateDisplay(){
this.date.setText("Current Date for Booking: \n"+
new StringBuilder()
.append(Day).append("-")
.append(Month + 1).append("-")
.append(Year).append(" "));
}
private DatePickerDialog.OnDateSetListener mDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
Year = year;
Month = monthOfYear;
Day = dayOfMonth;
updateDisplay();
}
};
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DATE_DIALOG_ID:
return new DatePickerDialog(this,
mDateSetListener,
Year, Month, Day);
}
return null;
}
void setPicture(int selected_museum){
switch (selected_museum){
case 1:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum1);
break;
case 2:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum2);
break;
case 3:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum3);
break;
case 4:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum4);
break;
case 5:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum5);
break;
case 6:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum6);
break;
case 7:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum7);
break;
case 8:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum8);
break;
case 9:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum9);
break;
case 10:
((ImageView)findViewById(R.id.museum_pic)).setImageResource(R.drawable.museum10);
break;
}
}
//number keyboard for number of tickets entry
static class NumericKeyBoardTransformationMethod extends PasswordTransformationMethod {
@Override
public CharSequence getTransformation(CharSequence source, View view) {
return source;
}
}
}
\ No newline at end of file
package com.example.museum_assessment;
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.ImageButton;
import android.widget.Toast;
import com.example.museum_assessment.ui.home.HomeFragment;
public class registery_page extends AppCompatActivity {
private ImageButton back;
private Button register_btn2;
private EditText firstname_register;
private EditText lastname_register;
private EditText username_register;
private EditText password_register;
private EditText password_register2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registery_page);
back = findViewById(R.id.back);
register_btn2 = findViewById(R.id.register_btn2);
firstname_register = findViewById(R.id.firstname_register);
lastname_register = findViewById(R.id.lastname_register);
username_register = findViewById(R.id.username_register);
password_register = findViewById(R.id.password_register);
password_register2 = findViewById(R.id.password_register2);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(registery_page.this, HomeFragment.class);
startActivity(intent);
}
});
register_btn2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addNewUser();
}
});
}
public void addNewUser(){
Boolean dontSaveUser = false;
String firstname = null;
String lastname = null;
String username = null;
String password = null;
String password2 = null;
Db_management manage = new Db_management(this,null,null,1);
//getting the variables and turning them to strings and validating them
firstname = firstname_register.getText().toString();
if(firstname.length() > 10 || firstname.length() < 3){
Toast.makeText(getApplicationContext(), "use a first name between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
lastname = lastname_register.getText().toString();
if(lastname .length() > 10 || lastname .length() < 3){
Toast.makeText(getApplicationContext(), "use a last name between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
username = username_register.getText().toString();
if(username.length() > 10 || username.length() < 3){
Toast.makeText(getApplicationContext(), "use a username between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
password = password_register.getText().toString();
if(password.length() > 10 || password.length() < 3){
Toast.makeText(getApplicationContext(), "use a password between 3 and 10 letters", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}else{
password = password_register.getText().toString();
password2 = password_register2.getText().toString();
if(!password.equals(password2)){
Toast.makeText(getApplicationContext(), "Match your passwords", Toast.LENGTH_SHORT).show();
dontSaveUser = true;
}
}
}
}
}
if(!dontSaveUser){
if(!manage.findUser(username)){
manage.addNewUser(firstname,lastname,username,password);
Toast.makeText(getApplicationContext(), "Successful Sign Up", Toast.LENGTH_LONG).show();
}else{
Toast.makeText(getApplicationContext(), "Sign Up Failed", Toast.LENGTH_SHORT).show();
}
}
}
}
package com.example.museum_assessment;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.NavDirections;
import androidx.navigation.Navigation;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.museum_assessment.ui.cafe.CafeFragment;
import com.example.museum_assessment.ui.home.HomeFragment;
import com.example.museum_assessment.ui.souvenirs.SouvenirsFragment;
public class ss_view extends AppCompatActivity {
private ImageButton back;
private Button Add;
private ImageView ss_pic;
private TextView Name;
private TextView Price;
private EditText quantity;
private TextView cost;
@Override
protected void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();
int[] selected_item = intent.getIntArrayExtra("selected_item");
//gets correct fragment
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ss_view);
//sets id's
ss_pic = findViewById(R.id.ss_pic);
Name = findViewById(R.id.Name);
Price = findViewById(R.id.Price);
back = findViewById(R.id.back);
quantity = findViewById(R.id.quantity);
cost = findViewById(R.id.cost);
Add = findViewById(R.id.add);
quantity.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence c, int start, int before, int count) {
try{
String sText = quantity.getText().toString();
if(selected_item[1] == 1){
SouvenirsFragment obj = new SouvenirsFragment();
int sInt= new Integer(sText).intValue();
sInt = sInt * obj.getList().get(selected_item[0] - 1).getPrice();
cost.setText("Total Cost £ " + sInt);
}else if(selected_item[1] == 2){
CafeFragment obj = new CafeFragment();
int sInt= new Integer(sText).intValue();
sInt = sInt * obj.getList().get(selected_item[0] -1).getPrice();
cost.setText("Total Cost £ " + sInt);
}
}catch(NumberFormatException ex){
cost.setText("Total Cost £ 0");
}
}
public void beforeTextChanged(CharSequence c, int start, int count, int after) {
}
public void afterTextChanged(Editable c) {
}
});
Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
museum_management museum_management = new museum_management();
String sText = quantity.getText().toString();
int sInt= new Integer(sText).intValue();
if(selected_item[1] == 1){
SouvenirsFragment obj = new SouvenirsFragment();
String name = obj.getList().get(selected_item[0] -1).getName();
int price = obj.getList().get(selected_item[0] -1).getPrice();
museum_management.add_to_array(name,price,sInt,"souvenirs");
Toast.makeText(getApplicationContext(), "Added to Basket", Toast.LENGTH_SHORT).show();
}else if(selected_item[1] == 2){
CafeFragment obj = new CafeFragment();
String name = obj.getList().get(selected_item[0] -1).getName();
int price = obj.getList().get(selected_item[0] -1).getPrice();
museum_management.add_to_array(name,price,sInt,"cafe");
Toast.makeText(getApplicationContext(), "Added to Basket", Toast.LENGTH_SHORT).show();
}
}
});
//checks to see if back button is pressed
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
if(selected_item[1] == 1){
SouvenirsFragment obj = new SouvenirsFragment();
Name.setText(obj.getList().get(selected_item[0] -1).getName());
Price.setText("£ " + String.valueOf(obj.getList().get(selected_item[0] -1).getPrice()));
setPicture1(selected_item[0]);
}else if(selected_item[1] == 2){
CafeFragment obj = new CafeFragment();
Name.setText(obj.getList().get(selected_item[0] -1).getName());
Price.setText("£ " + String.valueOf(obj.getList().get(selected_item[0] -1).getPrice()));
setPicture2(selected_item[0]);
}
}
void setPicture1(int selected_item){
switch (selected_item){
case 1:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs1);
break;
case 2:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs2);
break;
case 3:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs3);
break;
case 4:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs4);
break;
case 5:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs5);
break;
case 6:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs6);
break;
case 7:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.souvenirs7);
break;
}
}
void setPicture2(int selected_item){
switch (selected_item){
case 1:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe1);
break;
case 2:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe2);
break;
case 3:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe3);
break;
case 4:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe4);
break;
case 5:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe5);
break;
case 6:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe6);
break;
case 7:
((ImageView)findViewById(R.id.ss_pic)).setImageResource(R.drawable.cafe7);
break;
}
}
}
package com.example.museum_assessment.ui.cafe;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.Data_ss;
import com.example.museum_assessment.R;
import com.example.museum_assessment.RecycleViewAdapter_ss;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
public class CafeFragment extends Fragment {
private static List<Data_ss> dataList2;
//returns list
public List<Data_ss> getList() {
return dataList2;
}
private static void setData_ss() {
dataList2 = new ArrayList<>();
dataList2.add(new Data_ss(1,"Tea",1,2));
dataList2.add(new Data_ss(2,"Water",1,2));
dataList2.add(new Data_ss(3,"Coffee",2,2));
dataList2.add(new Data_ss(4,"Flatbread",2,2));
dataList2.add(new Data_ss(5,"Sandwich",2,2));
dataList2.add(new Data_ss(6,"Sweet roll",2,2));
dataList2.add(new Data_ss(7,"Salad",2,2));
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_cafe, container, false);
final RecyclerView recyclerView = root.findViewById(R.id.recyclerView2);
recyclerView.setLayoutManager(new LinearLayoutManager(CafeFragment.this.getActivity(), LinearLayoutManager.VERTICAL, false));
recyclerView.setFocusable(false);
setData_ss();
RecycleViewAdapter_ss adapter = new RecycleViewAdapter_ss(dataList2);
recyclerView.setAdapter(adapter);
return root;
}
}
\ No newline at end of file
package com.example.museum_assessment.ui.souvenirs;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museum_assessment.Data_ss;
import com.example.museum_assessment.R;
import com.example.museum_assessment.RecycleViewAdapter;
import com.example.museum_assessment.RecycleViewAdapter_ss;
import com.example.museum_assessment.ui.home.HomeFragment;
import java.util.ArrayList;
import java.util.List;
public class SouvenirsFragment extends Fragment {
private static List<Data_ss> dataList2;
//returns list
public List<Data_ss> getList() {
return dataList2;
}
private static void setData_ss() {
dataList2 = new ArrayList<>();
dataList2.add(new Data_ss(1,"Shirt",10,1));
dataList2.add(new Data_ss(2,"Hat",5,1));
dataList2.add(new Data_ss(3,"Snow globe",5,1));
dataList2.add(new Data_ss(4,"Key chain",5,1));
dataList2.add(new Data_ss(5,"Bottle",5,1));
dataList2.add(new Data_ss(6,"Mug",5,1));
dataList2.add(new Data_ss(7,"Coaster",2,1));
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_souvenirs, container, false);
final RecyclerView recyclerView = root.findViewById(R.id.recyclerView2);
recyclerView.setLayoutManager(new LinearLayoutManager(SouvenirsFragment.this.getActivity(), LinearLayoutManager.VERTICAL, false));
recyclerView.setFocusable(false);
setData_ss();
RecycleViewAdapter_ss adapter = new RecycleViewAdapter_ss(dataList2);
recyclerView.setAdapter(adapter);
return root;
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
</vector>
This diff is collapsed.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".MainActivity">
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/background" />
<TextView
android:id="@+id/museum_text"
android:text="The Museum Booking App"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="50dp"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/login_text"
android:text="Login Below"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="25dp"
android:layout_marginTop="50dp"
android:layout_below="@+id/museum_text"
android:gravity="center_horizontal" />
<EditText
android:id="@+id/username"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/login_text"
/>
<EditText
android:id="@+id/password"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Password"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="50dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/username"
/>
<Button
android:id="@+id/login_btn"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Login"
android:layout_below="@+id/password"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/register_btn"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Register"
android:layout_below="@+id/login_btn"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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=".MainActivity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageButton
android:id="@+id/back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_gravity="left"
android:background="@drawable/back2"
android:layout_alignParentTop="true"
/>
<ImageView
android:id="@+id/museum_pic"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
/>
<TextView
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginTop="20dp"
android:textSize="18sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/City"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
<TextView
android:id="@+id/Country"
android:layout_marginHorizontal="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
<TextView
android:id="@+id/Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_marginTop="2dp"
android:gravity="right"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/Big_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<Button
android:id="@+id/date_add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Change Date"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true" />
<TextView
android:text="Pick the time slot for the booking:"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<Spinner
android:id="@+id/dropdown_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@android:drawable/btn_dropdown"
android:spinnerMode="dropdown"/>
<TextView
android:text="Enter the amount of tickets you want below:"
android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<EditText
android:id="@+id/tickets"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/black"
android:layout_centerHorizontal="true"
android:inputType = "numberPassword"
android:maxLength="2"
/>
<TextView
android:id="@+id/cost"
android:text="Total Cost £ 0"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:textSize="16sp"/>
<Button
android:id="@+id/add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Add to Basket"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true" />
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
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=".Receipt">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/order"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:layout_below="@+id/txt"
android:textSize="16sp"/>
<TextView
android:id="@+id/total"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/order"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="16sp"/>
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Confirm Order Details"
android:layout_below="@+id/total"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".registery_page">
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/background"
/>
<ImageButton
android:id="@+id/back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:background="@drawable/back2"
/>
<TextView
android:id="@+id/register_view"
android:text="Register Now"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="50dp"
android:gravity="center_horizontal" />
<EditText
android:id="@+id/firstname_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="First Name"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="50dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/register_view"
/>
<EditText
android:id="@+id/lastname_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Last Name"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/firstname_register"
/>
<EditText
android:id="@+id/username_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/lastname_register"
/>
<EditText
android:id="@+id/password_register"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Password"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/username_register"
/>
<EditText
android:id="@+id/password_register2"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="Confirm Password"
android:textColorHint="@color/white"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_below="@+id/password_register"
/>
<Button
android:id="@+id/register_btn2"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Register"
android:layout_below="@+id/password_register2"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".ss_view">
<ImageView
android:id="@+id/ss_pic"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
/>
<ImageButton
android:id="@+id/back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:background="@drawable/back2"
/>
<TextView
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/black"
android:layout_marginTop="20dp"
android:layout_below="@+id/ss_pic"
android:textSize="18sp"
/>
<TextView
android:id="@+id/Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/black"
android:layout_below="@+id/Name"
android:layout_marginTop="20dp"
android:textSize="18sp"
/>
<TextView
android:id="@+id/text"
android:text="Enter the amount of you want below:"
android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_below="@+id/Price"
android:textColor="@color/black"
android:textSize="16sp"/>
<EditText
android:id="@+id/quantity"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:textColor="@color/black"
android:layout_centerHorizontal="true"
android:layout_below="@+id/text"
android:inputType = "numberPassword"
android:maxLength="2"
/>
<TextView
android:id="@+id/cost"
android:text="Total Cost £ 0"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:layout_below="@+id/quantity"
android:textSize="16sp"/>
<Button
android:id="@+id/add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Add to Basket"
android:layout_marginTop="30dp"
android:layout_below="@+id/cost"
android:layout_centerHorizontal="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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=".MuseumActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Museum_assessment.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Museum_assessment.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ 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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main">
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Basket">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:text="Order Details Below:"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/order"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/black"
android:layout_below="@+id/txt"
android:textSize="16sp"/>
<TextView
android:id="@+id/total"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/order"
android:textColor="@color/black"
android:textSize="16sp"/>
<TextView
android:id="@+id/pay_text"
android:text="Enter the amount you wish to pay with below:"
android:layout_width="match_parent"
android:textStyle="bold"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/total"
android:textColor="@color/black"
android:textSize="16sp"/>
<EditText
android:id="@+id/pay"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="25dp"
android:layout_below="@+id/pay_text"
android:textColor="@color/black"
android:layout_centerHorizontal="true"
android:inputType = "numberDecimal"
android:maxLength="3"
/>
<Button
android:id="@+id/minus"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Empty Basket"
android:layout_below="@+id/pay"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/add"
android:layout_width="150dp"
android:layout_height="60dp"
android:text="Complete Order"
android:layout_below="@+id/minus"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".ui.cafe.CafeFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_light">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".ui.home.HomeFragment">
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".ui.souvenirs.SouvenirsFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_light">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/nav_header_desc"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nav_header_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nav_header_subtitle" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llItemView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/ID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:gravity="center"
android:textColor="@color/black"
android:textSize="18sp"
android:layout_marginLeft="16dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/City"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
<TextView
android:id="@+id/Country"
android:layout_marginHorizontal="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/Small_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textSize="16sp" />
<TextView
android:id="@+id/Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_marginTop="2dp"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llItemView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:textColor="@color/black"
android:layout_marginLeft="10dp"
android:textSize="20sp" />
<TextView
android:id="@+id/name"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="50dp"
android:textSize="25sp" />
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="50dp"
android:textColor="@color/black"
android:textSize="25sp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_home"
android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_home" />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_gallery" />
<item
android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow"
android:title="@string/menu_slideshow" />
<item
android:id="@+id/basket"
android:icon="@drawable/ic_menu_slideshow"
android:title="Basket" />
</group>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
android:visible="false"
app:showAsAction="never" />
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home">
<fragment
android:id="@+id/nav_home"
android:name="com.example.museum_assessment.ui.home.HomeFragment"
android:label="@string/menu_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/nav_gallery"
android:name="com.example.museum_assessment.ui.cafe.CafeFragment"
android:label="@string/menu_gallery"
tools:layout="@layout/fragment_cafe" />
<fragment
android:id="@+id/nav_slideshow"
android:name="com.example.museum_assessment.ui.souvenirs.SouvenirsFragment"
android:label="@string/menu_slideshow"
tools:layout="@layout/fragment_souvenirs" />
<fragment
android:id="@+id/basket"
android:name="com.example.museum_assessment.Basket"
android:label="Basket"
tools:layout="@layout/fragment_basket" />
</navigation>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Museum_assessment" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
\ No newline at end of file
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item>
<item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item>
<item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item>
<item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item>
<item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item>
<item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">The Museum Booking App</string>
<string name="title_activity_museum">MuseumActivity</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="menu_home">Museums</string>
<string name="menu_gallery">Cafe</string>
<string name="menu_slideshow">Souvenirs</string>
<string name="action_settings">action_settings</string>
<string name="menu_settings">menu_settings</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Museum_assessment" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.Museum_assessment.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Museum_assessment.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Museum_assessment.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
\ No newline at end of file
<?xml version ="1.0" encoding ="utf-8"?><!-- Learn More about how to use App Actions: https://developer.android.com/guide/actions/index.html -->
<actions>
<!-- Example Action -->
<!-- <action intentName="Intent name (actions.intent.*)"> -->
<!-- <action-display -->
<!-- icon="@mipmap/..." -->
<!-- labelTemplate="@array/..." /> -->
<!-- <fulfillment urlTemplate="Action content URI or URL"> -->
<!-- <parameter-mapping -->
<!-- intentParameter="Parameter name in Intent URI" -->
<!-- urlParameter="Parameter name in URL" /> -->
<!-- </fulfillment> -->
<!-- </action> -->
</actions>
\ No newline at end of file
<?xml version ="1.0" encoding ="utf-8"?><!-- Learn More about how to use App Actions: https://developer.android.com/guide/actions/index.html -->
<style name="AppTheme" parent="Theme.Museum_assessment.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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