Commit 0b54b19d authored by Sam's avatar Sam

This contains all of the application Data

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
Museum World
\ No newline at end of file
<?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
<component name="ProjectDictionaryState">
<dictionary name="samma">
<words>
<w>garamond</w>
</words>
</dictionary>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT" />
</component>
</project>
\ No newline at end of file
<?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="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
/build
\ No newline at end of file
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.museumworld"
minSdkVersion 28
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 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.android.volley:volley:1.2.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation files('libs\\mysql-connector-java-8.0.23.jar')
testImplementation 'junit:junit:4.13.2'
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.museumworld;
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.museumworld", 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"
package="com.example.museumworld">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/museum_world_logo_round"
android:screenOrientation="portrait"
android:supportsRtl="true"
android:theme="@style/Theme.MuseumWorld">
<activity android:name=".checkout.Receipt"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
></activity>
<activity android:name=".checkout.checkout"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".cafe_shop.shop_activity"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".cafe_shop.cafe_activity"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".booking.booking"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".details.MuseumDetails"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".museumList.Settings"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".museumList.MuseumList"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".login.register"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
/>
<activity android:name=".login.MainActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
>
<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.museumworld.booking;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import java.util.Calendar;
public class DaterPicker extends DialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
//getting the date from the calendar
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
return new DatePickerDialog(getActivity(),
(DatePickerDialog.OnDateSetListener) getActivity()
, year, month, day);
}
}
package com.example.museumworld.booking;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.DatePicker;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.DialogFragment;
import com.example.museumworld.R;
import com.example.museumworld.cafe_shop.cafe_activity;
import com.example.museumworld.details.MuseumDetails;
import com.google.android.material.snackbar.Snackbar;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class booking extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener, DatePickerDialog.OnDateSetListener {
public static String dateSelected, timeSelected;
private ImageView top_img;
private Spinner spinner;
private TextView date_Text, next_btn;
private ImageButton back, calendar_icon;
private String topImgURL;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_booking);
back = findViewById(R.id.back_arrow_icon);
back.setOnClickListener(this);
next_btn = findViewById(R.id.next_btn);
next_btn.setOnClickListener(this);
//setting the top image
MuseumDetails md = new MuseumDetails();
top_img = findViewById(R.id.top_img);
topImgURL = getIntent().getStringExtra("topURL");
md.setImagesByURL(getApplicationContext(), top_img, getIntent().getStringExtra("topURL"));
//DATE AND CALENDAR
calendar_icon = findViewById(R.id.calendar_icon);
calendar_icon.setOnClickListener(this);
date_Text = findViewById(R.id.date_Text);
//SPINNER
String[] times = {"9-11am", "11-1pm", "1-3pm", "3-5pm"};
spinner = findViewById(R.id.timeSpinner);
spinner.setOnItemSelectedListener(this);
//creating arrayAdapter for the spinner
ArrayAdapter arrayAdapter = new ArrayAdapter(this, R.layout.spinner, times);
arrayAdapter.setDropDownViewResource(R.layout.spinner);
spinner.setAdapter(arrayAdapter);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.back_arrow_icon:
finish();
break;
case R.id.calendar_icon:
DialogFragment datePick = new DaterPicker();
datePick.show(getSupportFragmentManager(), "Select Date");
break;
case R.id.next_btn:
//if date is not set remind user
if (date_Text.getHint().toString().equals(getString(R.string.date_goes_here))) {
snackbarAlert("Please Select a date", true);
Log.d("TEStB", "TEST");
} else {
//select the spinner item
switch (spinner.getSelectedItem().toString()) {
case "9-11am":
timeSelected = "09:00";
break;
case "11-1pm":
timeSelected = "11:00";
break;
case "1-3pm":
timeSelected = "13:00";
break;
case "3-5pm":
timeSelected = "15:00";
break;
}
//start the cafe activity
Intent cafe = new Intent(this, cafe_activity.class);
//put the URL image in the cafe activity
cafe.putExtra("topURL", topImgURL);
startActivity(cafe);
}
break;
}
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
@Override
//setting the date in the text view
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
//getting the date from the calendar amd seeing if it is valid if it is set the text
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month);
c.set(Calendar.DAY_OF_MONTH, dayOfMonth);
String dateSelected = dayOfMonth + "/" + (month + 1) + "/" + year;
try {
String currentDateD = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
Date currentDate = new SimpleDateFormat("dd/MM/yyyy").parse(currentDateD);
Date selectedDateD = new SimpleDateFormat("dd/MM/yyyy").parse(dateSelected);
if (dateChecker(currentDate, selectedDateD)) {
date_Text.setHint(dateSelected);
this.dateSelected = year + "-" + (month + 1) + "-" + dayOfMonth;
Log.d("dateselect", this.dateSelected);
} else {
snackbarAlert("Select a date that is present or in the future", true);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
private boolean dateChecker(Date currentDate, Date dateSelected) {
if (dateSelected.after(currentDate) || dateSelected.equals(currentDate)) {
return true;
} else {
return false;
}
}
public void snackbarAlert(String message, boolean error) {
//snackbar function this will also set the snackbar to the top
CoordinatorLayout coordinatorLayout = (CoordinatorLayout) findViewById(R.id.cl);
Snackbar alert = Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_LONG);
View v = alert.getView();
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) v.getLayoutParams();
params.gravity = Gravity.TOP;
v.setLayoutParams(params);
TextView sbTv = alert.getView().findViewById(com.google.android.material.R.id.snackbar_text);
sbTv.setTypeface(ResourcesCompat.getFont(getApplicationContext(), R.font.roboto_bold));
sbTv.setTextSize(22);
alert.setTextColor(getResources().getColor(R.color.black));
if (error) {
alert.setBackgroundTint(getResources().getColor(R.color.light_red));
} else {
alert.setBackgroundTint(getResources().getColor(R.color.light_green));
}
alert.show();
}
}
\ No newline at end of file
package com.example.museumworld.cafe_shop;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.Request;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.museumworld.R;
import com.example.museumworld.details.MuseumDetails;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
public class cafe_activity extends AppCompatActivity implements View.OnClickListener {
private final ArrayList<items> cafeItemList = new ArrayList<>();
private ArrayList<String> itemQuantityCafe, itemNameCafe, itemPriceCafe;
//setting the URL for the php file in my server
private String URL = "https://ysjcs.net/~sam.markey/UNI/museum_php/fetch_data.php?table=item_museum&language=";
private RecyclerView recyclerView;
private item_adapter adapter;
private RecyclerView.LayoutManager layoutManager;
private TextView next_btn;
private ImageButton back_arrow_icon;
private ImageView top_img;
private String topImgURL;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cafe_activity);
//Deciding what language the user has set
String localLanguageChecker = String.valueOf(getResources().getConfiguration().getLocales().get(0));
String langaugeDefault = "en";
if (localLanguageChecker.contains("en")) {
langaugeDefault = "en";
//seeing what language is set as it will have to get the specific language from the database
} else if (localLanguageChecker.contains("fr")) {
langaugeDefault = "fr";
} else {
langaugeDefault = "en";
}
//adding the language to the end
URL += langaugeDefault;
//fetching the items from the database
fetchCafeItems();
next_btn = findViewById(R.id.next_btn);
back_arrow_icon = findViewById(R.id.back_arrow_icon);
next_btn.setOnClickListener(this);
back_arrow_icon.setOnClickListener(this);
//setting the top image
MuseumDetails md = new MuseumDetails();
top_img = findViewById(R.id.top_img);
topImgURL = getIntent().getStringExtra("topURL");
md.setImagesByURL(getApplicationContext(), top_img, getIntent().getStringExtra("topURL"));
}
private void RecyclerViewInit() {
recyclerView = findViewById(R.id.cafe_RecyclerView);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(this);
adapter = new item_adapter(cafeItemList);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
//click listener for the buttons in the cafe and shop activites if pressed the counter will change
adapter.setOnItemClickListener((position, b) -> {
int quantCounter = Integer.valueOf(cafeItemList.get(position).getQuantity());
if (b) {
quantCounter += 1;
} else {
if (!cafeItemList.get(position).getQuantity().equals("0")) {
quantCounter -= 1;
}
}
cafeItemList.get(position).setQuantity(String.valueOf(quantCounter));
adapter.notifyItemChanged(position);
});
}
//gets the cafe items
private void fetchCafeItems() {
cafeItemList.clear();
StringRequest stringRequest = new StringRequest(Request.Method.GET, URL, response -> {
try {
JSONArray array = new JSONArray(response);
for (int i = 0; i < array.length(); i++) {
JSONObject cafeItems = array.getJSONObject(i);
//gets the cafe items and sets them to the items class which then sends them to the adapter class to be put in the recycler view
if (cafeItems.getString("item_category").equals("C")) {
cafeItemList.add(new items(cafeItems.getString("item_price"), cafeItems.getString("item_name").replaceAll("\\?", "é"), cafeItems.getString("quantity")));
}
}
RecyclerViewInit();
//initialising the recycler view with the data
RecyclerViewInit();
} catch (JSONException e) {
Log.d("fetchcafeERROR", e.toString());
}
}, error -> {
});
Volley.newRequestQueue(this).add(stringRequest);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
//back arrow goes back to the previous activity
case R.id.back_arrow_icon:
finish();
break;
case R.id.next_btn:
Intent shop = new Intent(this, shop_activity.class);
//TODO PUT EXTRA
//if the itemData array is not null add the cafe items to the shop activity which will be passed down to the checkout and receipt
if (getItemData() != null) {
shop.putExtra("cafeItems", getItemData().get(0));
shop.putExtra("topURL", topImgURL);
shop.putExtra("cafeQuantity", getItemData().get(1));
shop.putExtra("cafePrice", getItemData().get(2));
}
startActivity(shop);
break;
}
}
//gets the data from the database
public ArrayList<ArrayList> getItemData() {
itemQuantityCafe = new ArrayList<>();
itemNameCafe = new ArrayList<>();
itemPriceCafe = new ArrayList<>();
ArrayList<ArrayList> cafeItems = new ArrayList<>();
for (int i = 0; i < cafeItemList.size(); i++) {
String cafeQuantity = cafeItemList.get(i).getQuantity();
String cafeName = cafeItemList.get(i).getItem();
String cafePrice = cafeItemList.get(i).getPrice();
if (!cafeQuantity.equals("0")) {
itemQuantityCafe.add(cafeQuantity);
itemNameCafe.add(cafeName);
itemPriceCafe.add(cafePrice);
//TODO PUT EXTRA IS FUNCTION DOES NOT WORK
}
}
if (itemNameCafe.size() > 0) {
cafeItems.add(itemNameCafe);
cafeItems.add(itemQuantityCafe);
cafeItems.add(itemPriceCafe);
return cafeItems;
}
return null;
}
}
\ No newline at end of file
package com.example.museumworld.cafe_shop;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museumworld.R;
import java.util.ArrayList;
public class item_adapter extends RecyclerView.Adapter<item_adapter.ViewHolder_item> {
private ArrayList<items> itemList;
private OnItemClickListener itemListener;
public item_adapter(ArrayList<items> itemList) {
this.itemList = itemList;
}
public void setOnItemClickListener(OnItemClickListener listener) {
itemListener = listener;
}
@NonNull
@Override
public ViewHolder_item onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_cafe_viewholder, parent, false);
ViewHolder_item cvh = new ViewHolder_item(v, itemListener);
return cvh;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder_item holder, int position) {
items currentItem = itemList.get(position);
holder.itemText.setText(currentItem.getItem());
holder.priceText.setText("£"+currentItem.getPrice()+".00");
holder.quantity_counter.setText(currentItem.getQuantity());
}
@Override
public int getItemCount() {
return itemList.size();
}
public interface OnItemClickListener {
void onItemClick(int position, boolean b);
}
public static class ViewHolder_item extends RecyclerView.ViewHolder {
TextView itemText, priceText, quantity_counter;
ImageButton plus_btn, minus_btn;
public ViewHolder_item(@NonNull View itemView, OnItemClickListener listener) {
super(itemView);
itemText = itemView.findViewById(R.id.item_textView);
priceText = itemView.findViewById(R.id.price_textView);
quantity_counter = itemView.findViewById(R.id.quantity_counter);
plus_btn = itemView.findViewById(R.id.plus_btn);
minus_btn = itemView.findViewById(R.id.minus_btn);
plus_btn.setOnClickListener(view -> {
if(listener != null){
int position = getAdapterPosition();
if(position != RecyclerView.NO_POSITION){
listener.onItemClick(position, true);
}
}
});
//event listener for the minus nad plus buttons in each views
minus_btn.setOnClickListener(view -> {
if(listener != null){
int position = getAdapterPosition();
if(position != RecyclerView.NO_POSITION){
listener.onItemClick(position,false);
}
}
});
}
}
}
package com.example.museumworld.cafe_shop;
//item class for the shop and cafe activity
public class items {
private String price;
private String item;
private String quantity;
public items(String price, String item, String quantity) {
this.price = price;
this.item = item;
this.quantity = quantity;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
}
package com.example.museumworld.cafe_shop;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.Request;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.museumworld.R;
import com.example.museumworld.details.MuseumDetails;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
//same as the cafe activity except for shop items
public class shop_activity extends AppCompatActivity implements View.OnClickListener {
private ArrayList<items> shopItemList = new ArrayList<>();
private ArrayList<String> itemQuantityShop, itemNameShop,itemPriceShop;
private String URL = "https://ysjcs.net/~sam.markey/UNI/museum_php/fetch_data.php?table=item_museum&language=";
private RecyclerView recyclerView;
private item_adapter adapter;
private RecyclerView.LayoutManager layoutManager;
private TextView next_btn;
private ImageButton back_arrow_icon;
private ImageView top_img;
private String topImgURL;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shop_activity);
//Deciding what language the user has set
String localLanguageChecker = String.valueOf(getResources().getConfiguration().getLocales().get(0));
String langaugeDefault = "en";
if(localLanguageChecker.contains("en")) {
langaugeDefault = "en";
}
else if(localLanguageChecker.contains("fr")) {
langaugeDefault = "fr";
} else{
langaugeDefault = "en";
}
URL += langaugeDefault;
MuseumDetails md = new MuseumDetails();
top_img = findViewById(R.id.top_img);
topImgURL= getIntent().getStringExtra("topURL");
md.setImagesByURL(getApplicationContext(), top_img, getIntent().getStringExtra("topURL"));
next_btn = findViewById(R.id.next_btn);
back_arrow_icon = findViewById(R.id.back_arrow_icon);
next_btn.setOnClickListener(this);
back_arrow_icon.setOnClickListener(this);
fetchShopItems();
}
private void RecyclerViewInit() {
recyclerView = findViewById(R.id.shop_Recyclerview);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(this);
adapter = new item_adapter(shopItemList);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
adapter.setOnItemClickListener((position, b) -> {
int quantCounter = Integer.valueOf(shopItemList.get(position).getQuantity());
if (b) {
quantCounter += 1;
} else {
if (!shopItemList.get(position).getQuantity().equals("0")) {
quantCounter -= 1;
}
}
shopItemList.get(position).setQuantity(String.valueOf(quantCounter));
adapter.notifyItemChanged(position);
});
}
private void fetchShopItems() {
shopItemList.clear();
StringRequest stringRequest = new StringRequest(Request.Method.GET, URL, response -> {
try {
JSONArray array = new JSONArray(response);
for (int i = 0; i < array.length(); i++) {
JSONObject cafeItems = array.getJSONObject(i);
if (cafeItems.getString("item_category").equals("S")) {
shopItemList.add(new items(cafeItems.getString("item_price"), cafeItems.getString("item_name").replaceAll("\\?","é"), cafeItems.getString("quantity")));
}
}
RecyclerViewInit();
//initialising the recycler view with the data
RecyclerViewInit();
} catch (JSONException e) {
Log.d("fetchcafeERROR", e.toString());
}
}, error -> {
});
Volley.newRequestQueue(this).add(stringRequest);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.back_arrow_icon:
finish();
break;
case R.id.next_btn:
Intent checkout = new Intent(this, com.example.museumworld.checkout.checkout.class);
ArrayList<String> cI = getIntent().getStringArrayListExtra("cafeItems");
ArrayList<String> cQ = getIntent().getStringArrayListExtra("cafeQuantity");
ArrayList<String> cP = getIntent().getStringArrayListExtra("cafePrice");
if(cI != null){
checkout.putExtra("cafeItems",cI) ;
checkout.putExtra("cafeQuantity",cQ) ;
checkout.putExtra("cafePrice",cP) ;
}
if(getItemData() != null){
checkout.putExtra("shopItems",getItemData().get(0)) ;
checkout.putExtra("shopQuantity",getItemData().get(1)) ;
checkout.putExtra("shopPrice",getItemData().get(2)) ;
}
checkout.putExtra("topURL",topImgURL);
startActivity(checkout);
break;
}
}
public ArrayList<ArrayList> getItemData() {
ArrayList<ArrayList> shopItems = new ArrayList<>();
itemQuantityShop = new ArrayList<>();
itemNameShop = new ArrayList<>();
itemPriceShop = new ArrayList<>();
for (int i = 0; i < shopItemList.size(); i++) {
String shopQuantity = shopItemList.get(i).getQuantity();
String shopItem = shopItemList.get(i).getItem();
String shopPriceName = shopItemList.get(i).getPrice();
if (!shopQuantity.equals("0")) {
itemQuantityShop.add(shopQuantity);
itemNameShop.add(shopItem);
itemPriceShop.add(shopPriceName);
}
}
if(itemNameShop.size() > 0) {
shopItems.add(itemNameShop);
shopItems.add(itemQuantityShop);
shopItems.add(itemPriceShop);
return shopItems;
}
return null;
}
}
\ No newline at end of file
package com.example.museumworld.details;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.example.museumworld.R;
import java.util.ArrayList;
public class MuseumDetails extends AppCompatActivity implements View.OnClickListener {
public static String MuseumName, MuseumPrice;
public static int MuseumID;
public static double MuseumPriceD;
ArrayList<String> museumData = new ArrayList<>();
private TextView title, desc, costD, bookBtn;
private ImageView top, imgD;
private RelativeLayout background;
private ImageButton backIcon;
private String topImg;
private RelativeLayout splashScreen;
//this sets the museum details and will set a splash screen till the images have loaded
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_museum_details);
splashScreen = findViewById(R.id.splashScreen);
//here I am getting the museum details I needed from the MuseumList activity so I do not need to fetch data from the MYSql database again and getting the username.
title = findViewById(R.id.titleD);
desc = findViewById(R.id.descD);
costD = findViewById(R.id.costD);
top = findViewById(R.id.top_img);
background = findViewById(R.id.backgroundImgD);
imgD = findViewById(R.id.imgD);
desc.setMovementMethod(new ScrollingMovementMethod());
museumData = getIntent().getExtras().getStringArrayList("museumDetails");
String Title = museumData.get(0);
MuseumName = museumData.get(0);
String Desc = museumData.get(1);
Log.d("desc", Desc);
Desc = Desc.replaceAll("\\\\n", " \n");
topImg = museumData.get(2);
String backgroundImg = museumData.get(3);
String img = museumData.get(4);
String cost = museumData.get(5);
MuseumPrice = museumData.get(5);
setImagesByURL(getApplicationContext(), imgD, img);
setImagesByURL(getApplicationContext(), top, topImg);
MuseumID = Integer.valueOf(museumData.get(6));
MuseumPriceD = Double.valueOf(museumData.get(5).replaceAll("£", ""));
Log.d("MuseumID", String.valueOf(MuseumID));
title.setText(Title);
desc.setText(Desc);
costD.setText("Price: " + cost);
backIcon = findViewById(R.id.back_arrow_icon);
bookBtn = findViewById(R.id.book_btn);
bookBtn.setOnClickListener(MuseumDetails.this);
backIcon.setOnClickListener(MuseumDetails.this);
setLayoutImgByURL(background, backgroundImg);
}
public void setImagesByURL(Context context, ImageView imgV, String url) {
Glide.with(context).load(url).centerCrop().placeholder(R.mipmap.top_shape_image).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
imgV.setBackground(resource);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
super.onLoadFailed(errorDrawable);
Log.d("failedToLoad", String.valueOf(errorDrawable));
}
});
}
public void setLayoutImgByURL(RelativeLayout relBackground, String url) {
Glide.with(getApplicationContext()).load(url).centerCrop().placeholder(R.mipmap.top_shape_image).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
relBackground.setBackground(resource);
splashScreen.setVisibility(View.GONE);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
super.onLoadFailed(errorDrawable);
Log.d("failedToLoad", String.valueOf(errorDrawable));
splashScreen.setVisibility(View.GONE);
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.back_arrow_icon:
finish();
break;
case R.id.book_btn:
Intent booking = new Intent(this, com.example.museumworld.booking.booking.class);
booking.putExtra("topURL", topImg);
startActivity(booking);
break;
}
}
}
\ No newline at end of file
package com.example.museumworld.login;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.res.ResourcesCompat;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.museumworld.R;
import com.example.museumworld.museumList.MuseumList;
import com.google.android.material.snackbar.Snackbar;
import java.util.HashMap;
import java.util.Map;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
public static String usernameG, FirstnameG, LastnameG;
private TextView signup_btn;
private TextView loginbtn, ErrorMessageUsername, ErrorMessagePassword;
private EditText username_EditText, password_EditText;
private String message;
private String URL = "https://ysjcs.net/~sam.markey/UNI/museum_php/login.php";
//TODO URL , EDIT TEXT GET TEXT AND PASS THEM TO LOGIN FUNC
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
register reg = new register();
signup_btn = findViewById(R.id.signup_btn2);
loginbtn = findViewById(R.id.login_btn);
username_EditText = findViewById(R.id.username_EditText);
password_EditText = findViewById(R.id.password_EditText);
//error init
ErrorMessagePassword = findViewById(R.id.ErrorMessagePassword);
ErrorMessageUsername = findViewById(R.id.ErrorMessageUsername);
reg.ResetParams(ErrorMessagePassword);
reg.ResetParams(ErrorMessageUsername);
signup_btn.setOnClickListener(this);
loginbtn.setOnClickListener(this);
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.signup_btn2:
Intent intent = new Intent(this, register.class);
startActivity(intent);
break;
case R.id.login_btn:
checkDetails(username_EditText.getText().toString(), password_EditText.getText().toString());
break;
}
}
private void checkDetails(String username, String password) {
register reg = new register();
if (username.length() < 5) {
message = getString(R.string.login_usernameError);
reg.setParams(ErrorMessageUsername);
ErrorMessageUsername.setText(message);
} else {
reg.ResetParams(ErrorMessageUsername);
}
if (password.length() < 5) {
message = getString(R.string.login_passwordError);
reg.setParams(ErrorMessagePassword);
ErrorMessagePassword.setText(message);
} else {
reg.ResetParams(ErrorMessagePassword);
login(username, password);
}
}
//finish all history activites and close the app
@Override
public void onBackPressed() {
finishAffinity();
finish();
}
//chjecks if the username and password exist and match it does this by sending the data to a PHP script
private void login(String username, String password) {
StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, response -> {
if (response.contains("success")) {
Intent intent = new Intent(this, MuseumList.class);
String fullName = response.replaceAll("success,", "");
String[] arrayname = fullName.split(",");
usernameG = username;
FirstnameG = arrayname[0];
LastnameG = arrayname[1];
startActivity(intent);
finish();
} else if (response.equals("password_nomatch") || response.equals("username_nomatch")) {
snackbarAlert2("The username or password is incorrect", true);
} else {
snackbarAlert2("Something Went Wrong Please Check your Internet Connection", true);
}
}, error -> snackbarAlert2("Something Went Wrong Please Check your Internet Connection", true)) {
@Override
protected Map<String, String> getParams() {
Map<String, String> data = new HashMap<>();
data.put("username", username);
data.put("password", password);
return data;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
requestQueue.add(stringRequest);
}
public void snackbarAlert2(String message, boolean error) {
CoordinatorLayout coordinatorLayout = (CoordinatorLayout) findViewById(R.id.cl);
Snackbar alert = Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_LONG);
View v = alert.getView();
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) v.getLayoutParams();
params.gravity = Gravity.TOP;
v.setLayoutParams(params);
TextView sbTv = alert.getView().findViewById(com.google.android.material.R.id.snackbar_text);
sbTv.setTypeface(ResourcesCompat.getFont(getApplicationContext(), R.font.roboto_bold));
sbTv.setTextSize(22);
alert.setTextColor(getResources().getColor(R.color.black));
if (error) {
alert.setBackgroundTint(getResources().getColor(R.color.light_red));
} else {
alert.setBackgroundTint(getResources().getColor(R.color.light_green));
}
alert.show();
}
}
\ No newline at end of file
package com.example.museumworld.login;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.res.ResourcesCompat;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.museumworld.R;
import com.google.android.material.snackbar.Snackbar;
import java.util.HashMap;
import java.util.Map;
public class register extends AppCompatActivity implements View.OnClickListener {
private ImageView back_arrow;
private EditText Firstname_EditText, Lastname_EditText, username_EditText, password_EditText, password_EditText2;
private TextView signup_btn, ErrorMessageFirstname, ErrorMessageLastname, ErrorMessageuserName, ErrorMessagepassword, ErrorMessagepassword2;
private String URL = "https://ysjcs.net/~sam.markey/UNI/museum_php/create_account.php";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
back_arrow = findViewById(R.id.back_arrow_icon);
signup_btn = findViewById(R.id.signup_btn2);
back_arrow.setOnClickListener(this);
signup_btn.setOnClickListener(this);
Firstname_EditText = findViewById(R.id.Firstname_EditText);
Lastname_EditText = findViewById(R.id.Lastname_EditText);
username_EditText = findViewById(R.id.username_EditText);
password_EditText = findViewById(R.id.password_EditText);
password_EditText2 = findViewById(R.id.password_EditText2);
//Setting the error messages IDs
ErrorMessageFirstname = findViewById(R.id.ErrorMessageFirstname);
ErrorMessageLastname = findViewById(R.id.ErrorMessageLastname);
ErrorMessageuserName = findViewById(R.id.ErrorMessageuserName);
ErrorMessagepassword = findViewById(R.id.ErrorMessagepassword);
ErrorMessagepassword2 = findViewById(R.id.ErrorMessagepassword2);
//Make them invisible
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.back_arrow_icon:
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
break;
case R.id.signup_btn2:
detailChecker();
break;
}
}
public void setParams(View textView) {
ViewGroup.LayoutParams params = textView.getLayoutParams();
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
textView.setLayoutParams(params);
}
public void ResetParams(View textView) {
ViewGroup.LayoutParams reset = textView.getLayoutParams();
reset.height = 0;
textView.setLayoutParams(reset);
}
private Boolean detailChecker() {
String message;
String firstname = Firstname_EditText.getText().toString();
String lastname = Lastname_EditText.getText().toString();
String username = username_EditText.getText().toString();
String password = password_EditText.getText().toString();
String password2 = password_EditText2.getText().toString();
//error checking
if (firstname.length() < 2) {
message = getString(R.string.reister_firstname);
setParams(ErrorMessageFirstname);
ErrorMessageFirstname.setText(message);
}
if (lastname.length() < 3) {
message = getString(R.string.reister_lastname);
setParams(ErrorMessageLastname);
ErrorMessageLastname.setText(message);
}
if (username.length() < 5) {
message = getString(R.string.reister_username);
setParams(ErrorMessageuserName);
ErrorMessageuserName.setText(message);
}
if (password.length() < 7) {
message = getString(R.string.reister_password);
setParams(ErrorMessagepassword);
ErrorMessagepassword.setText(message);
}
if (!password.equals(password2) || password2.length() < 7) {
message = getString(R.string.reister_password2);
setParams(ErrorMessagepassword2);
ErrorMessagepassword2.setText(message);
} else {
ResetParams(ErrorMessageFirstname);
ResetParams(ErrorMessageLastname);
ResetParams(ErrorMessageuserName);
ResetParams(ErrorMessagepassword);
ResetParams(ErrorMessagepassword2);
addAccount(firstname, lastname, username, password);
return false;
}
return true;
}
//adds the account to the MYSQl database which is encrypted incase of a breach. It registers a user by sending the data to a PHP script which sends it to the database
private void addAccount(String Firstname, String Lastname, String username, String password) {
StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, (Response.Listener<String>) response -> {
if (response.equals("success")) {
snackbarAlert("You have successfully registered the account!", false);
} else if (response.equals("failure")) {
snackbarAlert("Something Went Wrong!", true);
} else if (response.equals("username_taken")) {
snackbarAlert("Username is already taken!", true);
}
Log.d("response", response);
}, error -> Log.d("error1", error.toString())) {
@Override
protected Map<String, String> getParams() {
Map<String, String> data = new HashMap<>();
data.put("username", username);
data.put("firstname", Firstname);
data.put("lastname", Lastname);
data.put("password", password);
return data;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
requestQueue.add(stringRequest);
}
public void snackbarAlert(String message, boolean error) {
CoordinatorLayout coordinatorLayout = (CoordinatorLayout) findViewById(R.id.cl);
Snackbar alert = Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_LONG);
View v = alert.getView();
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) v.getLayoutParams();
params.gravity = Gravity.TOP;
v.setLayoutParams(params);
TextView sbTv = alert.getView().findViewById(com.google.android.material.R.id.snackbar_text);
sbTv.setTypeface(ResourcesCompat.getFont(getApplicationContext(), R.font.roboto_bold));
sbTv.setTextSize(20);
alert.setTextColor(getResources().getColor(R.color.black));
if (error) {
alert.setBackgroundTint(getResources().getColor(R.color.light_red));
} else {
alert.setBackgroundTint(getResources().getColor(R.color.light_green));
}
alert.show();
}
}
package com.example.museumworld.museumList;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.Request;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.museumworld.R;
import com.example.museumworld.details.MuseumDetails;
import com.example.museumworld.login.MainActivity;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
public class MuseumList extends AppCompatActivity implements View.OnClickListener, MuseumList_Adapter.OnListener {
public static ArrayList<museum_cardview> museumList = new ArrayList<>();
String username;
String localLanguage;
private String URL = "https://ysjcs.net/~sam.markey/UNI/museum_php/fetch_data.php?table=museum&language=";
private RecyclerView recyclerView;
private RecyclerView.Adapter adapter;
private RecyclerView.LayoutManager layoutManager;
private ImageButton signout;
private ImageButton settings;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_museum_list);
//Deciding what language the user has set
String localLanguageChecker = String.valueOf(getResources().getConfiguration().getLocales().get(0));
String langaugeDefault = "en";
if (localLanguageChecker.contains("en")) {
langaugeDefault = "en";
} else if (localLanguageChecker.contains("fr")) {
langaugeDefault = "fr";
} else {
langaugeDefault = "en";
}
URL += langaugeDefault;
username = MainActivity.usernameG;
signout = findViewById(R.id.sign_out_btn);
settings = findViewById(R.id.settings_btn);
signout.setOnClickListener(this);
settings.setOnClickListener(this);
Log.d("URLlanguage", URL);
//getting the database info for the museums then init the recycler view
fetchMuseumData();
}
//setting up the recycler view
private void RecyclerViewInit() {
recyclerView = findViewById(R.id.museum_list_rec);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(this);
adapter = new MuseumList_Adapter(museumList, this);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
}
//getting the museum data
private void fetchMuseumData() {
StringRequest stringRequest = new StringRequest(Request.Method.GET, URL, response -> {
try {
museumList.clear();
Log.d("museumResponse", response);
JSONArray array = new JSONArray(response);
Log.d("museumResponse", response);
for (int i = 0; i < array.length(); i++) {
JSONObject museum = array.getJSONObject(i);
museumList.add(new museum_cardview(
museum.getString("museum_name").replaceAll("\\?", "é"),
museum.getString("museum_location").replaceAll("\\?", "é"),
"£" + museum.getString("museum_price").replaceAll("\\?", "é"),
museum.getString("museum_desc1").replaceAll("\\?", "é"),
museum.getString("museum_top_background"),
museum.getString("museum_img"),
museum.getString("museum_background"),
museum.getString("museum_desc2").replaceAll("\\?", "é"),
museum.getInt("museumID")
));
}
//initialising the recycler view with the data
RecyclerViewInit();
} catch (JSONException e) {
Log.d("fetchmuseumERROR", e.toString());
}
}, error -> {
});
Volley.newRequestQueue(this).add(stringRequest);
}
@Override
public void onBackPressed() {
OpenDialogBox(getResources().getString(R.string.sign_out_title), getResources().getString(R.string.sign_out_text));
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.sign_out_btn:
OpenDialogBox(getResources().getString(R.string.sign_out_title), getResources().getString(R.string.sign_out_text));
break;
case R.id.settings_btn:
Intent settings = new Intent(this, Settings.class);
finish();
startActivity(settings);
}
}
//it will load the museum the user has clicked on
@Override
public void OnClick(int position) {
Intent museumDetails = new Intent(this, MuseumDetails.class);
ArrayList<String> museListString = new ArrayList<>();
museListString.add(museumList.get(position).getMuseumTitle());
museListString.add(museumList.get(position).getMuseumDesc2());
museListString.add(museumList.get(position).getMuseumTop());
museListString.add(museumList.get(position).getMuseumBackground());
museListString.add(museumList.get(position).getMuseumImg());
museListString.add(museumList.get(position).getMuseumCost());
museListString.add(String.valueOf(museumList.get(position).getMuseumID()));
Log.d("museListString", museListString.toString());
museumDetails.putExtra("museumDetails", museListString);
startActivity(museumDetails);
}
public void OpenDialogBox(String title, String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AlertDialogTheme);
builder.setTitle(title)
.setMessage(message)
.setPositiveButton(getResources().getString(R.string.yes), (dialog, which) -> {
Intent main = new Intent(this, MainActivity.class);
startActivity(main);
finish();
}).setNegativeButton(getResources().getString(R.string.no), (dialog, which) -> {
});
builder.show();
}
}
\ No newline at end of file
package com.example.museumworld.museumList;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.museumworld.R;
import java.util.ArrayList;
public class MuseumList_Adapter extends RecyclerView.Adapter<MuseumList_Adapter.Viewholder> {
private ArrayList<museum_cardview> museumList;
private OnListener mOnListener;
public MuseumList_Adapter(ArrayList<museum_cardview> museumList, OnListener mOnListener) {
this.museumList = museumList;
this.mOnListener = mOnListener;
}
@NonNull
@Override
public Viewholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_museum_view, parent, false);
Viewholder mvh = new Viewholder(v, mOnListener);
return mvh;
}
@Override
public void onBindViewHolder(@NonNull Viewholder holder, int position) {
museum_cardview currentMuseum = museumList.get(position);
holder.Museum_title.setText(currentMuseum.getMuseumTitle());
holder.Museum_location.setText(currentMuseum.getMuseumLoc());
holder.Museum_Cost.setText(currentMuseum.getMuseumCost());
holder.Museum_desc.setText(currentMuseum.getMuseumDesc());
}
@Override
public int getItemCount() {
return museumList.size();
}
public interface OnListener {
void OnClick(int position);
}
// DO THIS FIRST
public static class Viewholder extends RecyclerView.ViewHolder implements View.OnClickListener {
OnListener onListener;
TextView Museum_title;
TextView Museum_location;
TextView Museum_Cost;
TextView Museum_desc;
ImageButton arrow;
public Viewholder(View itemView, OnListener onListener) {
super(itemView);
//referencing the views
arrow = itemView.findViewById(R.id.arrow);
Museum_title = itemView.findViewById(R.id.Museum_title);
Museum_location = itemView.findViewById(R.id.Museum_location);
Museum_Cost = itemView.findViewById(R.id.Museum_Cost);
Museum_desc = itemView.findViewById(R.id.Museum_desc);
this.onListener = onListener;
itemView.setOnClickListener(this);
arrow.setOnClickListener(this);
}
@Override
public void onClick(View v) {
onListener.OnClick(getAdapterPosition());
}
}
}
package com.example.museumworld.museumList;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.Spinner;
import androidx.appcompat.app.AppCompatActivity;
import com.example.museumworld.R;
import java.util.Locale;
public class Settings extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
String languageCode = "en";
private Spinner settingsSpinner;
private ImageButton backArrow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
//back arrow
backArrow = findViewById(R.id.back_arrow_icon);
backArrow.setOnClickListener(this);
//Spinner
settingsSpinner = findViewById(R.id.settingsSpinner);
String[] languages = {"Default", "English", "French"};
settingsSpinner.setOnItemSelectedListener(this);
//creating adapter
ArrayAdapter arrayAdapter = new ArrayAdapter(this, R.layout.spinner, languages);
arrayAdapter.setDropDownViewResource(R.layout.spinner);
settingsSpinner.setAdapter(arrayAdapter);
getLanguage();
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
//DECIDING on the local language
Intent settings = new Intent(this, Settings.class);
switch (i) {
case 1:
setLanguage("en");
startActivity(settings);
finish();
break;
case 2:
setLanguage("fr");
startActivity(settings);
finish();
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
public void setLanguage(String langType) {
languageCode = langType;
Resources res = getResources();
DisplayMetrics dm = res.getDisplayMetrics();
Configuration con = res.getConfiguration();
con.setLocale(new Locale(langType));
res.updateConfiguration(con, dm);
}
public void getLanguage() {
Log.d("locales", String.valueOf(getResources().getConfiguration().getLocales().get(0)));
}
@Override
public void onBackPressed() {
Intent muesumList = new Intent(this, MuseumList.class);
muesumList.putExtra("languageSet", languageCode);
finish();
startActivity(muesumList);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.back_arrow_icon:
Intent muesumList = new Intent(this, MuseumList.class);
finish();
startActivity(muesumList);
}
}
}
\ No newline at end of file
package com.example.museumworld.museumList;
public class museum_cardview {
String MuseumTitle;
int MuseumID;
String MuseumLoc;
String MuseumCost;
String MuseumDesc;
String MuseumTop;
String MuseumImg;
String MuseumBackground;
String MuseumDesc2;
public museum_cardview(String museumTitle, String museumLoc, String museumCost, String museumDesc, String museumTop, String museumImg, String museumBackground, String museumDesc2, int museumID) {
MuseumTitle = museumTitle;
MuseumLoc = museumLoc;
MuseumCost = museumCost;
MuseumDesc = museumDesc;
MuseumTop = museumTop;
MuseumImg = museumImg;
MuseumBackground = museumBackground;
MuseumDesc2 = museumDesc2;
MuseumID = museumID;
}
public String getMuseumTitle() {
return MuseumTitle;
}
public void setMuseumTitle(String museumTitle) {
MuseumTitle = museumTitle;
}
public String getMuseumLoc() {
return MuseumLoc;
}
public void setMuseumLoc(String museumLoc) {
MuseumLoc = museumLoc;
}
public String getMuseumCost() {
return MuseumCost;
}
public void setMuseumCost(String museumCost) {
MuseumCost = museumCost;
}
public String getMuseumDesc() {
return MuseumDesc;
}
public void setMuseumDesc(String museumDesc) {
MuseumDesc = museumDesc;
}
public String getMuseumTop() {
return MuseumTop;
}
public void setMuseumTop(String museumTop) {
MuseumTop = museumTop;
}
public String getMuseumImg() {
return MuseumImg;
}
public void setMuseumImg(String museumImg) {
MuseumImg = museumImg;
}
public String getMuseumBackground() {
return MuseumBackground;
}
public void setMuseumBackground(String museumBackground) {
MuseumBackground = museumBackground;
}
public String getMuseumDesc2() {
return MuseumDesc2;
}
public void setMuseumDesc2(String museumDesc2) {
MuseumDesc2 = museumDesc2;
}
public int getMuseumID() {
return MuseumID;
}
}
<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
<vector android:height="30dp" android:tint="#D3C2A0"
android:viewportHeight="24" android:viewportWidth="24"
android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,3h-1L19,1h-2v2L7,3L7,1L5,1v2L4,3c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,5c0,-1.1 -0.9,-2 -2,-2zM20,21L4,21L4,8h16v13z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">
<stroke
android:color="@color/black"
android:dashWidth="4dp"
android:dashGap="4dp"
android:width="2dp"
/>
</shape>
\ No newline at end of file
<vector android:height="15dp" android:tint="#5E5340"
android:viewportHeight="24" android:viewportWidth="24"
android:width="15dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M7,10l5,5 5,-5z"/>
</vector>
<vector android:autoMirrored="true" android:height="50dp"
android:tint="#5E5340" android:viewportHeight="24"
android:viewportWidth="24" android:width="50dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="400dp"
android:height="200dp"
android:viewportWidth="400"
android:viewportHeight="200">
<path
android:pathData="M66.9,119.6l1.3,0.7c22.1,13 49,14.2 72.1,3.2L400,0v200H0v-85C0,99 41.4,104.6 66.9,119.6z"
android:fillColor="#D3C2A0"/>
</vector>
<?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>
<vector android:height="50dp" android:tint="#E5DDCC"
android:viewportHeight="24" android:viewportWidth="24"
android:width="50dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,11H7.83l4.88,-4.88c0.39,-0.39 0.39,-1.03 0,-1.42 -0.39,-0.39 -1.02,-0.39 -1.41,0l-6.59,6.59c-0.39,0.39 -0.39,1.02 0,1.41l6.59,6.59c0.39,0.39 1.02,0.39 1.41,0 0.39,-0.39 0.39,-1.02 0,-1.41L7.83,13H19c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1z"/>
</vector>
<vector android:height="276dp" android:viewportHeight="200"
android:viewportWidth="400" android:width="551dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#D3C2A0" android:pathData="M0,0v93c42,42 50.1,57 98,57c266,0 302,50 302,50V0H0z"/>
</vector>
<vector android:height="35dp" android:tint="#A40C01"
android:viewportHeight="24" android:viewportWidth="24"
android:width="35dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5,-5L11,7zM20,19h-8v2h8c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2h-8v2h8V19z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="4.4dp"
android:viewportWidth="40"
android:viewportHeight="8.81">
<path
android:pathData="M40,0l-0,8.81l-40,0l-0,-8.81z"
android:fillColor="#fff"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.08508937"
android:scaleY="0.08508937"
android:translateX="17.82"
android:translateY="17.82">
<path
android:pathData="M0,0h850.4v850.4h-850.4z"
android:fillColor="#E5DDCC"/>
<path
android:pathData="M468.3,414.5c0,1.7 -0.3,2.5 -0.8,2.5c-9.2,0 -16.6,-0.1 -22,-0.4l-30.2,-0.4l-30.6,0.4c-5.2,0.3 -12.2,0.4 -21.2,0.4c-0.8,0 -1.2,-0.8 -1.2,-2.5c0,-1.7 0.4,-2.5 1.2,-2.5c11.4,0 19.2,-1.4 23.2,-4.2c4.1,-2.8 6.1,-8.6 6.1,-17.6l-0.4,-7.1l-8.6,-171.2l-84,202.1c-0.5,1.1 -1.6,1.7 -3.3,1.7c-1.6,0 -2.7,-0.6 -3.3,-1.7L190.3,212.8L187,363.9c-0.3,15.1 2.6,26.9 8.8,35.4c6.1,8.5 14.7,12.8 25.9,12.8c0.8,0 1.2,0.8 1.2,2.5c0,1.7 -0.4,2.5 -1.2,2.5c-7.3,0 -13,-0.1 -17.1,-0.4l-22.4,-0.4l-25.7,0.4c-4.4,0.3 -10.2,0.4 -17.5,0.4c-0.8,0 -1.2,-0.8 -1.2,-2.5c0,-1.7 0.4,-2.5 1.2,-2.5c11.1,0 20,-4.3 26.5,-13c6.5,-8.6 9.9,-20.4 10.2,-35.2l3.7,-173.3l-0.4,-0.4c-5.4,-10.3 -11.1,-17.9 -16.9,-22.6c-5.8,-4.7 -12.6,-7.1 -20.2,-7.1c-0.8,0 -1.2,-0.8 -1.2,-2.5s0.4,-2.5 1.2,-2.5l19.2,0.4c3.8,0.3 8.7,0.4 14.7,0.4l21.6,-0.4c2.4,-0.3 5.6,-0.4 9.4,-0.4c3.5,0 6.2,1.3 8.2,3.8c1.9,2.5 5.4,8.5 10.6,18l88.9,171.2l77.5,-182.5c1.6,-3.9 3.3,-6.6 5.1,-8.2c1.8,-1.5 4.1,-2.3 7.1,-2.3c2.4,0 5.2,0.1 8.4,0.4c3.1,0.3 6.7,0.4 10.8,0.4l24.1,-0.4c3.8,-0.3 9.2,-0.4 16.3,-0.4c0.8,0 1.2,0.8 1.2,2.5s-0.4,2.5 -1.2,2.5c-12.8,0 -22,2.7 -27.7,8c-5.7,5.3 -8.3,13.5 -7.7,24.7l9.8,190c0.5,8.7 1.6,14.9 3.1,18.8c1.5,3.9 4.2,6.6 8.2,8c3.9,1.4 10.1,2.1 18.5,2.1C468,412 468.3,412.8 468.3,414.5z"
android:fillColor="#5E5340"/>
<path
android:pathData="M737.8,415.7c0,1.7 -0.3,2.5 -0.8,2.5c-10.1,0 -19.5,4.4 -28.3,13.2c-8.8,8.8 -16.1,20.9 -21.8,36.2l-75.4,206.7c-0.3,1.1 -1.8,1.7 -4.5,1.7c-2.7,0 -4.2,-0.6 -4.5,-1.7l-52.2,-113.4L509,674.3c-0.3,1.1 -1.8,1.7 -4.5,1.7c-2.7,0 -4.2,-0.6 -4.5,-1.7l-104,-226.4c-4.1,-8.9 -7.4,-15.3 -10,-19.3c-2.6,-3.9 -5.4,-6.6 -8.6,-8.2c-3.1,-1.5 -7.3,-2.3 -12.4,-2.3c-0.8,0 -1.2,-0.8 -1.2,-2.5s0.4,-2.5 1.2,-2.5c4.1,0 6.9,0.1 8.6,0.4c5.4,0.6 12.5,0.8 21.2,0.8c18.2,0 33.6,-0.3 46.1,-0.8c3.5,-0.3 7.9,-0.4 13,-0.4c0.8,0 1.2,0.8 1.2,2.5s-0.4,2.5 -1.2,2.5c-6.8,0 -11.6,0.7 -14.5,2.1c-2.9,1.4 -4.3,3.9 -4.3,7.5c0,4.7 3.1,14 9.4,27.6L518,615.3l25.7,-69.1l-45.3,-98.3c-4.6,-10 -9,-17.5 -13,-22.4c-4.1,-4.9 -8.4,-7.3 -13,-7.3c-0.8,0 -1.2,-0.8 -1.2,-2.5s0.4,-2.5 1.2,-2.5c2.7,0 5.9,0.2 9.6,0.6s8.9,0.6 15.7,0.6c15.5,0 28.4,-0.3 38.7,-0.8c2.7,-0.3 6.2,-0.4 10.6,-0.4c0.8,0 1.2,0.8 1.2,2.5s-0.4,2.5 -1.2,2.5c-3.8,0 -6.6,0.5 -8.4,1.5c-1.8,1 -2.7,2.7 -2.7,5.2c0,4.7 3.7,14.9 11,30.5l17.9,38.9l10.2,-28c6,-15.9 9,-27.9 9,-36c0,-8.1 -3.4,-12.1 -10.2,-12.1c-0.8,0 -1.2,-0.8 -1.2,-2.5s0.4,-2.5 1.2,-2.5c2.2,0 4.5,0.2 7.1,0.6c2.6,0.4 9,0.6 19.4,0.6c4.6,0 10.2,-0.3 16.7,-0.8l15.1,-0.4c0.5,0 0.8,0.8 0.8,2.5s-0.3,2.5 -0.8,2.5c-18.2,0 -33.3,16.5 -45.3,49.4L571.8,509l48.9,105.9l52.6,-144.4c3.3,-8.9 4.9,-17 4.9,-24.3c0,-8.6 -2.1,-15.5 -6.3,-20.5c-4.2,-5 -9.9,-7.5 -16.9,-7.5c-0.8,0 -1.2,-0.8 -1.2,-2.5s0.4,-2.5 1.2,-2.5l18.8,0.4c9.8,0.6 18.8,0.8 26.9,0.8c5.4,0 11.7,-0.3 18.8,-0.8l17.5,-0.4C737.5,413.2 737.8,414 737.8,415.7z"
android:fillColor="#5E5340"/>
</group>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="M15.82,0h8.81v40h-8.81z"
android:fillColor="#fff"/>
<path
android:pathData="M40,15.6l-0,8.81l-40,0l-0,-8.81z"
android:fillColor="#fff"/>
</vector>
<vector android:height="40dp" android:tint="#646464"
android:viewportHeight="24" android:viewportWidth="24"
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:font="@font/cormorantgaramond_light"
android:fontStyle="normal"
android:fontWeight="200" />
<font
android:font="@font/cormorantgaramond_regular"
android:fontStyle="normal"
android:fontWeight="400" />
<font
android:font="@font/cormorantgaramond_medium"
android:fontStyle="normal"
android:fontWeight="500" />
<font
android:font="@font/cormorantgaramond_semibold"
android:fontStyle="normal"
android:fontWeight="600" />
<font
android:font="@font/cg_bold"
android:fontStyle="normal"
android:fontWeight="700" />
<!---->
<font
android:font="@font/cormorantgaramond_lightitalic"
android:fontStyle="italic"
android:fontWeight="200" />
<font
android:font="@font/cormorantgaramond_italic"
android:fontStyle="italic"
android:fontWeight="400" />
<font
android:font="@font/cormorantgaramond_mediumitalic"
android:fontStyle="italic"
android:fontWeight="500" />
<font
android:font="@font/cormorantgaramond_semibolditalic"
android:fontStyle="italic"
android:fontWeight="600" />
<font
android:font="@font/cormorantgaramond_bolditalic"
android:fontStyle="italic"
android:fontWeight="700" />
</font-family>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:font="@font/roboto_thin"
android:fontStyle="normal"
android:fontWeight="100" />
<font
android:font="@font/roboto_light"
android:fontStyle="normal"
android:fontWeight="200" />
<font
android:font="@font/roboto_regular"
android:fontStyle="normal"
android:fontWeight="400" />
<font
android:font="@font/roboto_medium"
android:fontStyle="normal"
android:fontWeight="500" />
<font
android:font="@font/roboto_bold"
android:fontStyle="normal"
android:fontWeight="700" />
<font
android:font="@font/roboto_black"
android:fontStyle="normal"
android:fontWeight="900" />
<!-- italic-->
<font
android:font="@font/roboto_thinitalic"
android:fontStyle="italic"
android:fontWeight="100" />
<font
android:font="@font/roboto_lightitalic"
android:fontStyle="italic"
android:fontWeight="200" />
<font
android:font="@font/roboto_italic"
android:fontStyle="italic"
android:fontWeight="400" />
<font
android:font="@font/roboto_mediumitalic"
android:fontStyle="italic"
android:fontWeight="500" />
<font
android:font="@font/roboto_bolditalic"
android:fontStyle="italic"
android:fontWeight="700" />
<font
android:font="@font/roboto_blackitalic"
android:fontStyle="italic"
android:fontWeight="900" />
</font-family>
\ 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=".booking.booking">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/cl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@android:color/transparent"
android:elevation="101dp"></androidx.coordinatorlayout.widget.CoordinatorLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent2"
/>
<RelativeLayout
android:id="@+id/top_wrapper"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
>
<ImageView
android:id="@+id/topImgD"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/ic_top_shape"
android:contentDescription="@string/top_shape" />
<ImageView
android:id="@+id/top_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:alpha="0.10"
android:contentDescription="@string/top_image" />
<TextView
android:id="@+id/titleD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="30dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="@string/date_time"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textFontWeight="700"
android:textSize="45sp" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/back_arrow_wrapper"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="@+id/top_wrapper"
android:layout_marginStart="25dp"
android:padding="10dp"
app:cardBackgroundColor="@color/dark_brown"
app:cardCornerRadius="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/back_arrow_icon"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@color/transparent"
android:contentDescription="@string/arrow_icon"
android:src="@drawable/ic_round_arrow_back_24" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<RelativeLayout
android:id="@+id/label_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_arrow_wrapper"
android:padding="2dp">
<TextView
android:id="@+id/calendar_label"
style="@style/input_label_Theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/calendar_CD"
android:layout_alignParentTop="true"
android:text="@string/select_date"
android:textStyle="bold" />
<androidx.cardview.widget.CardView
android:id="@+id/calendar_CD"
style="@style/input_cardView_theme"
android:layout_below="@+id/calendar_label"
android:layout_marginHorizontal="100dp"
app:cardCornerRadius="15dp">
<TextView
android:id="@+id/date_Text"
style="@style/input_text_theme"
android:layout_margin="10dp"
android:fontFamily="@font/roboto"
android:hint="@string/date_goes_here"
android:textAlignment="center"
android:textColorHighlight="@color/dark_red"
android:textSize="18sp" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/calendar_wrapper"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignTop="@+id/calendar_CD"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:padding="10dp"
app:cardBackgroundColor="@color/dark_brown"
app:cardCornerRadius="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/calendar_icon"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@color/transparent"
android:contentDescription="@string/arrow_icon"
android:src="@drawable/calendar_icon" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
<TextView
android:id="@+id/Date_title"
style="@style/input_label_Theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/label_wrapper"
android:layout_alignStart="@+id/CD_TIME"
android:layout_marginTop="80dp"
android:text="@string/select_time"
android:textStyle="bold" />
<androidx.cardview.widget.CardView
android:id="@+id/CD_TIME"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Date_title"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="100dp"
android:padding="5dp"
app:cardCornerRadius="15dp">
<Spinner
android:id="@+id/timeSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/time_label"
android:background="@color/cream"
android:popupBackground="@color/cream"
/>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
style="@style/button_cardview_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="100dp">
<TextView
android:id="@+id/next_btn"
style="@style/Alert_btn_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="10dp"
android:text="@string/book_now"
android:textSize="25dp"
android:textStyle="italic" />
</androidx.cardview.widget.CardView>
</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=".cafe_shop.cafe_activity">
<RelativeLayout
android:id="@+id/top_wrapper"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<ImageView
android:id="@+id/topImgD"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/ic_top_shape"
android:contentDescription="@string/top_shape" />
<ImageView
android:id="@+id/top_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:alpha="0.10"
android:contentDescription="@string/top_image" />
<TextView
android:id="@+id/titleD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="30dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="@string/cafe_items"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textFontWeight="700"
android:textSize="45sp" />
<TextView
android:id="@+id/title2D"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/titleD"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:text="@string/optional"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textFontWeight="700"
android:textSize="30sp" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/back_arrow_wrapper"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="@+id/top_wrapper"
android:layout_marginStart="25dp"
android:padding="10dp"
app:cardBackgroundColor="@color/dark_brown"
app:cardCornerRadius="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/back_arrow_icon"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@color/transparent"
android:contentDescription="@string/arrow_icon"
android:src="@drawable/ic_round_arrow_back_24" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/next_btn_CD"
android:layout_below="@+id/top_wrapper"
android:layout_marginTop="10dp">
<RelativeLayout
android:id="@+id/titles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
<TextView
android:id="@+id/item_title"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="@string/item"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textSize="30sp"
android:textStyle="bold" />
<View
android:id="@+id/end_of_item_line"
android:layout_width="3dp"
android:layout_height="20dp"
android:layout_above="@+id/line_horizontal"
android:layout_alignRight="@+id/item_title"
android:layout_marginRight="-3dp"
android:background="@color/light_blue" />
<TextView
android:id="@+id/price_title"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/end_of_item_line"
android:text="@string/price"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textSize="30sp"
android:textStyle="bold" />
<View
android:id="@+id/end_of_price_line"
android:layout_width="3dp"
android:layout_height="20dp"
android:layout_above="@+id/line_horizontal"
android:layout_alignRight="@+id/price_title"
android:layout_marginRight="-3dp"
android:background="@color/light_blue" />
<TextView
android:id="@+id/quantity_title"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/end_of_price_line"
android:text="@string/quantity"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textSize="30sp"
android:textStyle="bold" />
<View
android:id="@+id/line_horizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_below="@+id/item_title"
android:layout_alignStart="@+id/item_title"
android:layout_alignEnd="@+id/quantity_title"
android:background="@color/light_blue" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/cafe_RecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/titles"
android:layout_alignParentBottom="true"
android:fadingEdge="vertical"
android:padding="10dp"
android:scrollbars="vertical" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/next_btn_CD"
style="@style/button_cardview_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_margin="15dp"
android:elevation="10dp"
app:cardElevation="10dp">
<TextView
android:id="@+id/next_btn"
style="@style/Alert_btn_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="30dp"
android:paddingVertical="5dp"
android:text="@string/next"
android:textSize="35dp"
android:textStyle="italic" />
</androidx.cardview.widget.CardView>
</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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="0dp"
android:padding="10dp">
<RelativeLayout
android:id="@+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<TextView
android:id="@+id/item_textView"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:fontFamily="@font/roboto"
android:text="Sweet roll"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textSize="20sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/price_textView"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/item_textView"
android:fontFamily="@font/roboto"
android:paddingHorizontal="18dp"
android:text="£1.00"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textSize="20sp" />
<RelativeLayout
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/price_textView">
<androidx.cardview.widget.CardView
android:id="@+id/minusCD"
android:layout_width="40dp"
android:layout_height="32dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_margin="3dp"
android:backgroundTint="@color/light_red"
app:cardCornerRadius="8dp"
app:cardElevation="5dp"
>
<ImageButton
android:id="@+id/minus_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent"
android:src="@drawable/minus" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/counterCD"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:layout_margin="3dp"
android:backgroundTint="@color/light_cream"
app:cardCornerRadius="8dp"
app:cardElevation="5dp"
>
<TextView
android:id="@+id/quantity_counter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/roboto"
android:text="0"
android:padding="5dp"
android:maxLength="2"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textSize="25sp"
android:textStyle="bold"
/>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/plusCD"
android:layout_width="40dp"
android:layout_height="32dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_margin="3dp"
android:backgroundTint="@color/light_green"
app:cardCornerRadius="8dp"
app:cardElevation="5dp"
>
<ImageButton
android:id="@+id/plus_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent"
android:src="@drawable/plus" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
tools:context=".login.MainActivity">
<!-- THIS IS THE TOP WRAPPER FOR THE IMAGE -->
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/cl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@android:color/transparent"
android:elevation="101dp"></androidx.coordinatorlayout.widget.CoordinatorLayout>
<RelativeLayout
android:id="@+id/top_wrapper"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@drawable/ic_top_shape"
android:contentDescription="@string/top_shape" />
<ImageView
android:id="@+id/top_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.05"
android:background="@mipmap/top_shape_image"
android:contentDescription="@string/top_image" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="@string/world_museums"
android:textColor="@color/dark_brown"
android:textFontWeight="700"
android:textSize="52sp" />
</RelativeLayout>
<!--MIDDLE WRAPPER-->
<RelativeLayout
android:id="@+id/middle_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="5dp">
<RelativeLayout
android:id="@+id/input_label_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:padding="2dp">
<TextView
android:id="@+id/userName_label"
style="@style/input_label_Theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/username_CD"
android:layout_alignParentTop="true"
android:text="@string/username_label" />
<TextView
android:id="@+id/ErrorMessageUsername"
style="@style/errorMessage"
android:layout_below="@+id/userName_label"
android:layout_alignLeft="@+id/userName_label"
android:layout_alignRight="@+id/username_CD"
/>
<androidx.cardview.widget.CardView
android:id="@+id/username_CD"
style="@style/input_cardView_theme"
android:layout_below="@+id/ErrorMessageUsername">
<EditText
android:id="@+id/username_EditText"
style="@style/input_text_theme"
android:autofillHints=""
android:hint="@string/username_hint"
android:inputType="text" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
<!--PASSWORD ENTER COMPONENT-->
<RelativeLayout
android:id="@+id/input_label_wrapper2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/input_label_wrapper"
android:layout_alignParentStart="true"
android:layout_marginStart="5dp"
android:layout_marginTop="-1dp"
android:padding="2dp">
<TextView
android:id="@+id/password_label"
style="@style/input_label_Theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/password_CD"
android:layout_alignParentTop="true"
android:text="@string/password_label" />
<TextView
android:id="@+id/ErrorMessagePassword"
style="@style/errorMessage"
android:layout_below="@+id/password_label"
android:layout_alignLeft="@+id/password_label"
android:layout_alignRight="@+id/password_CD"
/>
<androidx.cardview.widget.CardView
android:id="@+id/password_CD"
style="@style/input_cardView_theme"
android:layout_below="@+id/ErrorMessagePassword">
<EditText
android:id="@+id/password_EditText"
style="@style/input_text_theme"
android:autofillHints=""
android:hint="@string/password_hint"
android:inputType="textPassword" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/button_wrapper"
style="@style/button_cardview_theme"
android:layout_below="@+id/input_label_wrapper2"
android:layout_alignEnd="@+id/input_label_wrapper2"
>
<TextView
android:id="@+id/login_btn"
style="@style/normal_btn_theme"
android:text="@string/login" />
</androidx.cardview.widget.CardView>
<!-- ALERT BTN-->
<androidx.cardview.widget.CardView
android:id="@+id/button_wrapper2"
style="@style/button_cardview_theme"
android:layout_below="@+id/button_wrapper"
android:layout_alignStart="@+id/button_wrapper">
<TextView
android:id="@+id/signup_btn2"
style="@style/Alert_btn_theme"
android:text="@string/Sign_up"
android:textSize="25sp" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
<!-- THIS IS THE TOP WRAPPER FOR THE IMAGE-->
<RelativeLayout
android:id="@+id/bottom_wrapper"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@drawable/ic_bottom_shape"
android:contentDescription="@string/this_is_the_bottom_shape" />
<ImageView
android:id="@+id/bottom_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.50"
android:background="@mipmap/bottom_shape"
android:contentDescription="@string/this_is_the_bottom_image" />
</RelativeLayout>
</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:id="@+id/backgroundImgD"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".details.MuseumDetails"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent2"
/>
<RelativeLayout
android:id="@+id/top_wrapper"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
>
<ImageView
android:id="@+id/topImgD"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/ic_top_shape"
android:contentDescription="@string/top_shape" />
<ImageView
android:id="@+id/top_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:alpha="0.10"
android:contentDescription="@string/top_image" />
<TextView
android:id="@+id/titleD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="30dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="@string/Louvre"
android:textAlignment="center"
android:textColor="@color/dark_brown"
android:textFontWeight="700"
android:textSize="45sp" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/back_arrow_wrapper"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="@+id/top_wrapper"
android:layout_marginStart="25dp"
android:padding="10dp"
app:cardBackgroundColor="@color/dark_brown"
app:cardCornerRadius="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/back_arrow_icon"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@color/transparent"
android:contentDescription="@string/arrow_icon"
android:src="@drawable/ic_round_arrow_back_24" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/descD"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_below="@+id/back_arrow_wrapper"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="20dp"
android:padding="10dp"
android:scrollbars="vertical"
android:textColor="@color/dark_brown"
android:textSize="22dp"
/>
<TextView
android:id="@+id/costD"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/descD"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="20dp"
android:text="@string/price"
android:textColor="@color/dark_brown"
android:textSize="28dp"
android:textStyle="bold"
/>
<ImageView
android:id="@+id/imgD"
android:layout_width="200dp"
android:layout_height="150dp"
android:layout_below="@+id/costD"
android:layout_centerHorizontal="true" />
<androidx.cardview.widget.CardView
style="@style/button_cardview_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgD"
android:layout_centerHorizontal="true">
<TextView
android:id="@+id/book_btn"
style="@style/Alert_btn_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="10dp"
android:text="@string/book_now"
android:textSize="25dp"
android:textStyle="italic" />
</androidx.cardview.widget.CardView>
<RelativeLayout
android:id="@+id/splashScreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cream3"
android:elevation="20dp"
>
<ImageView
android:id="@+id/imgLogo"
style="@style/progressbarLogo" />
/>
<ProgressBar style="@style/progressbarLoader"
/>
</RelativeLayout>
</RelativeLayout>
<?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=".museumList.MuseumList">
<RelativeLayout
android:id="@+id/top_wrapper"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@drawable/ic_top_shape"
android:contentDescription="@string/top_shape" />
<ImageView
android:id="@+id/top_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.05"
android:background="@mipmap/top_shape_image"
android:contentDescription="@string/top_image" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="@string/Museums"
android:textColor="@color/dark_brown"
android:textFontWeight="700"
android:textSize="60sp" />
<ImageButton
android:id="@+id/settings_btn"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#00FFFFFF"
android:clickable="true"
android:contentDescription="@string/settings_icon"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:src="@drawable/settings_icon" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/back_arrow_wrapper"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignBottom="@+id/top_wrapper"
android:layout_marginStart="25dp"
android:layout_marginBottom="-10dp"
android:backgroundTint="@color/light_blue"
app:cardCornerRadius="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/sign_out_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:backgroundTint="@color/light_blue"
android:contentDescription="@string/arrow_icon"
android:rotation="180"
android:src="@drawable/logout" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/enter_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_arrow_wrapper"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/museum_list_rec"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/enter_message"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:fadingEdge="vertical"
android:orientation="vertical"
android:padding="5dp"
android:requiresFadingEdge="vertical"
android:scrollbars="vertical"
/>
</RelativeLayout>
\ 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.
<?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
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.
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.
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.
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