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
41ac9e31
Commit
41ac9e31
authored
May 29, 2023
by
a-j.towse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working info display page
parent
87ff3eb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
8 deletions
+89
-8
performanceInfoPage.java
...va/com/example/no1theatrecompany/performanceInfoPage.java
+48
-4
performance_infopage.xml
app/src/main/res/layout/performance_infopage.xml
+41
-4
No files found.
app/src/main/java/com/example/no1theatrecompany/performanceInfoPage.java
View file @
41ac9e31
package
com
.
example
.
no1theatrecompany
;
package
com
.
example
.
no1theatrecompany
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
public
class
performanceInfoPage
extends
AppCompatActivity
{
public
class
performanceInfoPage
extends
AppCompatActivity
{
...
@@ -30,18 +33,59 @@ public class performanceInfoPage extends AppCompatActivity {
...
@@ -30,18 +33,59 @@ public class performanceInfoPage extends AppCompatActivity {
onBackPressed
();
onBackPressed
();
}
}
@SuppressLint
(
"SetTextI18n"
)
void
setInfo
(
String
performance
)
{
void
setInfo
(
String
performance
)
{
System
.
out
.
println
(
performance
);
TextView
nameTextView
=
(
TextView
)
findViewById
(
R
.
id
.
performanceTitle
);
TextView
nameTextView
=
(
TextView
)
findViewById
(
R
.
id
.
performanceTitle
);
TextView
dateTimeTextView
=
(
TextView
)
findViewById
(
R
.
id
.
dateTimetextView
);
TextView
dateTimeTextView
=
(
TextView
)
findViewById
(
R
.
id
.
dateTimetextView
);
TextView
venueTextView
=
(
TextView
)
findViewById
(
R
.
id
.
venuetextView
);
switch
(
performance
)
{
//Connect to DB
DBConnector
connector
=
new
DBConnector
(
this
,
null
);
ArrayList
performanceInfoList
=
connector
.
getPerformanceInfo
();
ArrayList
currentPerformance
=
null
;
for
(
int
i
=
0
;
i
<
performanceInfoList
.
size
();
i
++)
{
ArrayList
tempList
=
(
ArrayList
)
performanceInfoList
.
get
(
i
);
if
(
tempList
.
get
(
0
).
equals
(
performance
))
{
currentPerformance
=
(
ArrayList
)
tempList
;
break
;
}
}
nameTextView
.
setText
(
currentPerformance
.
get
(
0
).
toString
());
dateTimeTextView
.
setText
(
currentPerformance
.
get
(
1
).
toString
());
venueTextView
.
setText
((
currentPerformance
.
get
(
3
).
toString
()+
": "
+
currentPerformance
.
get
(
2
).
toString
()));
int
ticketTypeCount
=
0
;
//count the number of tickets types left
for
(
int
x
=
7
;
x
<
currentPerformance
.
size
();
x
++)
{
if
(
currentPerformance
.
get
(
x
)
!=
null
)
{
ticketTypeCount
+=
1
;
}
}
System
.
out
.
println
(
currentPerformance
);
/*switch (performance) {
case "The Tempest":
case "The Tempest":
nameTextView.setText("The Tempest");
nameTextView.setText("The Tempest");
case "A Midsummer Night's Dream by William Shakespeare":
case "A Midsummer Night's Dream by William Shakespeare":
nameTextView
.
setText
(
"A Midsummer Night's Dream by William Shakespeare"
);
nameTextView.setText(
currentPerformance.get(0).toString()
);
dateTimeTextView.setText("Saturday 3 June 2023, 19:00");
dateTimeTextView.setText("Saturday 3 June 2023, 19:00");
}
venueTextView.setText("Dean's Park, York");
for (int i = 0; i < performanceInfoList.size(); i++) {
final LinearLayout linearLayout = (LinearLayout) findViewById(R.id.bookTicketsLayout);
final TextView text = new TextView(this);
text.setText("Hello World");
linearLayout.addView(text);
}
}*/
}
}
}
}
app/src/main/res/layout/performance_infopage.xml
View file @
41ac9e31
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"@color/beigeWhite"
>
<Button
<Button
android:id=
"@+id/backBtn"
android:id=
"@+id/backBtn"
...
@@ -11,17 +12,22 @@
...
@@ -11,17 +12,22 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:text=
"Back"
android:onClick=
"backBtn"
android:onClick=
"backBtn"
android:text=
"Back"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/linearLayout2"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:backgroundTint=
"@color/beige"
android:baselineAligned=
"false"
android:dividerPadding=
"10dp"
android:foregroundTintMode=
"add"
android:orientation=
"vertical"
android:orientation=
"vertical"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -31,16 +37,47 @@
...
@@ -31,16 +37,47 @@
android:id=
"@+id/performanceTitle"
android:id=
"@+id/performanceTitle"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"40dp"
android:fontFamily=
"sans-serif"
android:fontFamily=
"sans-serif"
android:text=
"TextView"
android:text=
"TextView"
android:textAlignment=
"center"
android:textAlignment=
"center"
android:textSize=
"2
0
sp"
/>
android:textSize=
"2
8
sp"
/>
<TextView
<TextView
android:id=
"@+id/dateTimetextView"
android:id=
"@+id/dateTimetextView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"TextView"
/>
android:layout_marginBottom=
"10dp"
android:text=
"TextView"
android:textSize=
"20sp"
/>
<TextView
android:id=
"@+id/venuetextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:text=
"TextView"
android:textSize=
"20sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/bookTicketsLayout"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"20dp"
android:orientation=
"vertical"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/linearLayout2"
>
<TextView
android:id=
"@+id/textView5"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Book Tickets:"
/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</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