Commit eda29815 authored by lucy.hemingway's avatar lucy.hemingway

functioning log in and museum full details with price carried over to booking page.

parent 328e75ce
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="14">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="2" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="3" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="5" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
<item index="6" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="7" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="13">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="2" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="3" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="5" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
<item index="6" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="10" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
<item index="11" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" />
</list>
</value>
</option>
</component>
<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>
......
......@@ -42,16 +42,20 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String name = myMuseums.get(position).name; //modified
String desc = myMuseums.get(position).desc; //modified
String price = myMuseums.get(position).price; //modified
String desc = myMuseums.get(position).desc;
holder.MuseumText.setText(name);
holder.DescriptionText.setText(desc);
holder.PriceText.setText(price);
holder.descText.setText(desc);
holder.MuseumText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), fulldetails.class);
intent.putExtra ( "selectedMuseum", myMuseums.get(position).name);
intent.putExtra("price", myMuseums.get(position).price);
v.getContext().startActivity(intent);
}
......@@ -71,12 +75,14 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
// create and retrieve the data as the user scrolls the list
public class ViewHolder extends RecyclerView.ViewHolder{
TextView MuseumText;
TextView DescriptionText; //add
TextView PriceText;
TextView descText;
ViewHolder(View v){
super(v);
MuseumText = itemView.findViewById(R.id.MuseumText);
DescriptionText = itemView.findViewById(R.id.DescriptionText); //add
PriceText = itemView.findViewById(R.id.PriceText);
descText = itemView.findViewById(R.id.description1);
}
}
......
......@@ -18,8 +18,15 @@ import org.w3c.dom.Text;
import java.util.Calendar;
import java.util.Date;
public class Booking extends AppCompatActivity {
public static String price;
public static String selectedMuseum;
private static final String TAG = "Booking";
TextView Date;
DatePickerDialog.OnDateSetListener SetDate;
......@@ -29,13 +36,21 @@ public class Booking extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_booking);
Intent intent = getIntent();
String museumselected = intent.getStringExtra(fulldetails.mname);
int fee = intent.getIntExtra(String.valueOf(fulldetails.price), 0);
// Bundle bundle = getIntent().getExtras();
// Intent intent = getIntent();
// String mname = bundle.getString(fulldetails.selectedMuseum);
// int price = bundle.getInt(String.valueOf(fulldetails.price), 0);
TextView museumname = (TextView)findViewById(R.id.Museumname);
TextView priceofmuseum = (TextView)findViewById(R.id.pricehere);
Intent intent = getIntent();
selectedMuseum = intent.getStringExtra("selectedMuseum");
price = intent.getStringExtra("price");
museumname.setText(museumselected);
museumname.setText(selectedMuseum);
priceofmuseum.setText(price);
Date = (TextView) findViewById(R.id.selectdate);
......
......@@ -26,16 +26,16 @@ public class MuseumList extends AppCompatActivity {
dataList = new ArrayList<>();
dataList.add(new MuseumNames ("Louvre", "Paris, France : £10"));
dataList.add(new MuseumNames ("National Museum of China", "Beijing, China : £10"));
dataList.add(new MuseumNames ("Vatican Museums", "Vatican City, Vatican : £10 "));
dataList.add(new MuseumNames ("Metropolitan Museum of Art", "New York City, New York : £10 "));
dataList.add(new MuseumNames("British Museum", "London, UK : £10 "));
dataList.add(new MuseumNames("Tate Modern", "London, UK : £5 "));
dataList.add(new MuseumNames("National Gallery", "London, UK : £5 "));
dataList.add(new MuseumNames("Natural History Museum", "London, UK : £5 "));
dataList.add(new MuseumNames("American Museum of Natural History", "New York City, New York : £5 "));
dataList.add(new MuseumNames("State Hermitage Museum", "Saint Petersburg, Russia : £5 "));
dataList.add(new MuseumNames ("Louvre", "10","Paris, France" ));
dataList.add(new MuseumNames ("National Museum of China", "10", "Beijing, China"));
dataList.add(new MuseumNames ("Vatican Museums", "10","Vatican City, Vatican"));
dataList.add(new MuseumNames ("Metropolitan Museum of Art","10","New York City, New York"));
dataList.add(new MuseumNames("British Museum","10","London, UK"));
dataList.add(new MuseumNames("Tate Modern","5","London, UK"));
dataList.add(new MuseumNames("National Gallery","5","London, UK"));
dataList.add(new MuseumNames("Natural History Museum", "5","London, UK "));
dataList.add(new MuseumNames("American Museum of Natural History","5","New York City, New York"));
dataList.add(new MuseumNames("State Hermitage Museum","5","Saint Petersburg, Russia"));
// set up the recyclerview
......
......@@ -3,10 +3,14 @@ package com.example.appppppp;
public class MuseumNames {
String name;
String price;
String desc;
MuseumNames(String n, String d ){
MuseumNames(String n,String p, String d){
name = n;
price = p;
desc = d;
}
}
......@@ -12,22 +12,39 @@ import android.widget.TextView;
public class fulldetails extends AppCompatActivity {
//variables for next page if this museum is selected
public static String mname = "";
public static int price = 0;
public static String price;
public static String selectedMuseum;
Button bookthis;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fulldetails);
Intent intent = getIntent();
String selectedMuseum = intent.getStringExtra("selectedMuseum");
selectedMuseum = intent.getStringExtra("selectedMuseum");
price = intent.getStringExtra("price");
((TextView)findViewById(R.id.priceview)).setText(price);
((TextView)findViewById(R.id.check)).setText(selectedMuseum);
setDetail(selectedMuseum);
setvariables(selectedMuseum);
// setvariables(selectedMuseum);
/* bookthis = (Button)findViewById(R.id.book);
bookthis.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent book = new Intent (getApplicationContext(), Booking.class);
book.putExtra("museum", selectedMuseum);
book.putExtra("fee",price);
startActivity(book);
}
});*/
}
......@@ -40,105 +57,104 @@ public class fulldetails extends AppCompatActivity {
switch(s) {
case "Louvre":
// mname = "Louvre";
// price = 10;
// i = 1;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.louvre);
((TextView)findViewById(R.id.thetext)).setText( "The Louvre asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The Louvre, or the Louvre Museum, is the world's largest art museum and a historic monument in Paris," +
" France, and is best known for being the home of the Mona Lisa. A central landmark of the city, it is located on the Right Bank of the Seine in the city's 1st arrondissement");
break;
case "National Museum of China":
// mname="National Museum of China";
// price=10;
// i=2;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.china);
((TextView)findViewById(R.id.thetext)).setText( "China asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The National Museum of China flanks the eastern side of Tiananmen Square in Beijing, China. The museum's mission is to educate about the arts and history of China. " +
"It is directed by the Ministry of Culture of the People's Republic of China.");
break;
case "Vatican Museums":
// mname="Vatican Museums";
// price=10;
// i= 3;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.vatican);
((TextView)findViewById(R.id.thetext)).setText( "Vatican d jka ");
((TextView)findViewById(R.id.thetext)).setText( "The Vatican Museums are the public art and sculpture museums in the Vatican City. They display works from the immense " +
"collection amassed by the Catholic Church and the papacy throughout the centuries " +
"including several of the most renowned Roman sculptures and most important masterpieces of Renaissance art in the world.");
break;
case "Metropolitan Museum of Art":
// mname = "Metropolitan Museum of Art";
// price= 10;
// i = 4;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.metropolitan);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The Metropolitan Museum of Art of New York City, colloquially \"the Met\", is the largest art museum in the United States. " +
"Its permanent collection contains over 2 million works, divided among 17 curatorial departments.");
break;
case "British Museum":
// mname = "British Museum";
// price= 10;
//i = 5;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.british);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The British Museum, in the Bloomsbury area of London, England," +
" is a public institution dedicated to human history, art and culture. Its permanent collection of some eight million works is among the largest and most comprehensive in existence, having been widely collected during the era of the British Empire. ");
break;
case "Tate Modern":
// mname = "Tate Modern";
// price= 5;
// i = 6;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.tate);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "Tate is an institution that houses, in a network of four art galleries, the United Kingdom's national collection of British art, and international modern and contemporary art. It is not a " +
"government institution, but its main sponsor is the UK Department for Digital, Culture, Media and Sport.");
break;
case "National Gallery":
// mname = "National Gallery";
// price= 5;
// i = 7;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.national);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The National Gallery is an art museum in Trafalgar Square in the City of Westminster, in Central London. Founded in 1824, it houses a collection of over 2,300 paintings dating from the mid-13th century to 1900 "
+
"The Gallery is an exempt charity, and a non-departmental public body of the Department for Digital, Culture, Media and Sport.");
break;
case "Natural History Museum":
// mname = "Natural History Museum";
// price= 5;
// i = 8;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.natural);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The Natural History Museum in London is a natural history museum that exhibits a vast range of specimens from various segments of natural history." +
" It is one of three major museums on Exhibition Road in South Kensington, the others being the Science Museum and the Victoria and Albert Museum. The Natural History Museum's main frontage, however, is on Cromwell Road.");
break;
case "American Museum of Natural History":
// mname = "American Museum of Natural History";
// price= 5;
// i = 9;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.american);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The American Museum of Natural History (abbreviated as AMNH) is a natural history museum on the Upper West Side of Manhattan, New York City. In Theodore Roosevelt Park, across the street from Central Park, the museum complex" +
" comprises 26 interconnected buildings housing 45 permanent exhibition halls, in addition to a planetarium and a library. The museum collections contain over 34 million specimens of plants, animals, fossils, minerals, rocks, meteorites, human remains, and human " +
"cultural artifacts, as well as specialized collections for frozen tissue and genomic and astrophysical data, of which only a small fraction can be displayed at any given time.");
break;
case "State Hermitage Museum":
// mname = "State Hermitage Museum";
// price= 5;
// i = 10;
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.state);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
((TextView)findViewById(R.id.thetext)).setText( "The State Hermitage Museum is a museum of art and culture in Saint Petersburg, Russia. The second-largest art museum in the world, it was founded in 1764 when Empress Catherine the Great acquired" +
"an impressive collection of paintings from the Berlin merchant Johann Ernst Gotzkowsky. ");
break;
......@@ -155,8 +171,17 @@ public class fulldetails extends AppCompatActivity {
}
public void bookthis(View view){
Bundle n = getIntent().getExtras();
Intent book = new Intent (this, Booking.class);
book.putExtra("selectedMuseum",selectedMuseum);
book.putExtra("price",price);
startActivity(book);
}
public void setvariables(String museum){
/* public void setvariables(String museum){
if(museum.equals("Louvre")){
price = 10;
mname = "louvre";
......@@ -212,7 +237,7 @@ public class fulldetails extends AppCompatActivity {
});
}
}*/
......
......@@ -8,8 +8,8 @@
<TextView
android:id="@+id/Museumname"
android:layout_width="192dp"
android:layout_height="32dp"
android:layout_width="230dp"
android:layout_height="116dp"
android:text="Museum"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
......@@ -31,4 +31,12 @@
app:layout_constraintTop_toBottomOf="@+id/Museumname"
app:layout_constraintVertical_bias="0.356" />
<TextView
android:id="@+id/pricehere"
android:layout_width="227dp"
android:layout_height="52dp"
android:text="price"
tools:layout_editor_absoluteX="82dp"
tools:layout_editor_absoluteY="203dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -8,28 +8,32 @@
<TextView
android:id="@+id/check"
android:layout_width="291dp"
android:layout_width="325dp"
android:layout_height="36dp"
android:editable="false"
android:text="TextView"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.511"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.023" />
app:layout_constraintVertical_bias="0.021" />
<EditText
android:id="@+id/thetext"
android:layout_width="292dp"
android:layout_height="225dp"
android:layout_width="322dp"
android:layout_height="294dp"
android:editable="false"
android:ems="10"
android:gravity="start|top"
android:inputType="textMultiLine"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check"
app:layout_constraintVertical_bias="0.495" />
app:layout_constraintVertical_bias="0.573" />
<ImageView
android:id="@+id/theimage"
......@@ -39,7 +43,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check"
app:layout_constraintVertical_bias="0.428"
app:layout_constraintVertical_bias="1.0"
tools:srcCompat="@tools:sample/avatars" />
<Button
......@@ -47,10 +51,40 @@
android:layout_width="124dp"
android:layout_height="42dp"
android:layout_marginTop="49dp"
android:onClick="bookthis"
android:text="Book Now"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/thetext"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/priceview"
android:layout_width="52dp"
android:layout_height="0dp"
android:layout_marginTop="11dp"
android:layout_marginBottom="19dp"
android:editable="false"
android:text="price"
app:layout_constraintBottom_toTopOf="@+id/book"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.323"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/thetext"
app:layout_constraintVertical_bias="1.0" />
<TextView
android:id="@+id/textView2"
android:layout_width="55dp"
android:layout_height="19dp"
android:layout_marginTop="13dp"
android:editable="false"
android:text="Price: £"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/priceview"
app:layout_constraintHorizontal_bias="0.82"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/thetext"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -17,11 +17,25 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:textSize="18sp" />
<TextView
android:id="@+id/DescriptionText"
android:id="@+id/description1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="description" />
<TextView
android:id="@+id/price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Price (£):" />
<TextView
android:id="@+id/PriceText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="description of each museum" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
......
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