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
b5891779
Commit
b5891779
authored
May 06, 2021
by
lucy.hemingway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4th with museum details
parent
d216ed85
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
14 deletions
+159
-14
gradle.xml
.idea/gradle.xml
+1
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
Adapter.java
app/src/main/java/com/example/appppppp/Adapter.java
+8
-6
DetailMuseums.java
app/src/main/java/com/example/appppppp/DetailMuseums.java
+45
-1
MuseumList.java
app/src/main/java/com/example/appppppp/MuseumList.java
+10
-6
fulldetails.java
app/src/main/java/com/example/appppppp/fulldetails.java
+49
-0
activity_fulldetails.xml
app/src/main/res/layout/activity_fulldetails.xml
+44
-0
No files found.
.idea/gradle.xml
View file @
b5891779
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleMigrationSettings"
migrationVersion=
"1"
/>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
...
...
app/src/main/AndroidManifest.xml
View file @
b5891779
...
...
@@ -9,7 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.APPPPPpp"
>
<activity
android:name=
".MuseumList"
></activity>
<activity
android:name=
".fulldetails"
></activity>
<activity
android:name=
".MuseumList"
/>
<activity
android:name=
".HelpPage"
/>
<activity
android:name=
".Register"
/>
<activity
android:name=
".LogIn"
/>
...
...
app/src/main/java/com/example/appppppp/Adapter.java
View file @
b5891779
...
...
@@ -18,6 +18,7 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
private
List
<
MuseumNames
>
myMuseums
;
private
LayoutInflater
myInflater
;
Context
myContext
;
// pass the data list into the constructor
adapter
(
Context
context
,
ArrayList
<
MuseumNames
>
data
){
...
...
@@ -40,17 +41,17 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
@Override
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
String
name
s
=
myMuseums
.
get
(
position
).
name
;
//modified
String
desc
riptions
=
myMuseums
.
get
(
position
).
desc
;
//modified
holder
.
MuseumText
.
setText
(
name
s
);
holder
.
DescriptionText
.
setText
(
desc
riptions
);
String
name
=
myMuseums
.
get
(
position
).
name
;
//modified
String
desc
=
myMuseums
.
get
(
position
).
desc
;
//modified
holder
.
MuseumText
.
setText
(
name
);
holder
.
DescriptionText
.
setText
(
desc
);
holder
.
MuseumText
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
v
.
getContext
(),
MuseumName
s
.
class
);
intent
.
putExtra
(
"selected
Fruit
"
,
myMuseums
.
get
(
position
).
name
);
Intent
intent
=
new
Intent
(
v
.
getContext
(),
fulldetail
s
.
class
);
intent
.
putExtra
(
"selected
Museum
"
,
myMuseums
.
get
(
position
).
name
);
v
.
getContext
().
startActivity
(
intent
);
}
...
...
@@ -71,6 +72,7 @@ class adapter extends RecyclerView.Adapter<adapter.ViewHolder> {
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
TextView
MuseumText
;
TextView
DescriptionText
;
//add
ViewHolder
(
View
v
){
super
(
v
);
MuseumText
=
itemView
.
findViewById
(
R
.
id
.
MuseumText
);
...
...
app/src/main/java/com/example/appppppp/DetailMuseums.java
View file @
b5891779
package
com
.
example
.
appppppp
;
public
class
DetailMuseums
{
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
DetailMuseums
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
){
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_fulldetails
);
Intent
intent
=
getIntent
();
String
selectedMuseum
=
intent
.
getStringExtra
(
"selectedMuseum"
);
((
TextView
)
findViewById
(
R
.
id
.
check
)).
setText
(
selectedMuseum
);
//setDetail(selectedMuseum);
}
/* void setDetail(String s){
switch(s) {
case "Louvre":
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.louvre);
((TextView)findViewById(R.id.thetext)).setText( "The Louvre asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
break;
case "National Museum of China":
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.china);
((TextView)findViewById(R.id.thetext)).setText( "China asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
break;
case "Vatican Museums":
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.vatican);
((TextView)findViewById(R.id.thetext)).setText( "Vatican d jka ");
break;
case "Metropolitan Museum of Art":
((ImageView)findViewById(R.id.theimage)).setImageResource(R.drawable.metropolitan);
((TextView)findViewById(R.id.thetext)).setText( "The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka ");
break;
default:
((TextView)findViewById(R.id.thetext)).setText("Not Added");
break;
}
} */
}
app/src/main/java/com/example/appppppp/MuseumList.java
View file @
b5891779
...
...
@@ -24,12 +24,16 @@ public class MuseumList extends AppCompatActivity {
dataList
=
new
ArrayList
<>();
dataList
.
add
(
new
MuseumNames
(
"Apple"
,
"An apple is an edible fruit produced by an apple tree."
));
dataList
.
add
(
new
MuseumNames
(
"Pear"
,
"Pears are sweet, bell-shaped fruits that have been enjoyed since ancient times."
));
dataList
.
add
(
new
MuseumNames
(
"Pineapple"
,
"description "
));
dataList
.
add
(
new
MuseumNames
(
"Kiwi"
,
"description "
));
dataList
.
add
(
new
MuseumNames
(
"Banana"
,
"description "
));
dataList
.
add
(
new
MuseumNames
(
"Watermelon"
,
"description "
));
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 "
));
// set up the recyclerview
...
...
app/src/main/java/com/example/appppppp/fulldetails.java
0 → 100644
View file @
b5891779
package
com
.
example
.
appppppp
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
public
class
fulldetails
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_fulldetails
);
Intent
intent
=
getIntent
();
String
selectedMuseum
=
intent
.
getStringExtra
(
"selectedMuseum"
);
((
TextView
)
findViewById
(
R
.
id
.
check
)).
setText
(
selectedMuseum
);
setDetail
(
selectedMuseum
);
}
void
setDetail
(
String
s
){
switch
(
s
)
{
case
"Louvre"
:
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
louvre
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The Louvre asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"National Museum of China"
:
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
china
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"China asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"Vatican Museums"
:
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
vatican
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"Vatican d jka "
);
break
;
case
"Metropolitan Museum of Art"
:
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
metropolitan
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
default
:
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"Not Added"
);
break
;
}
}
}
app/src/main/res/layout/activity_fulldetails.xml
0 → 100644
View file @
b5891779
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".fulldetails"
>
<TextView
android:id=
"@+id/check"
android:layout_width=
"291dp"
android:layout_height=
"36dp"
android:text=
"TextView"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.023"
/>
<EditText
android:id=
"@+id/thetext"
android:layout_width=
"292dp"
android:layout_height=
"225dp"
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_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintVertical_bias=
"0.495"
/>
<ImageView
android:id=
"@+id/theimage"
android:layout_width=
"189dp"
android:layout_height=
"162dp"
app:layout_constraintBottom_toTopOf=
"@+id/thetext"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintVertical_bias=
"0.428"
tools:srcCompat=
"@tools:sample/avatars"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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