Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Booking App COM5007
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
austin.blanke
Booking App COM5007
Commits
e5419a99
Commit
e5419a99
authored
May 28, 2023
by
austin.blanke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working Recycler View
parent
97555dfb
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
107 deletions
+98
-107
MainActivity.java
...ava/com/example/bookingapp_austinblanke/MainActivity.java
+13
-11
MyAdapter.java
...n/java/com/example/bookingapp_austinblanke/MyAdapter.java
+0
-39
MyViewHolder.java
...ava/com/example/bookingapp_austinblanke/MyViewHolder.java
+0
-16
adapter.java
...ain/java/com/example/bookingapp_austinblanke/adapter.java
+49
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+6
-10
performace.xml
app/src/main/res/layout/performace.xml
+0
-31
performance.xml
app/src/main/res/layout/performance.xml
+30
-0
No files found.
app/src/main/java/com/example/bookingapp_austinblanke/MainActivity.java
View file @
e5419a99
...
@@ -16,23 +16,25 @@ import java.util.ArrayList;
...
@@ -16,23 +16,25 @@ import java.util.ArrayList;
public
class
MainActivity
extends
AppCompatActivity
{
public
class
MainActivity
extends
AppCompatActivity
{
adapter
adapterObj
;
ArrayList
<
String
>
dataList
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
setContentView
(
R
.
layout
.
activity_main
);
Bundle
loginBundle
=
getIntent
().
getExtras
();
dataList
=
new
ArrayList
<>();
String
currentUser
=
loginBundle
.
getString
(
"currentUser"
);
dataList
.
add
(
"Test1"
);
dataList
.
add
(
"Test2"
);
TextView
username
=
(
TextView
)
findViewById
(
R
.
id
.
Username
);
dataList
.
add
(
"Test3"
);
username
.
setText
(
currentUser
);
dataList
.
add
(
"Test4"
);
dataList
.
add
(
"Test5"
);
performanceList
=
new
ArrayList
<>();
RecyclerView
recyclerObj
=
findViewById
(
R
.
id
.
performances
);
RecyclerView
recyclerObj
=
findViewById
(
R
.
id
.
performanceRecycler
);
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
adapter
=
new
performanceRecAdapter
(
this
,
performanceList
);
adapterObj
=
new
adapter
(
this
,
dataList
);
recyclerObj
.
setAdapter
(
adapter
);
recyclerObj
.
setAdapter
(
adapterObj
);
}
}
}
}
\ No newline at end of file
app/src/main/java/com/example/bookingapp_austinblanke/MyAdapter.java
deleted
100644 → 0
View file @
97555dfb
package
com
.
example
.
bookingapp_austinblanke
;
import
android.content.Context
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.util.ArrayList
;
public
class
MyAdapter
extends
RecyclerView
.
Adapter
<
MyViewHolder
>
{
private
Context
context
;
private
ArrayList
name_id
;
public
MyAdapter
(
Context
context
,
ArrayList
name_id
)
{
this
.
context
=
context
;
this
.
name_id
=
name_id
;
}
@NonNull
@Override
public
MyViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
View
v
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
performance
,
parent
,
false
);
return
new
MyViewHolder
(
v
);
}
@Override
public
void
onBindViewHolder
(
@NonNull
MyViewHolder
holder
,
int
position
)
{
}
@Override
public
int
getItemCount
()
{
return
0
;
}
}
app/src/main/java/com/example/bookingapp_austinblanke/MyViewHolder.java
deleted
100644 → 0
View file @
97555dfb
package
com
.
example
.
bookingapp_austinblanke
;
import
android.view.View
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
public
class
MyViewHolder
extends
RecyclerView
.
ViewHolder
{
TextView
name
;
public
MyViewHolder
(
@NonNull
View
itemView
)
{
super
(
itemView
);
}
}
app/src/main/java/com/example/bookingapp_austinblanke/adapter.java
0 → 100644
View file @
e5419a99
package
com
.
example
.
bookingapp_austinblanke
;
import
android.content.Context
;
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.List
;
public
class
adapter
extends
RecyclerView
.
Adapter
<
adapter
.
ViewHolder
>{
private
List
<
String
>
mData
;
private
LayoutInflater
mInflater
;
adapter
(
Context
context
,
List
<
String
>
data
){
this
.
mInflater
=
LayoutInflater
.
from
(
context
);
this
.
mData
=
data
;
}
@Override
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
){
View
view
=
mInflater
.
inflate
(
R
.
layout
.
performance
,
parent
,
false
);
return
new
ViewHolder
(
view
);
}
@Override
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
String
name
=
mData
.
get
(
position
);
holder
.
myTextView
.
setText
(
name
);
}
@Override
public
int
getItemCount
()
{
return
mData
.
size
();
}
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
TextView
myTextView
;
ViewHolder
(
View
v
){
super
(
v
);
myTextView
=
itemView
.
findViewById
(
R
.
id
.
performance
);
}
}
}
app/src/main/res/layout/activity_main.xml
View file @
e5419a99
...
@@ -7,17 +7,13 @@
...
@@ -7,17 +7,13 @@
android:background=
"#F2F1E8"
android:background=
"#F2F1E8"
tools:context=
".MainActivity"
>
tools:context=
".MainActivity"
>
<TextView
android:id=
"@+id/textView"
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"wrap_content"
android:id=
"@+id/performances"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:background=
"#00050533"
android:layout_height=
"match_parent"
android:text=
"Shows"
android:textAppearance=
"@style/TextAppearance.AppCompat.Display1"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
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.199"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/performace.xml
deleted
100644 → 0
View file @
97555dfb
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:cardElevation=
"12dp"
android:cardCornerRadius=
"16dp"
android:layout_margin=
"16dp"
android:backgroundTint=
"#efefef"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_gravity=
"center_vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
androidtext=
"Performance"
android
</LinearLayout
>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
app/src/main/res/layout/performance.xml
0 → 100644
View file @
e5419a99
<?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/performance"
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=
"Line 1"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:textSize=
"18sp"
/>
<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