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
0ccd2f7a
Commit
0ccd2f7a
authored
May 28, 2023
by
austin.blanke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More Info Page in Progress
parent
824f7047
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
17 deletions
+61
-17
DatabaseConnector.java
...om/example/bookingapp_austinblanke/DatabaseConnector.java
+15
-3
MoreInfoActivity.java
...com/example/bookingapp_austinblanke/MoreInfoActivity.java
+18
-0
adapter.java
...ain/java/com/example/bookingapp_austinblanke/adapter.java
+16
-2
moreinfo.xml
app/src/main/res/layout/moreinfo.xml
+6
-0
performance.xml
app/src/main/res/layout/performance.xml
+6
-12
No files found.
app/src/main/java/com/example/bookingapp_austinblanke/DatabaseConnector.java
View file @
0ccd2f7a
...
@@ -212,9 +212,21 @@ public class DatabaseConnector extends SQLiteOpenHelper {
...
@@ -212,9 +212,21 @@ public class DatabaseConnector extends SQLiteOpenHelper {
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
cursor
.
moveToFirst
();
cursor
.
moveToFirst
();
for
(
int
i
=
0
;
i
<
cursor
.
getCount
();
i
++){
for
(
int
i
=
0
;
i
<
cursor
.
getCount
();
i
++){
if
(
filter1
&&
filter2
&&
filter3
)
if
(
filter1
)
{
if
(
cursor
.
getString
(
5
).
equals
(
"false"
)
&&
cursor
.
getString
(
5
).
equals
(
"true"
)
&&
cursor
.
getString
(
5
).
equals
(
"false"
)){
if
(
cursor
.
getString
(
5
).
equals
(
"false"
))
{
performances
.
add
(
cursor
.
getString
(
1
));
performances
.
add
(
cursor
.
getString
(
1
));
}
}
else
if
(
filter2
)
{
if
(
cursor
.
getString
(
6
).
equals
(
"true"
))
{
performances
.
add
(
cursor
.
getString
(
1
));
}
}
else
if
(
filter3
)
{
if
(
cursor
.
getString
(
7
).
equals
(
"false"
))
{
performances
.
add
(
cursor
.
getString
(
1
));
}
}
else
{
performances
.
add
(
cursor
.
getString
(
1
));}
//No filter present
else
{
performances
.
add
(
cursor
.
getString
(
1
));}
//No filter present
cursor
.
moveToNext
();
cursor
.
moveToNext
();
}
}
...
...
app/src/main/java/com/example/bookingapp_austinblanke/MoreInfoActivity.java
0 → 100644
View file @
0ccd2f7a
package
com
.
example
.
bookingapp_austinblanke
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
MoreInfoActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
moreinfo
);
Intent
intent
=
getIntent
();
String
name
=
intent
.
getStringExtra
(
"name"
);
}
}
app/src/main/java/com/example/bookingapp_austinblanke/adapter.java
View file @
0ccd2f7a
package
com
.
example
.
bookingapp_austinblanke
;
package
com
.
example
.
bookingapp_austinblanke
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
...
@@ -14,6 +17,7 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
...
@@ -14,6 +17,7 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
private
List
<
String
>
mData
;
private
List
<
String
>
mData
;
private
LayoutInflater
mInflater
;
private
LayoutInflater
mInflater
;
Context
context
;
adapter
(
Context
context
,
List
<
String
>
data
){
adapter
(
Context
context
,
List
<
String
>
data
){
this
.
mInflater
=
LayoutInflater
.
from
(
context
);
this
.
mInflater
=
LayoutInflater
.
from
(
context
);
...
@@ -22,7 +26,7 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
...
@@ -22,7 +26,7 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
@Override
@Override
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
){
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
){
View
view
=
mInflater
.
inflate
(
R
.
layout
.
performance
,
parent
,
false
);
View
view
=
mInflater
.
inflate
(
R
.
layout
.
performance
,
parent
,
false
);
return
new
ViewHolder
(
view
);
return
new
ViewHolder
(
view
);
}
}
...
@@ -30,6 +34,7 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
...
@@ -30,6 +34,7 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
String
name
=
mData
.
get
(
position
);
String
name
=
mData
.
get
(
position
);
holder
.
myTextView
.
setText
(
name
);
holder
.
myTextView
.
setText
(
name
);
}
}
@Override
@Override
...
@@ -37,12 +42,21 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
...
@@ -37,12 +42,21 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
return
mData
.
size
();
return
mData
.
size
();
}
}
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
implements
View
.
OnClickListener
{
TextView
myTextView
;
TextView
myTextView
;
ViewHolder
(
View
v
){
ViewHolder
(
View
v
){
super
(
v
);
super
(
v
);
myTextView
=
itemView
.
findViewById
(
R
.
id
.
performance
);
myTextView
=
itemView
.
findViewById
(
R
.
id
.
performance
);
itemView
.
setOnClickListener
(
this
);
}
@Override
public
void
onClick
(
View
view
)
{
int
position
=
getAdapterPosition
();
Intent
intent
=
new
Intent
(
context
,
MoreInfoActivity
.
class
);
intent
.
putExtra
(
"name"
,
mData
.
get
(
position
));
context
.
startActivity
(
intent
);
}
}
}
}
...
...
app/src/main/res/layout/moreinfo.xml
0 → 100644
View file @
0ccd2f7a
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/performance.xml
View file @
0ccd2f7a
...
@@ -9,15 +9,15 @@
...
@@ -9,15 +9,15 @@
<TextView
<TextView
android:id=
"@+id/performance"
android:id=
"@+id/performance"
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"66dp"
android:layout_alignParentRight=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignWithParentIfMissing=
"true"
android:layout_alignWithParentIfMissing=
"true"
android:
gravity=
"center_vertical
"
android:
layout_alignParentTop=
"true
"
android:
text=
"Line 1
"
android:
layout_alignParentRight=
"true
"
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:layout_marginBottom=
"5dp"
android:textSize=
"18sp"
/>
android:gravity=
"center_vertical"
android:text=
"Line 1"
android:textSize=
"24sp"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -25,11 +25,5 @@
...
@@ -25,11 +25,5 @@
android:background=
"#CCCCCC"
android:background=
"#CCCCCC"
/>
/>
<Button
android:id=
"@+id/moreInfo"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"moreInfo"
/>
</LinearLayout>
</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