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
d216ed85
Commit
d216ed85
authored
May 05, 2021
by
lucy.hemingway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
third commit with museum list beginning
parent
c7d1892e
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
195 additions
and
1 deletion
+195
-1
build.gradle
app/build.gradle
+3
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
Adapter.java
app/src/main/java/com/example/appppppp/Adapter.java
+81
-0
DetailMuseums.java
app/src/main/java/com/example/appppppp/DetailMuseums.java
+4
-0
LogIn.java
app/src/main/java/com/example/appppppp/LogIn.java
+4
-0
MuseumList.java
app/src/main/java/com/example/appppppp/MuseumList.java
+42
-0
MuseumNames.java
app/src/main/java/com/example/appppppp/MuseumNames.java
+12
-0
british.jpg
app/src/main/res/drawable-v24/british.jpg
+0
-0
china.jpg
app/src/main/res/drawable-v24/china.jpg
+0
-0
metropolitan.jpg
app/src/main/res/drawable-v24/metropolitan.jpg
+0
-0
natural.jpg
app/src/main/res/drawable-v24/natural.jpg
+0
-0
tate.jpg
app/src/main/res/drawable-v24/tate.jpg
+0
-0
american.jpg
app/src/main/res/drawable/american.jpg
+0
-0
louvre.jpg
app/src/main/res/drawable/louvre.jpg
+0
-0
national.jpg
app/src/main/res/drawable/national.jpg
+0
-0
state.jpg
app/src/main/res/drawable/state.jpg
+0
-0
vatican.jpg
app/src/main/res/drawable/vatican.jpg
+0
-0
activity_log_in.xml
app/src/main/res/layout/activity_log_in.xml
+1
-0
activity_museum_list.xml
app/src/main/res/layout/activity_museum_list.xml
+17
-0
row_museum.xml
app/src/main/res/layout/row_museum.xml
+29
-0
No files found.
app/build.gradle
View file @
d216ed85
...
...
@@ -33,6 +33,9 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'com.google.android.material:material:1.3.0'
implementation
'androidx.constraintlayout:constraintlayout:2.0.4'
implementation
'com.android.support:recyclerview-v7:28.0.0'
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
...
...
app/src/main/AndroidManifest.xml
View file @
d216ed85
...
...
@@ -9,7 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.APPPPPpp"
>
<activity
android:name=
".HelpPage"
></activity>
<activity
android:name=
".MuseumList"
></activity>
<activity
android:name=
".HelpPage"
/>
<activity
android:name=
".Register"
/>
<activity
android:name=
".LogIn"
/>
<activity
android:name=
".MainMenu"
>
...
...
app/src/main/java/com/example/appppppp/Adapter.java
0 → 100644
View file @
d216ed85
package
com
.
example
.
appppppp
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.util.ArrayList
;
import
java.util.List
;
class
adapter
extends
RecyclerView
.
Adapter
<
adapter
.
ViewHolder
>
{
private
List
<
MuseumNames
>
myMuseums
;
private
LayoutInflater
myInflater
;
// pass the data list into the constructor
adapter
(
Context
context
,
ArrayList
<
MuseumNames
>
data
){
this
.
myInflater
=
LayoutInflater
.
from
(
context
);
this
.
myMuseums
=
data
;
}
// inflate the row from xml when needed
@Override
public
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
View
view
=
myInflater
.
inflate
(
R
.
layout
.
row_museum
,
parent
,
false
);
return
new
ViewHolder
(
view
);
}
// binding the data to the provided textview in the created custom view
@Override
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
String
names
=
myMuseums
.
get
(
position
).
name
;
//modified
String
descriptions
=
myMuseums
.
get
(
position
).
desc
;
//modified
holder
.
MuseumText
.
setText
(
names
);
holder
.
DescriptionText
.
setText
(
descriptions
);
holder
.
MuseumText
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
v
.
getContext
(),
MuseumNames
.
class
);
intent
.
putExtra
(
"selectedFruit"
,
myMuseums
.
get
(
position
).
name
);
v
.
getContext
().
startActivity
(
intent
);
}
});
}
// get total items of the data
@Override
public
int
getItemCount
()
{
return
myMuseums
.
size
();
}
// create and retrieve the data as the user scrolls the list
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
TextView
MuseumText
;
TextView
DescriptionText
;
//add
ViewHolder
(
View
v
){
super
(
v
);
MuseumText
=
itemView
.
findViewById
(
R
.
id
.
MuseumText
);
DescriptionText
=
itemView
.
findViewById
(
R
.
id
.
DescriptionText
);
//add
}
}
}
\ No newline at end of file
app/src/main/java/com/example/appppppp/DetailMuseums.java
0 → 100644
View file @
d216ed85
package
com
.
example
.
appppppp
;
public
class
DetailMuseums
{
}
app/src/main/java/com/example/appppppp/LogIn.java
View file @
d216ed85
...
...
@@ -17,4 +17,8 @@ public class LogIn extends AppCompatActivity {
Intent
back
=
new
Intent
(
this
,
MainMenu
.
class
);
startActivity
(
back
);
}
public
void
toMuseums
(
View
V
){
Intent
back
=
new
Intent
(
this
,
MuseumList
.
class
);
startActivity
(
back
);
}
}
\ No newline at end of file
app/src/main/java/com/example/appppppp/MuseumList.java
0 → 100644
View file @
d216ed85
package
com
.
example
.
appppppp
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.os.Bundle
;
import
java.util.ArrayList
;
public
class
MuseumList
extends
AppCompatActivity
{
//create private parameters
adapter
adapterObj
;
ArrayList
<
MuseumNames
>
dataList
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_museum_list
);
// data to populate the recyclerview with
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 "
));
// set up the recyclerview
RecyclerView
recyclerObj
=
findViewById
(
R
.
id
.
recyclerID
);
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
adapterObj
=
new
adapter
(
this
,
dataList
);
recyclerObj
.
setAdapter
(
adapterObj
);
}
}
\ No newline at end of file
app/src/main/java/com/example/appppppp/MuseumNames.java
0 → 100644
View file @
d216ed85
package
com
.
example
.
appppppp
;
public
class
MuseumNames
{
String
name
;
String
desc
;
MuseumNames
(
String
n
,
String
d
){
name
=
n
;
desc
=
d
;
}
}
app/src/main/res/drawable-v24/british.jpg
0 → 100644
View file @
d216ed85
591 KB
app/src/main/res/drawable-v24/china.jpg
0 → 100644
View file @
d216ed85
395 KB
app/src/main/res/drawable-v24/metropolitan.jpg
0 → 100644
View file @
d216ed85
91.3 KB
app/src/main/res/drawable-v24/natural.jpg
0 → 100644
View file @
d216ed85
237 KB
app/src/main/res/drawable-v24/tate.jpg
0 → 100644
View file @
d216ed85
64.9 KB
app/src/main/res/drawable/american.jpg
0 → 100644
View file @
d216ed85
77.6 KB
app/src/main/res/drawable/louvre.jpg
0 → 100644
View file @
d216ed85
This diff is collapsed.
Click to expand it.
app/src/main/res/drawable/national.jpg
0 → 100644
View file @
d216ed85
142 KB
app/src/main/res/drawable/state.jpg
0 → 100644
View file @
d216ed85
144 KB
app/src/main/res/drawable/vatican.jpg
0 → 100644
View file @
d216ed85
297 KB
app/src/main/res/layout/activity_log_in.xml
View file @
d216ed85
...
...
@@ -11,6 +11,7 @@
android:layout_width=
"126dp"
android:layout_height=
"41dp"
android:layout_marginBottom=
"328dp"
android:onClick=
"toMuseums"
android:text=
"Enter"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
app/src/main/res/layout/activity_museum_list.xml
0 → 100644
View file @
d216ed85
<?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=
".MuseumList"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recyclerID"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:layout_editor_absoluteX=
"263dp"
tools:layout_editor_absoluteY=
"336dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/row_museum.xml
0 → 100644
View file @
d216ed85
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"5dp"
android:layout_marginTop=
"5dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/MuseumText"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignWithParentIfMissing=
"true"
android:gravity=
"center_vertical"
android:text=
"Line1"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/DescriptionText"
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"
android:background=
"#CCCCCC"
/>
</LinearLayout>
\ 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