Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PlaysRUs
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
sam.pople
PlaysRUs
Commits
cdf47363
Commit
cdf47363
authored
Jun 16, 2023
by
sam.pople
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
really proud now
parent
2919e307
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
254 additions
and
21 deletions
+254
-21
MainActivity.java
.../app/src/main/java/com/example/playsrus/MainActivity.java
+10
-1
antigone.java
...RUs2/app/src/main/java/com/example/playsrus/antigone.java
+5
-1
filtered.java
...RUs2/app/src/main/java/com/example/playsrus/filtered.java
+10
-1
hamlet.java
PlaysRUs2/app/src/main/java/com/example/playsrus/hamlet.java
+7
-2
lights.java
PlaysRUs2/app/src/main/java/com/example/playsrus/lights.java
+65
-0
midsummer.java
...Us2/app/src/main/java/com/example/playsrus/midsummer.java
+7
-3
oedipus.java
...sRUs2/app/src/main/java/com/example/playsrus/oedipus.java
+8
-4
seating.java
...sRUs2/app/src/main/java/com/example/playsrus/seating.java
+9
-3
tempest.java
...sRUs2/app/src/main/java/com/example/playsrus/tempest.java
+9
-4
view.java
PlaysRUs2/app/src/main/java/com/example/playsrus/view.java
+1
-0
activity_main.xml
PlaysRUs2/app/src/main/res/layout/activity_main.xml
+13
-1
filteredwheelchair.xml
PlaysRUs2/app/src/main/res/layout/filteredwheelchair.xml
+13
-1
lights.xml
PlaysRUs2/app/src/main/res/layout/lights.xml
+97
-0
No files found.
PlaysRUs2/app/src/main/java/com/example/playsrus/MainActivity.java
View file @
cdf47363
...
@@ -26,7 +26,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -26,7 +26,7 @@ public class MainActivity extends AppCompatActivity {
plays
.
add
(
new
performancetickets
(
"Antigone"
,
23
));
plays
.
add
(
new
performancetickets
(
"Antigone"
,
23
));
//This sets the buttons and ensures they open certain screens when clicked
Button
performance1
=
(
Button
)
findViewById
(
R
.
id
.
Performance1
);
Button
performance1
=
(
Button
)
findViewById
(
R
.
id
.
Performance1
);
Button
wheelchair
=
(
Button
)
findViewById
(
R
.
id
.
filtered
);
Button
wheelchair
=
(
Button
)
findViewById
(
R
.
id
.
filtered
);
Button
view
=
(
Button
)
findViewById
(
R
.
id
.
viewall
);
Button
view
=
(
Button
)
findViewById
(
R
.
id
.
viewall
);
...
@@ -35,6 +35,15 @@ public class MainActivity extends AppCompatActivity {
...
@@ -35,6 +35,15 @@ public class MainActivity extends AppCompatActivity {
Button
oedipus
=
(
Button
)
findViewById
(
R
.
id
.
oedipus
);
Button
oedipus
=
(
Button
)
findViewById
(
R
.
id
.
oedipus
);
Button
antigone
=
(
Button
)
findViewById
(
R
.
id
.
antigone
);
Button
antigone
=
(
Button
)
findViewById
(
R
.
id
.
antigone
);
Button
tempest
=
(
Button
)
findViewById
(
R
.
id
.
tempest
);
Button
tempest
=
(
Button
)
findViewById
(
R
.
id
.
tempest
);
Button
filtertwo
=
(
Button
)
findViewById
(
R
.
id
.
filtered2
);
filtertwo
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
MainActivity
.
this
,
lights
.
class
);
startActivity
(
intent
);
}
});
midsummer
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
midsummer
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/antigone.java
View file @
cdf47363
...
@@ -50,7 +50,7 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
...
@@ -50,7 +50,7 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
String
playnameforthis
=
"Antigone"
;
String
playnameforthis
=
"Antigone"
;
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
//This ensures that the number of ordered tickets is acceptable
confirm
.
setOnClickListener
(
v
->
{
confirm
.
setOnClickListener
(
v
->
{
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet6
);
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet6
);
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
...
@@ -62,8 +62,11 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
...
@@ -62,8 +62,11 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
if
(
bookedupdate
)
{
if
(
bookedupdate
)
{
Boolean
input
=
database
.
bookinginput
(
playnameforthis
,
orderedtickets
);
if
(
input
==
true
)
{
Intent
screenchange
=
new
Intent
(
antigone
.
this
,
booked
.
class
);
Intent
screenchange
=
new
Intent
(
antigone
.
this
,
booked
.
class
);
startActivity
(
screenchange
);
startActivity
(
screenchange
);
}
}
else
{
}
else
{
Toast
.
makeText
(
antigone
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
antigone
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
@@ -83,6 +86,7 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
...
@@ -83,6 +86,7 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
//This allows the user to order a certain number of tickets
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet6
);
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet6
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet6
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet6
);
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/filtered.java
View file @
cdf47363
...
@@ -15,15 +15,24 @@ public class filtered extends AppCompatActivity {
...
@@ -15,15 +15,24 @@ public class filtered extends AppCompatActivity {
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
filteredwheelchair
);
setContentView
(
R
.
layout
.
filteredwheelchair
);
//This sets the buttons and ensures they open certain screens when clicked
Button
undo
=
(
Button
)
findViewById
(
R
.
id
.
undo
);
Button
undo
=
(
Button
)
findViewById
(
R
.
id
.
undo
);
Button
performance
=
(
Button
)
findViewById
(
R
.
id
.
performance
);
Button
performance
=
(
Button
)
findViewById
(
R
.
id
.
performance
);
Button
view
=
(
Button
)
findViewById
(
R
.
id
.
filteredview
);
Button
view
=
(
Button
)
findViewById
(
R
.
id
.
filteredview
);
Button
midsummer
=
(
Button
)
findViewById
(
R
.
id
.
midsummerfilter
);
Button
midsummer
=
(
Button
)
findViewById
(
R
.
id
.
midsummerfilter
);
Button
oedipus
=
(
Button
)
findViewById
(
R
.
id
.
oedipusfilter
);
Button
oedipus
=
(
Button
)
findViewById
(
R
.
id
.
oedipusfilter
);
Button
tempest
=
(
Button
)
findViewById
(
R
.
id
.
tempestfilter
);
Button
tempest
=
(
Button
)
findViewById
(
R
.
id
.
tempestfilter
);
Button
undotwo
=
(
Button
)
findViewById
(
R
.
id
.
undo2
);
undotwo
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
filtered
.
this
,
lights
.
class
);
startActivity
(
intent
);
}
});
view
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
view
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/hamlet.java
View file @
cdf47363
...
@@ -50,6 +50,7 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
...
@@ -50,6 +50,7 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
String
playnameforthis
=
"Hamlet"
;
String
playnameforthis
=
"Hamlet"
;
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
//This ensures that the number of ordered tickets is acceptable
confirm
.
setOnClickListener
(
v
->
{
confirm
.
setOnClickListener
(
v
->
{
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet2
);
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet2
);
...
@@ -62,8 +63,11 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
...
@@ -62,8 +63,11 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
if
(
bookedupdate
)
{
if
(
bookedupdate
)
{
Intent
screenchange
=
new
Intent
(
hamlet
.
this
,
booked
.
class
);
Boolean
input
=
database
.
bookinginput
(
playnameforthis
,
orderedtickets
);
startActivity
(
screenchange
);
if
(
input
==
true
)
{
Intent
screenchange
=
new
Intent
(
hamlet
.
this
,
booked
.
class
);
startActivity
(
screenchange
);
}
}
else
{
}
else
{
Toast
.
makeText
(
hamlet
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
hamlet
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
@@ -83,6 +87,7 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
...
@@ -83,6 +87,7 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
//This allows the user to order a certain number of tickets
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet2
);
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet2
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet2
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet2
);
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/lights.java
0 → 100644
View file @
cdf47363
package
com
.
example
.
playsrus
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
lights
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
lights
);
//This sets the buttons and ensures they open certain screens when clicked
Button
undo
=
(
Button
)
findViewById
(
R
.
id
.
undo5
);
Button
wheelchair
=
(
Button
)
findViewById
(
R
.
id
.
undo6
);
Button
view
=
(
Button
)
findViewById
(
R
.
id
.
filteredview3
);
Button
midsummer
=
(
Button
)
findViewById
(
R
.
id
.
midsummerfilter3
);
Button
hamlet
=
(
Button
)
findViewById
(
R
.
id
.
hamletfilter3
);
wheelchair
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
lights
.
this
,
filtered
.
class
);
startActivity
(
intent
);
}
});
view
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
lights
.
this
,
view
.
class
);
startActivity
(
intent
);
}
});
hamlet
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
lights
.
this
,
hamlet
.
class
);
startActivity
(
intent
);
}
});
midsummer
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
lights
.
this
,
midsummer
.
class
);
startActivity
(
intent
);
}
});
undo
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
lights
.
this
,
MainActivity
.
class
);
startActivity
(
intent
);
}
});
}
}
PlaysRUs2/app/src/main/java/com/example/playsrus/midsummer.java
View file @
cdf47363
...
@@ -50,7 +50,7 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
...
@@ -50,7 +50,7 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
String
playnameforthis
=
"A Midsummer Night's Dream"
;
String
playnameforthis
=
"A Midsummer Night's Dream"
;
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
//This ensures the customer doesn't order too many tickets or too few
confirm
.
setOnClickListener
(
v
->
{
confirm
.
setOnClickListener
(
v
->
{
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet2
);
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet2
);
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
...
@@ -62,8 +62,11 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
...
@@ -62,8 +62,11 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
if
(
bookedupdate
)
{
if
(
bookedupdate
)
{
Intent
screenchange
=
new
Intent
(
midsummer
.
this
,
booked
.
class
);
Boolean
input
=
database
.
bookinginput
(
playnameforthis
,
orderedtickets
);
startActivity
(
screenchange
);
if
(
input
==
true
)
{
Intent
screenchange
=
new
Intent
(
midsummer
.
this
,
booked
.
class
);
startActivity
(
screenchange
);
}
}
else
{
}
else
{
Toast
.
makeText
(
midsummer
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
midsummer
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
@@ -83,6 +86,7 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
...
@@ -83,6 +86,7 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
//This allows the customer to order more or less tickets
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet4
);
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet4
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet4
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet4
);
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/oedipus.java
View file @
cdf47363
...
@@ -30,8 +30,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -30,8 +30,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
setContentView
(
R
.
layout
.
oedipus
);
setContentView
(
R
.
layout
.
oedipus
);
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet3
);
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet3
);
fullName
=
(
EditText
)
findViewById
(
R
.
id
.
fullnamehamlet3
);
fullName
=
(
EditText
)
findViewById
(
R
.
id
.
fullnamehamlet3
);
//This sets the spinner
Spinner
hamletseatingtype
=
(
Spinner
)
findViewById
(
R
.
id
.
hamletseatingtype3
);
Spinner
hamletseatingtype
=
(
Spinner
)
findViewById
(
R
.
id
.
hamletseatingtype3
);
hamletseatingtype
.
setOnItemSelectedListener
(
this
);
hamletseatingtype
.
setOnItemSelectedListener
(
this
);
ArrayAdapter
aa
=
new
ArrayAdapter
(
this
,
android
.
R
.
layout
.
simple_spinner_item
,
seatings
);
ArrayAdapter
aa
=
new
ArrayAdapter
(
this
,
android
.
R
.
layout
.
simple_spinner_item
,
seatings
);
...
@@ -50,6 +49,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -50,6 +49,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
String
playnameforthis
=
"Oedipus the King"
;
String
playnameforthis
=
"Oedipus the King"
;
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
//This ensures that the number of ordered tickets is acceptable
confirm
.
setOnClickListener
(
v
->
{
confirm
.
setOnClickListener
(
v
->
{
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet3
);
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet3
);
...
@@ -62,8 +62,11 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -62,8 +62,11 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
if
(
bookedupdate
)
{
if
(
bookedupdate
)
{
Intent
screenchange
=
new
Intent
(
oedipus
.
this
,
booked
.
class
);
Boolean
input
=
database
.
bookinginput
(
playnameforthis
,
orderedtickets
);
startActivity
(
screenchange
);
if
(
input
==
true
)
{
Intent
screenchange
=
new
Intent
(
oedipus
.
this
,
booked
.
class
);
startActivity
(
screenchange
);
}
}
else
{
}
else
{
Toast
.
makeText
(
oedipus
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
oedipus
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
@@ -83,6 +86,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -83,6 +86,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
//This allows the customer to order tickets
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet3
);
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet3
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet3
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet3
);
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/seating.java
View file @
cdf47363
...
@@ -2,6 +2,8 @@ package com.example.playsrus;
...
@@ -2,6 +2,8 @@ package com.example.playsrus;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.ContentValues
;
import
android.database.sqlite.SQLiteDatabase
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.Spinner
;
import
android.widget.Spinner
;
...
@@ -30,7 +32,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -30,7 +32,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet
);
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet
);
fullName
=
(
EditText
)
findViewById
(
R
.
id
.
fullnamehamlet
);
fullName
=
(
EditText
)
findViewById
(
R
.
id
.
fullnamehamlet
);
displayplayname
=
findViewById
(
R
.
id
.
displayplayname
);
displayplayname
=
findViewById
(
R
.
id
.
displayplayname
);
//This sets the spinner
Spinner
seatingtype
=
(
Spinner
)
findViewById
(
R
.
id
.
hamletseatingtype
);
Spinner
seatingtype
=
(
Spinner
)
findViewById
(
R
.
id
.
hamletseatingtype
);
seatingtype
.
setOnItemSelectedListener
(
this
);
seatingtype
.
setOnItemSelectedListener
(
this
);
ArrayAdapter
aa
=
new
ArrayAdapter
(
this
,
android
.
R
.
layout
.
simple_spinner_item
,
seatings
);
ArrayAdapter
aa
=
new
ArrayAdapter
(
this
,
android
.
R
.
layout
.
simple_spinner_item
,
seatings
);
...
@@ -46,7 +48,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -46,7 +48,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
String
playnameforthis
=
"The Merchant of Venice"
;
String
playnameforthis
=
"The Merchant of Venice"
;
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
//This ensures that the number of ordered tickets is acceptable
confirm
.
setOnClickListener
(
v
->
{
confirm
.
setOnClickListener
(
v
->
{
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet
);
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet
);
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
...
@@ -58,9 +60,12 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -58,9 +60,12 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
if
(
bookedupdate
)
{
if
(
bookedupdate
)
{
Boolean
input
=
database
.
bookinginput
(
playnameforthis
,
orderedtickets
);
if
(
input
==
true
)
{
Intent
screenchange
=
new
Intent
(
seating
.
this
,
booked
.
class
);
Intent
screenchange
=
new
Intent
(
seating
.
this
,
booked
.
class
);
startActivity
(
screenchange
);
startActivity
(
screenchange
);
}
else
{
}
}
else
{
Toast
.
makeText
(
seating
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
seating
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
@@ -79,6 +84,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -79,6 +84,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
//This allows the user to order a certain number of tickets
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet
);
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet
);
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/tempest.java
View file @
cdf47363
...
@@ -41,16 +41,16 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -41,16 +41,16 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
Button
seatingback
=
(
Button
)
findViewById
(
R
.
id
.
hamletback5
);
Button
seatingback
=
(
Button
)
findViewById
(
R
.
id
.
hamletback5
);
Intent
intent
=
getIntent
();
Intent
intent
=
getIntent
();
database
=
new
Database
(
this
);
database
=
new
Database
(
this
);
//This finds and sets the number of tickets
displayorderedtickets
.
setText
(
String
.
valueOf
(
orderedtickets
));
displayorderedtickets
.
setText
(
String
.
valueOf
(
orderedtickets
));
String
playName
=
"The Tempest"
;
String
playName
=
"The Tempest"
;
database
.
playinput
(
playName
,
noticket
);
database
.
playinput
(
playName
,
noticket
);
database
=
new
Database
(
this
);
database
=
new
Database
(
this
);
TextView
displaytickets
=
findViewById
(
R
.
id
.
hamlettickets5
);
TextView
displaytickets
=
findViewById
(
R
.
id
.
hamlettickets5
);
String
playnameforthis
=
"The Tempest"
;
String
playnameforthis
=
"The Tempest"
;
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
int
ticketsthere
=
database
.
gettickets
(
playnameforthis
);
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
//This ensures that the number of ordered tickets is acceptable
confirm
.
setOnClickListener
(
v
->
{
confirm
.
setOnClickListener
(
v
->
{
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet3
);
TextView
displayorderedtickets
=
findViewById
(
R
.
id
.
orderedticketshamlet3
);
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
int
orderedtickets
=
Integer
.
parseInt
(
displayorderedtickets
.
getText
().
toString
());
...
@@ -62,8 +62,12 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -62,8 +62,12 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
displaytickets
.
setText
(
String
.
valueOf
(
ticketsthere
));
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
boolean
bookedupdate
=
database
.
ticketsupdate
(
playnameforthis
,
currentickets
);
if
(
bookedupdate
)
{
if
(
bookedupdate
)
{
Intent
screenchange
=
new
Intent
(
tempest
.
this
,
booked
.
class
);
Boolean
input
=
database
.
bookinginput
(
playnameforthis
,
orderedtickets
);
startActivity
(
screenchange
);
if
(
input
==
true
)
{
Intent
screenchange
=
new
Intent
(
tempest
.
this
,
booked
.
class
);
startActivity
(
screenchange
);
}
}
else
{
}
else
{
Toast
.
makeText
(
tempest
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
tempest
.
this
,
"Please try again."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
@@ -83,6 +87,7 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
...
@@ -83,6 +87,7 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
//This allows the user to order a certain number of tickets
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet5
);
Button
plusone
=
findViewById
(
R
.
id
.
plusonehamlet5
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet5
);
Button
minusone
=
findViewById
(
R
.
id
.
minusonehamlet5
);
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
plusone
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
PlaysRUs2/app/src/main/java/com/example/playsrus/view.java
View file @
cdf47363
...
@@ -29,6 +29,7 @@ public class view extends AppCompatActivity {
...
@@ -29,6 +29,7 @@ public class view extends AppCompatActivity {
}
}
});
});
}
}
//This makes sure that if no bookings have been made, it says so.
private
void
listBookings
()
{
private
void
listBookings
()
{
List
<
String
>
findbookings
=
database
.
currentbookings
();
List
<
String
>
findbookings
=
database
.
currentbookings
();
if
(
findbookings
.
isEmpty
())
{
if
(
findbookings
.
isEmpty
())
{
...
...
PlaysRUs2/app/src/main/res/layout/activity_main.xml
View file @
cdf47363
...
@@ -129,6 +129,18 @@
...
@@ -129,6 +129,18 @@
app:layout_constraintHorizontal_bias=
"0.908"
app:layout_constraintHorizontal_bias=
"0.908"
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.826"
/>
app:layout_constraintVertical_bias=
"0.791"
/>
<Button
android:id=
"@+id/filtered2"
android:layout_width=
"237dp"
android:layout_height=
"74dp"
android:text=
"View Performances With Flashing Lights"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.908"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.939"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
PlaysRUs2/app/src/main/res/layout/filteredwheelchair.xml
View file @
cdf47363
...
@@ -104,6 +104,18 @@
...
@@ -104,6 +104,18 @@
app:layout_constraintHorizontal_bias=
"0.908"
app:layout_constraintHorizontal_bias=
"0.908"
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.826"
/>
app:layout_constraintVertical_bias=
"0.773"
/>
<Button
android:id=
"@+id/undo2"
android:layout_width=
"237dp"
android:layout_height=
"74dp"
android:text=
"View Performances with Flashing Lights"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.908"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.922"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
PlaysRUs2/app/src/main/res/layout/lights.xml
0 → 100644
View file @
cdf47363
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".lights"
>
<TextView
android:id=
"@+id/textView44"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:text=
"List of Performances"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textSize=
"20sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.096"
/>
<TextView
android:id=
"@+id/textView45"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:text=
"Plays R Us"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textSize=
"20sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.13"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.043"
/>
<Button
android:id=
"@+id/midsummerfilter3"
android:layout_width=
"143dp"
android:layout_height=
"86dp"
android:text=
"A Midsummer Night's Dream"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.865"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.19"
/>
<Button
android:id=
"@+id/hamletfilter3"
android:layout_width=
"143dp"
android:layout_height=
"86dp"
android:text=
"Hamlet"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.119"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.19"
/>
<Button
android:id=
"@+id/filteredview3"
android:layout_width=
"143dp"
android:layout_height=
"60dp"
android:text=
"View Bookings"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.014"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.83"
/>
<Button
android:id=
"@+id/undo5"
android:layout_width=
"237dp"
android:layout_height=
"74dp"
android:text=
"View All"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.908"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.773"
/>
<Button
android:id=
"@+id/undo6"
android:layout_width=
"237dp"
android:layout_height=
"74dp"
android:text=
"View Performances with Flashing Lights"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.908"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.922"
/>
</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