Commit 713ef004 authored by a-j.towse's avatar a-j.towse

working ticket number selector

parent 41ac9e31
......@@ -8,7 +8,7 @@ android {
defaultConfig {
applicationId "com.example.no1theatrecompany"
minSdk 25
minSdk 30
targetSdk 33
versionCode 1
versionName "1.0"
......
......@@ -91,7 +91,7 @@ public class DBConnector extends SQLiteOpenHelper {
play1.put(COLUMN_TIME, "20:00");
play1.put(COLUMN_VENUE, "Merchant Adventurer's Hall, York");
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
play2.put(COLUMN_NAME, "Hamlet by William Shakespeare");
......@@ -100,7 +100,7 @@ public class DBConnector extends SQLiteOpenHelper {
play2.put(COLUMN_VENUE, "Clifford's Tower, York");
play2.put(COLUMN_FLASH, "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
play3.put(COLUMN_NAME, "A Midsummer Night's Dream by William Shakespeare");
......@@ -109,8 +109,8 @@ public class DBConnector extends SQLiteOpenHelper {
play3.put(COLUMN_VENUE, "Dean's Park, York");
play3.put(COLUMN_FLASH, "true");
play3.put(COLUMN_WHEELACCESS, "true");
play3.put(COLUMN_TIXSTAGE, "11,4");
play3.put(COLUMN_TIXGRASS, "29,4");
play3.put(COLUMN_TIXSTAGE, "11,4,Stage");
play3.put(COLUMN_TIXGRASS, "29,4,Grass");
ContentValues play4 = new ContentValues(); //Create new row object
play4.put(COLUMN_NAME, "Oedipus the King by Sophocles");
......@@ -118,8 +118,8 @@ public class DBConnector extends SQLiteOpenHelper {
play4.put(COLUMN_TIME, "20:00");
play4.put(COLUMN_VENUE, "St Mary's Abbey, Museum Gardens, York");
play4.put(COLUMN_WHEELACCESS, "true");
play4.put(COLUMN_TIXSEAT, "5,9");
play4.put(COLUMN_TIXSTAND, "12,7");
play4.put(COLUMN_TIXSEAT, "5,9,Seat");
play4.put(COLUMN_TIXSTAND, "12,7,Stand");
ContentValues play5 = new ContentValues(); //Create new row object
play5.put(COLUMN_NAME, "The Tempest by William Shakespeare");
......@@ -127,8 +127,8 @@ public class DBConnector extends SQLiteOpenHelper {
play5.put(COLUMN_TIME, "14:00");
play5.put(COLUMN_VENUE, "Millennium Bridge, York");
play5.put(COLUMN_WHEELACCESS, "true");
play5.put(COLUMN_TIXBOATA, "6,9");
play5.put(COLUMN_TIXRIVERBANK, "10,7");
play5.put(COLUMN_TIXBOATA, "6,9,Boat A");
play5.put(COLUMN_TIXRIVERBANK, "10,7,Riverbank");
ContentValues play6= new ContentValues(); //Create new row object
play6.put(COLUMN_NAME, "Antigone by Sophocles");
......@@ -136,9 +136,9 @@ public class DBConnector extends SQLiteOpenHelper {
play6.put(COLUMN_TIME, "21:00");
play6.put(COLUMN_VENUE, "Crypt, York Minster, York");
play6.put(COLUMN_STEPS, "true");
play6.put(COLUMN_TIXINCIRC, "5,16");
play6.put(COLUMN_TIXOUTCIRC, "8,13");
play6.put(COLUMN_TIXSTAND, "10,10");
play6.put(COLUMN_TIXINCIRC, "5,16,Inner Circle");
play6.put(COLUMN_TIXOUTCIRC, "8,13,Outer Circle");
play6.put(COLUMN_TIXSTAND, "10,10,Standing");
db.insert(TABLE_PERFORMANCES, null, play1); //Store play details
db.insert(TABLE_PERFORMANCES, null, play2); //Store play details
......
package com.example.no1theatrecompany;
import static android.text.InputType.TYPE_CLASS_NUMBER;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.NumberPicker;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
......@@ -64,28 +71,38 @@ public class performanceInfoPage extends AppCompatActivity {
for (int x=7;x<currentPerformance.size();x++) {
if (currentPerformance.get(x) != null) {
ticketTypeCount+=1;
}
}
System.out.println(currentPerformance);
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(","));
/*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");
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);
}
}
}*/
}
}
......@@ -6,6 +6,26 @@
android:layout_height="match_parent"
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
android:id="@+id/backBtn"
android:layout_width="wrap_content"
......@@ -63,21 +83,41 @@
<LinearLayout
android:id="@+id/bookTicketsLayout"
android:layout_width="0dp"
android:layout_width="wrap_content"
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:id="@+id/textView6"
android:layout_width="match_parent"
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>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment