Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Lucy_Hemingway
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lucy.hemingway
Summative_Lucy_Hemingway
Commits
eda29815
Commit
eda29815
authored
May 12, 2021
by
lucy.hemingway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
functioning log in and museum full details with price carried over to booking page.
parent
328e75ce
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
225 additions
and
76 deletions
+225
-76
misc.xml
.idea/misc.xml
+43
-0
Adapter.java
app/src/main/java/com/example/appppppp/Adapter.java
+10
-4
Booking.java
app/src/main/java/com/example/appppppp/Booking.java
+19
-4
MuseumList.java
app/src/main/java/com/example/appppppp/MuseumList.java
+10
-10
MuseumNames.java
app/src/main/java/com/example/appppppp/MuseumNames.java
+5
-1
fulldetails.java
app/src/main/java/com/example/appppppp/fulldetails.java
+72
-47
activity_booking.xml
app/src/main/res/layout/activity_booking.xml
+10
-2
activity_fulldetails.xml
app/src/main/res/layout/activity_fulldetails.xml
+41
-7
row_museum.xml
app/src/main/res/layout/row_museum.xml
+15
-1
No files found.
.idea/misc.xml
View file @
eda29815
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<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"
>
<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"
/>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
</component>
...
...
app/src/main/java/com/example/appppppp/Adapter.java
View file @
eda29815
...
@@ -42,16 +42,20 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
...
@@ -42,16 +42,20 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
@Override
@Override
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
String
name
=
myMuseums
.
get
(
position
).
name
;
//modified
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
.
MuseumText
.
setText
(
name
);
holder
.
DescriptionText
.
setText
(
desc
);
holder
.
PriceText
.
setText
(
price
);
holder
.
descText
.
setText
(
desc
);
holder
.
MuseumText
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
holder
.
MuseumText
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
v
.
getContext
(),
fulldetails
.
class
);
Intent
intent
=
new
Intent
(
v
.
getContext
(),
fulldetails
.
class
);
intent
.
putExtra
(
"selectedMuseum"
,
myMuseums
.
get
(
position
).
name
);
intent
.
putExtra
(
"selectedMuseum"
,
myMuseums
.
get
(
position
).
name
);
intent
.
putExtra
(
"price"
,
myMuseums
.
get
(
position
).
price
);
v
.
getContext
().
startActivity
(
intent
);
v
.
getContext
().
startActivity
(
intent
);
}
}
...
@@ -71,12 +75,14 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
...
@@ -71,12 +75,14 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
// create and retrieve the data as the user scrolls the list
// create and retrieve the data as the user scrolls the list
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
TextView
MuseumText
;
TextView
MuseumText
;
TextView
DescriptionText
;
//add
TextView
PriceText
;
TextView
descText
;
ViewHolder
(
View
v
){
ViewHolder
(
View
v
){
super
(
v
);
super
(
v
);
MuseumText
=
itemView
.
findViewById
(
R
.
id
.
MuseumText
);
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
);
}
}
}
}
...
...
app/src/main/java/com/example/appppppp/Booking.java
View file @
eda29815
...
@@ -18,8 +18,15 @@ import org.w3c.dom.Text;
...
@@ -18,8 +18,15 @@ import org.w3c.dom.Text;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
public
class
Booking
extends
AppCompatActivity
{
public
class
Booking
extends
AppCompatActivity
{
public
static
String
price
;
public
static
String
selectedMuseum
;
private
static
final
String
TAG
=
"Booking"
;
private
static
final
String
TAG
=
"Booking"
;
TextView
Date
;
TextView
Date
;
DatePickerDialog
.
OnDateSetListener
SetDate
;
DatePickerDialog
.
OnDateSetListener
SetDate
;
...
@@ -29,13 +36,21 @@ public class Booking extends AppCompatActivity {
...
@@ -29,13 +36,21 @@ public class Booking extends AppCompatActivity {
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_booking
);
setContentView
(
R
.
layout
.
activity_booking
);
Intent
intent
=
getIntent
();
// Bundle bundle = getIntent().getExtras();
String
museumselected
=
intent
.
getStringExtra
(
fulldetails
.
mname
);
int
fee
=
intent
.
getIntExtra
(
String
.
valueOf
(
fulldetails
.
price
),
0
);
// 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
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
);
Date
=
(
TextView
)
findViewById
(
R
.
id
.
selectdate
);
...
...
app/src/main/java/com/example/appppppp/MuseumList.java
View file @
eda29815
...
@@ -26,16 +26,16 @@ public class MuseumList extends AppCompatActivity {
...
@@ -26,16 +26,16 @@ public class MuseumList extends AppCompatActivity {
dataList
=
new
ArrayList
<>();
dataList
=
new
ArrayList
<>();
dataList
.
add
(
new
MuseumNames
(
"Louvre"
,
"
Paris, France : £10"
));
dataList
.
add
(
new
MuseumNames
(
"Louvre"
,
"
10"
,
"Paris, France"
));
dataList
.
add
(
new
MuseumNames
(
"National Museum of China"
,
"
Beijing, China : £10
"
));
dataList
.
add
(
new
MuseumNames
(
"National Museum of China"
,
"
10"
,
"Beijing, China
"
));
dataList
.
add
(
new
MuseumNames
(
"Vatican Museums"
,
"
Vatican City, Vatican : £10
"
));
dataList
.
add
(
new
MuseumNames
(
"Vatican Museums"
,
"
10"
,
"Vatican City, Vatican
"
));
dataList
.
add
(
new
MuseumNames
(
"Metropolitan Museum of Art"
,
"New York City, New York : £10
"
));
dataList
.
add
(
new
MuseumNames
(
"Metropolitan Museum of Art"
,
"10"
,
"New York City, New York
"
));
dataList
.
add
(
new
MuseumNames
(
"British Museum"
,
"London, UK : £10
"
));
dataList
.
add
(
new
MuseumNames
(
"British Museum"
,
"10"
,
"London, UK
"
));
dataList
.
add
(
new
MuseumNames
(
"Tate Modern"
,
"London, UK : £5
"
));
dataList
.
add
(
new
MuseumNames
(
"Tate Modern"
,
"5"
,
"London, UK
"
));
dataList
.
add
(
new
MuseumNames
(
"National Gallery"
,
"London, UK : £5
"
));
dataList
.
add
(
new
MuseumNames
(
"National Gallery"
,
"5"
,
"London, UK
"
));
dataList
.
add
(
new
MuseumNames
(
"Natural History Museum"
,
"
London, UK : £5
"
));
dataList
.
add
(
new
MuseumNames
(
"Natural History Museum"
,
"
5"
,
"London, UK
"
));
dataList
.
add
(
new
MuseumNames
(
"American Museum of Natural History"
,
"New York City, New York : £5
"
));
dataList
.
add
(
new
MuseumNames
(
"American Museum of Natural History"
,
"5"
,
"New York City, New York
"
));
dataList
.
add
(
new
MuseumNames
(
"State Hermitage Museum"
,
"Saint Petersburg, Russia : £5
"
));
dataList
.
add
(
new
MuseumNames
(
"State Hermitage Museum"
,
"5"
,
"Saint Petersburg, Russia
"
));
// set up the recyclerview
// set up the recyclerview
...
...
app/src/main/java/com/example/appppppp/MuseumNames.java
View file @
eda29815
...
@@ -3,10 +3,14 @@ package com.example.appppppp;
...
@@ -3,10 +3,14 @@ package com.example.appppppp;
public
class
MuseumNames
{
public
class
MuseumNames
{
String
name
;
String
name
;
String
price
;
String
desc
;
String
desc
;
MuseumNames
(
String
n
,
String
d
){
MuseumNames
(
String
n
,
String
p
,
String
d
){
name
=
n
;
name
=
n
;
price
=
p
;
desc
=
d
;
desc
=
d
;
}
}
}
}
app/src/main/java/com/example/appppppp/fulldetails.java
View file @
eda29815
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_booking.xml
View file @
eda29815
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
<TextView
<TextView
android:id=
"@+id/Museumname"
android:id=
"@+id/Museumname"
android:layout_width=
"
192
dp"
android:layout_width=
"
230
dp"
android:layout_height=
"
32
dp"
android:layout_height=
"
116
dp"
android:text=
"Museum"
android:text=
"Museum"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
@@ -31,4 +31,12 @@
...
@@ -31,4 +31,12 @@
app:layout_constraintTop_toBottomOf=
"@+id/Museumname"
app:layout_constraintTop_toBottomOf=
"@+id/Museumname"
app:layout_constraintVertical_bias=
"0.356"
/>
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>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_fulldetails.xml
View file @
eda29815
...
@@ -8,28 +8,32 @@
...
@@ -8,28 +8,32 @@
<TextView
<TextView
android:id=
"@+id/check"
android:id=
"@+id/check"
android:layout_width=
"
291
dp"
android:layout_width=
"
325
dp"
android:layout_height=
"36dp"
android:layout_height=
"36dp"
android:editable=
"false"
android:text=
"TextView"
android:text=
"TextView"
android:textSize=
"24sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.511"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.02
3
"
/>
app:layout_constraintVertical_bias=
"0.02
1
"
/>
<EditText
<EditText
android:id=
"@+id/thetext"
android:id=
"@+id/thetext"
android:layout_width=
"292dp"
android:layout_width=
"322dp"
android:layout_height=
"225dp"
android:layout_height=
"294dp"
android:editable=
"false"
android:ems=
"10"
android:ems=
"10"
android:gravity=
"start|top"
android:gravity=
"start|top"
android:inputType=
"textMultiLine"
android:inputType=
"textMultiLine"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.49
5
"
app:layout_constraintHorizontal_bias=
"0.49
4
"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintVertical_bias=
"0.
495
"
/>
app:layout_constraintVertical_bias=
"0.
573
"
/>
<ImageView
<ImageView
android:id=
"@+id/theimage"
android:id=
"@+id/theimage"
...
@@ -39,7 +43,7 @@
...
@@ -39,7 +43,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintVertical_bias=
"
0.428
"
app:layout_constraintVertical_bias=
"
1.0
"
tools:srcCompat=
"@tools:sample/avatars"
/>
tools:srcCompat=
"@tools:sample/avatars"
/>
<Button
<Button
...
@@ -47,10 +51,40 @@
...
@@ -47,10 +51,40 @@
android:layout_width=
"124dp"
android:layout_width=
"124dp"
android:layout_height=
"42dp"
android:layout_height=
"42dp"
android:layout_marginTop=
"49dp"
android:layout_marginTop=
"49dp"
android:onClick=
"bookthis"
android:text=
"Book Now"
android:text=
"Book Now"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/thetext"
app:layout_constraintTop_toBottomOf=
"@+id/thetext"
app:layout_constraintVertical_bias=
"0.0"
/>
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>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/row_museum.xml
View file @
eda29815
...
@@ -17,11 +17,25 @@
...
@@ -17,11 +17,25 @@
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:layout_marginBottom=
"5dp"
android:textSize=
"18sp"
/>
android:textSize=
"18sp"
/>
<TextView
<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_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"description of each museum"
/>
android:text=
"description of each museum"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"2dp"
android:layout_height=
"2dp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment