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
713ef004
Commit
713ef004
authored
May 29, 2023
by
a-j.towse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working ticket number selector
parent
41ac9e31
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
37 deletions
+94
-37
build.gradle
app/build.gradle
+1
-1
DBConnector.java
.../main/java/com/example/no1theatrecompany/DBConnector.java
+11
-11
performanceInfoPage.java
...va/com/example/no1theatrecompany/performanceInfoPage.java
+37
-20
performance_infopage.xml
app/src/main/res/layout/performance_infopage.xml
+45
-5
No files found.
app/build.gradle
View file @
713ef004
...
@@ -8,7 +8,7 @@ android {
...
@@ -8,7 +8,7 @@ android {
defaultConfig
{
defaultConfig
{
applicationId
"com.example.no1theatrecompany"
applicationId
"com.example.no1theatrecompany"
minSdk
25
minSdk
30
targetSdk
33
targetSdk
33
versionCode
1
versionCode
1
versionName
"1.0"
versionName
"1.0"
...
...
app/src/main/java/com/example/no1theatrecompany/DBConnector.java
View file @
713ef004
...
@@ -91,7 +91,7 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -91,7 +91,7 @@ public class DBConnector extends SQLiteOpenHelper {
play1
.
put
(
COLUMN_TIME
,
"20:00"
);
play1
.
put
(
COLUMN_TIME
,
"20:00"
);
play1
.
put
(
COLUMN_VENUE
,
"Merchant Adventurer's Hall, York"
);
play1
.
put
(
COLUMN_VENUE
,
"Merchant Adventurer's Hall, York"
);
play1
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play1
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play1
.
put
(
COLUMN_TIXSEAT
,
"17,8"
);
play1
.
put
(
COLUMN_TIXSEAT
,
"17,8
,Seated
"
);
ContentValues
play2
=
new
ContentValues
();
//Create new row object
ContentValues
play2
=
new
ContentValues
();
//Create new row object
play2
.
put
(
COLUMN_NAME
,
"Hamlet by William Shakespeare"
);
play2
.
put
(
COLUMN_NAME
,
"Hamlet by William Shakespeare"
);
...
@@ -100,7 +100,7 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -100,7 +100,7 @@ public class DBConnector extends SQLiteOpenHelper {
play2
.
put
(
COLUMN_VENUE
,
"Clifford's Tower, York"
);
play2
.
put
(
COLUMN_VENUE
,
"Clifford's Tower, York"
);
play2
.
put
(
COLUMN_FLASH
,
"true"
);
play2
.
put
(
COLUMN_FLASH
,
"true"
);
play2
.
put
(
COLUMN_STEPS
,
"true"
);
play2
.
put
(
COLUMN_STEPS
,
"true"
);
play2
.
put
(
COLUMN_TIXSEAT
,
"8,8"
);
play2
.
put
(
COLUMN_TIXSEAT
,
"8,8
,Seated
"
);
ContentValues
play3
=
new
ContentValues
();
//Create new row object
ContentValues
play3
=
new
ContentValues
();
//Create new row object
play3
.
put
(
COLUMN_NAME
,
"A Midsummer Night's Dream by William Shakespeare"
);
play3
.
put
(
COLUMN_NAME
,
"A Midsummer Night's Dream by William Shakespeare"
);
...
@@ -109,8 +109,8 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -109,8 +109,8 @@ public class DBConnector extends SQLiteOpenHelper {
play3
.
put
(
COLUMN_VENUE
,
"Dean's Park, York"
);
play3
.
put
(
COLUMN_VENUE
,
"Dean's Park, York"
);
play3
.
put
(
COLUMN_FLASH
,
"true"
);
play3
.
put
(
COLUMN_FLASH
,
"true"
);
play3
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play3
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play3
.
put
(
COLUMN_TIXSTAGE
,
"11,4"
);
play3
.
put
(
COLUMN_TIXSTAGE
,
"11,4
,Stage
"
);
play3
.
put
(
COLUMN_TIXGRASS
,
"29,4"
);
play3
.
put
(
COLUMN_TIXGRASS
,
"29,4
,Grass
"
);
ContentValues
play4
=
new
ContentValues
();
//Create new row object
ContentValues
play4
=
new
ContentValues
();
//Create new row object
play4
.
put
(
COLUMN_NAME
,
"Oedipus the King by Sophocles"
);
play4
.
put
(
COLUMN_NAME
,
"Oedipus the King by Sophocles"
);
...
@@ -118,8 +118,8 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -118,8 +118,8 @@ public class DBConnector extends SQLiteOpenHelper {
play4
.
put
(
COLUMN_TIME
,
"20:00"
);
play4
.
put
(
COLUMN_TIME
,
"20:00"
);
play4
.
put
(
COLUMN_VENUE
,
"St Mary's Abbey, Museum Gardens, York"
);
play4
.
put
(
COLUMN_VENUE
,
"St Mary's Abbey, Museum Gardens, York"
);
play4
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play4
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play4
.
put
(
COLUMN_TIXSEAT
,
"5,9"
);
play4
.
put
(
COLUMN_TIXSEAT
,
"5,9
,Seat
"
);
play4
.
put
(
COLUMN_TIXSTAND
,
"12,7"
);
play4
.
put
(
COLUMN_TIXSTAND
,
"12,7
,Stand
"
);
ContentValues
play5
=
new
ContentValues
();
//Create new row object
ContentValues
play5
=
new
ContentValues
();
//Create new row object
play5
.
put
(
COLUMN_NAME
,
"The Tempest by William Shakespeare"
);
play5
.
put
(
COLUMN_NAME
,
"The Tempest by William Shakespeare"
);
...
@@ -127,8 +127,8 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -127,8 +127,8 @@ public class DBConnector extends SQLiteOpenHelper {
play5
.
put
(
COLUMN_TIME
,
"14:00"
);
play5
.
put
(
COLUMN_TIME
,
"14:00"
);
play5
.
put
(
COLUMN_VENUE
,
"Millennium Bridge, York"
);
play5
.
put
(
COLUMN_VENUE
,
"Millennium Bridge, York"
);
play5
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play5
.
put
(
COLUMN_WHEELACCESS
,
"true"
);
play5
.
put
(
COLUMN_TIXBOATA
,
"6,9"
);
play5
.
put
(
COLUMN_TIXBOATA
,
"6,9
,Boat A
"
);
play5
.
put
(
COLUMN_TIXRIVERBANK
,
"10,7"
);
play5
.
put
(
COLUMN_TIXRIVERBANK
,
"10,7
,Riverbank
"
);
ContentValues
play6
=
new
ContentValues
();
//Create new row object
ContentValues
play6
=
new
ContentValues
();
//Create new row object
play6
.
put
(
COLUMN_NAME
,
"Antigone by Sophocles"
);
play6
.
put
(
COLUMN_NAME
,
"Antigone by Sophocles"
);
...
@@ -136,9 +136,9 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -136,9 +136,9 @@ public class DBConnector extends SQLiteOpenHelper {
play6
.
put
(
COLUMN_TIME
,
"21:00"
);
play6
.
put
(
COLUMN_TIME
,
"21:00"
);
play6
.
put
(
COLUMN_VENUE
,
"Crypt, York Minster, York"
);
play6
.
put
(
COLUMN_VENUE
,
"Crypt, York Minster, York"
);
play6
.
put
(
COLUMN_STEPS
,
"true"
);
play6
.
put
(
COLUMN_STEPS
,
"true"
);
play6
.
put
(
COLUMN_TIXINCIRC
,
"5,16"
);
play6
.
put
(
COLUMN_TIXINCIRC
,
"5,16
,Inner Circle
"
);
play6
.
put
(
COLUMN_TIXOUTCIRC
,
"8,13"
);
play6
.
put
(
COLUMN_TIXOUTCIRC
,
"8,13
,Outer Circle
"
);
play6
.
put
(
COLUMN_TIXSTAND
,
"10,10"
);
play6
.
put
(
COLUMN_TIXSTAND
,
"10,10
,Standing
"
);
db
.
insert
(
TABLE_PERFORMANCES
,
null
,
play1
);
//Store play details
db
.
insert
(
TABLE_PERFORMANCES
,
null
,
play1
);
//Store play details
db
.
insert
(
TABLE_PERFORMANCES
,
null
,
play2
);
//Store play details
db
.
insert
(
TABLE_PERFORMANCES
,
null
,
play2
);
//Store play details
...
...
app/src/main/java/com/example/no1theatrecompany/performanceInfoPage.java
View file @
713ef004
package
com
.
example
.
no1theatrecompany
;
package
com
.
example
.
no1theatrecompany
;
import
static
android
.
text
.
InputType
.
TYPE_CLASS_NUMBER
;
import
android.annotation.SuppressLint
;
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.text.InputType
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.NumberPicker
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
...
@@ -64,28 +71,38 @@ public class performanceInfoPage extends AppCompatActivity {
...
@@ -64,28 +71,38 @@ public class performanceInfoPage extends AppCompatActivity {
for
(
int
x
=
7
;
x
<
currentPerformance
.
size
();
x
++)
{
for
(
int
x
=
7
;
x
<
currentPerformance
.
size
();
x
++)
{
if
(
currentPerformance
.
get
(
x
)
!=
null
)
{
if
(
currentPerformance
.
get
(
x
)
!=
null
)
{
ticketTypeCount
+=
1
;
ticketTypeCount
+=
1
;
String
unSplitItem
=
currentPerformance
.
get
(
x
).
toString
();
System
.
out
.
println
(
currentPerformance
.
get
(
x
));
String
[]
splitItems
=
unSplitItem
.
split
(
","
,
0
);
//String num = unSplitItem.substring(0,unSplitItem.indexOf(","));
//String price = unSplitItem.substring(1,unSplitItem.indexOf(","));
//String name = unSplitItem.substring(2,unSplitItem.indexOf(","));
final
LinearLayout
linearLayout
=
(
LinearLayout
)
findViewById
(
R
.
id
.
bookTicketsLayout
);
final
TextView
text
=
new
TextView
(
this
);
text
.
setText
(
splitItems
[
2
]+
": £"
+
splitItems
[
1
]);
text
.
setTextSize
(
18
);
text
.
setPadding
(
0
,
0
,
0
,
15
);
linearLayout
.
addView
(
text
);
final
LinearLayout
linearLayout2
=
(
LinearLayout
)
findViewById
(
R
.
id
.
bookTicketsLayout2
);
final
TextView
text2
=
new
TextView
(
this
);
text2
.
setText
(
"Available: "
+
splitItems
[
0
]);
text2
.
setTextSize
(
18
);
text2
.
setPadding
(
0
,
0
,
0
,
15
);
linearLayout2
.
addView
(
text2
);
final
LinearLayout
linearLayout3
=
(
LinearLayout
)
findViewById
(
R
.
id
.
bookTicketsLayout3
);
final
EditText
numSelect
=
new
EditText
(
this
);
numSelect
.
setPadding
(
0
,
0
,
0
,
15
);
numSelect
.
setMinimumWidth
(
40
);
numSelect
.
setRawInputType
(
TYPE_CLASS_NUMBER
);
numSelect
.
setMaxLines
(
1
);
numSelect
.
setGravity
(
Gravity
.
CENTER
);
linearLayout3
.
addView
(
numSelect
);
}
}
}
}
System
.
out
.
println
(
currentPerformance
);
/*switch (performance) {
case "The Tempest":
nameTextView.setText("The Tempest");
case "A Midsummer Night's Dream by William Shakespeare":
nameTextView.setText(currentPerformance.get(0).toString());
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 @
713ef004
...
@@ -6,6 +6,26 @@
...
@@ -6,6 +6,26 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/beigeWhite"
>
android:background=
"@color/beigeWhite"
>
<LinearLayout
android:id=
"@+id/bookTicketsLayout2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginTop=
"20dp"
android:gravity=
"left"
android:orientation=
"vertical"
app:layout_constraintStart_toEndOf=
"@+id/bookTicketsLayout"
app:layout_constraintTop_toBottomOf=
"@+id/linearLayout2"
>
<TextView
android:id=
"@+id/textViewnull"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingBottom=
"20dp"
android:text=
" "
android:textSize=
"20sp"
/>
</LinearLayout>
<Button
<Button
android:id=
"@+id/backBtn"
android:id=
"@+id/backBtn"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -63,21 +83,41 @@
...
@@ -63,21 +83,41 @@
<LinearLayout
<LinearLayout
android:id=
"@+id/bookTicketsLayout"
android:id=
"@+id/bookTicketsLayout"
android:layout_width=
"
0dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"20dp"
android:orientation=
"vertical"
android:orientation=
"vertical"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/linearLayout2"
>
app:layout_constraintTop_toBottomOf=
"@+id/linearLayout2"
>
<TextView
<TextView
android:id=
"@+id/textView
5
"
android:id=
"@+id/textView
6
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Book Tickets:"
/>
android:text=
"Book Tickets:"
android:paddingBottom=
"20dp"
android:textSize=
"20sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/bookTicketsLayout3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"20dp"
android:gravity=
"left"
android:orientation=
"vertical"
app:layout_constraintStart_toEndOf=
"@+id/bookTicketsLayout2"
app:layout_constraintTop_toBottomOf=
"@+id/linearLayout2"
>
<TextView
android:id=
"@+id/textViewnull2"
android:layout_width=
"100dp"
android:layout_height=
"wrap_content"
android:paddingBottom=
"20dp"
android:text=
" "
android:textSize=
"20sp"
/>
</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