Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Theatre Booking App
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
a-j.towse
Theatre Booking App
Commits
b477125d
Commit
b477125d
authored
May 18, 2023
by
a-j.towse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working db performances list link
parent
f9ce8443
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
DBConnector.java
.../main/java/com/example/no1theatrecompany/DBConnector.java
+12
-5
MainActivity.java
...main/java/com/example/no1theatrecompany/MainActivity.java
+3
-4
No files found.
app/src/main/java/com/example/no1theatrecompany/DBConnector.java
View file @
b477125d
...
@@ -223,7 +223,7 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -223,7 +223,7 @@ public class DBConnector extends SQLiteOpenHelper {
public
ArrayList
getPerformanceInfo
()
{
public
ArrayList
getPerformanceInfo
()
{
ArrayList
<
ArrayList
<
String
>>
performanceInfoList
=
new
ArrayList
<
ArrayList
<
String
>
>();
ArrayList
<
ArrayList
<
String
>>
performanceInfoList
=
new
ArrayList
<>();
//Create query to select user from table
//Create query to select user from table
...
@@ -235,10 +235,17 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -235,10 +235,17 @@ public class DBConnector extends SQLiteOpenHelper {
//Execute query
//Execute query
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
int
playNum
=
cursor
.
getCount
();
String
info
;
for
(
int
i
=
0
;
i
<
playNum
;
i
++)
{
ArrayList
<
String
>
tempList
=
new
ArrayList
<>();
performanceInfoList
.
add
(
new
ArrayList
<
String
>());
performanceInfoList
.
get
(
i
).
add
(
cursor
.
getString
(
1
));
cursor
.
moveToFirst
();
for
(
int
i
=
0
;
i
<
cursor
.
getCount
();
i
++)
{
for
(
int
x
=
1
;
x
<
cursor
.
getColumnCount
();
x
++)
{
info
=
cursor
.
getString
(
x
);
tempList
.
add
(
info
);
}
performanceInfoList
.
add
(
tempList
);
cursor
.
moveToNext
();
}
}
//Close DB
//Close DB
...
...
app/src/main/java/com/example/no1theatrecompany/MainActivity.java
View file @
b477125d
...
@@ -29,7 +29,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -29,7 +29,7 @@ public class MainActivity extends AppCompatActivity {
TextView
usernameTextView
=
(
TextView
)
findViewById
(
R
.
id
.
usernameTextView
);
TextView
usernameTextView
=
(
TextView
)
findViewById
(
R
.
id
.
usernameTextView
);
usernameTextView
.
setText
(
currentUser
);
usernameTextView
.
setText
(
currentUser
);
/*
performanceList = new ArrayList<>();
performanceList
=
new
ArrayList
<>();
RecyclerView
recyclerObj
=
findViewById
(
R
.
id
.
performanceRecycler
);
RecyclerView
recyclerObj
=
findViewById
(
R
.
id
.
performanceRecycler
);
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
...
@@ -41,10 +41,9 @@ public class MainActivity extends AppCompatActivity {
...
@@ -41,10 +41,9 @@ public class MainActivity extends AppCompatActivity {
ArrayList
performanceInfoList
=
connector
.
getPerformanceInfo
();
ArrayList
performanceInfoList
=
connector
.
getPerformanceInfo
();
for
(
int
i
=
0
;
i
<
performanceInfoList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
performanceInfoList
.
size
();
i
++)
{
performanceList.add(performanceList.size(),
performanceList
.
add
(
i
,
new
IdleData
(
performanceInfoList
.
get
(
i
).
toString
()));
new IdleData(performanceInfoList.get(i).toString()));
this
.
adapter
.
notifyItemInserted
(
this
.
adapter
.
getItemCount
());
this
.
adapter
.
notifyItemInserted
(
this
.
adapter
.
getItemCount
());
}
*/
}
}
}
...
...
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