diff --git a/app/src/main/java/com/example/pantallacompra/ChairList.kt b/app/src/main/java/com/example/pantallacompra/ChairList.kt index 8d02676..1067959 100644 --- a/app/src/main/java/com/example/pantallacompra/ChairList.kt +++ b/app/src/main/java/com/example/pantallacompra/ChairList.kt @@ -19,7 +19,7 @@ class ChairList : AppCompatActivity() { private lateinit var dbreference : DatabaseReference private lateinit var recycleView: RecyclerView private lateinit var eventList : ArrayList - private lateinit var seleccionados : ArrayList + public lateinit var seleccionados : ArrayList override fun onCreate(savedInstanceState: Bundle?) { @@ -73,6 +73,7 @@ class ChairList : AppCompatActivity() { adapter.setOnItemClickListener(object : ChairAdapter.onItemClickListener{ override fun onItemClick(position: Int) { + Toast.makeText(this@ChairList,"No deja",Toast.LENGTH_SHORT).show() adapter.toggleSelection(position) } diff --git a/app/src/main/java/com/example/pantallacompra/MainActivity.kt b/app/src/main/java/com/example/pantallacompra/MainActivity.kt index 2f60229..a710eac 100644 --- a/app/src/main/java/com/example/pantallacompra/MainActivity.kt +++ b/app/src/main/java/com/example/pantallacompra/MainActivity.kt @@ -41,6 +41,7 @@ class MainActivity : AppCompatActivity() { fun cagarEventos(database: DatabaseReference){ //SE INSERTAN DATOS DE LOS EVENTOS EN LA BD + val event1 = Event("Los caligaris","Musical",120,"Concierto") val event2= Event("Champions","futbol",100,"deportes") val event3= Event("Rhiana Show","Musical",120,"Concierto") @@ -68,18 +69,46 @@ class MainActivity : AppCompatActivity() { database.child(sala4.n0Sala.toString()).setValue(sala4) } fun cargarAsientos(database: DatabaseReference){ - val asientoA1=Asiento("A1",10,"Chafa","Libre",1) - val asientoA2=Asiento("A2",10,"Chafa","Libre",1) - val asientoA3=Asiento("A3",10,"Chafa","Libre",1) - val asientoB1=Asiento("B1",10,"Regular","Libre",1) - val asientoB2=Asiento("B2",10,"Regular","Libre",1) - val asientoB3=Asiento("B3",10,"Regular","Libre",1) + val asientoA1=Asiento("A1",25,"Chafa","Libre",1) + val asientoA2=Asiento("A2",25,"Chafa","Libre",1) + val asientoA3=Asiento("A3",25,"Chafa","Libre",1) + val asientoA4=Asiento("A4",25,"Chafa","Libre",1) + val asientoB1=Asiento("B1",40,"Regular","Libre",1) + val asientoB2=Asiento("B2",40,"Regular","Libre",1) + val asientoB3=Asiento("B3",40,"Regular","Libre",1) + val asientoB4=Asiento("B4",40,"Regular","Libre",1) + val asientoC1=Asiento("C1",40,"Regular","Libre",1) + val asientoC2=Asiento("C2",40,"Regular","Libre",1) + val asientoC3=Asiento("C3",40,"Regular","Libre",1) + val asientoC4=Asiento("C4",40,"Regular","Libre",1) + val asientoD1=Asiento("D1",40,"Regular","Libre",1) + val asientoD2=Asiento("D2",40,"Regular","Libre",1) + val asientoD3=Asiento("D3",40,"Regular","Libre",1) + val asientoD4=Asiento("D4",40,"Regular","Libre",1) + val asientoE1=Asiento("E1",70,"VIP","Libre",1) + val asientoE2=Asiento("E2",70,"VIP","Libre",1) + val asientoE3=Asiento("E3",70,"VIP","Libre",1) + val asientoE4=Asiento("E4",70,"VIP","Libre",1) database.child(asientoA1.noAsiento.toString()).setValue(asientoA1) database.child(asientoA2.noAsiento.toString()).setValue(asientoA2) database.child(asientoA3.noAsiento.toString()).setValue(asientoA3) + database.child(asientoA4.noAsiento.toString()).setValue(asientoA4) database.child(asientoB1.noAsiento.toString()).setValue(asientoB1) database.child(asientoB2.noAsiento.toString()).setValue(asientoB2) database.child(asientoB3.noAsiento.toString()).setValue(asientoB3) + database.child(asientoB4.noAsiento.toString()).setValue(asientoB4) + database.child(asientoC1.noAsiento.toString()).setValue(asientoC1) + database.child(asientoC2.noAsiento.toString()).setValue(asientoC2) + database.child(asientoC3.noAsiento.toString()).setValue(asientoC3) + database.child(asientoC4.noAsiento.toString()).setValue(asientoC4) + database.child(asientoD1.noAsiento.toString()).setValue(asientoD1) + database.child(asientoD2.noAsiento.toString()).setValue(asientoD2) + database.child(asientoD3.noAsiento.toString()).setValue(asientoD3) + database.child(asientoD4.noAsiento.toString()).setValue(asientoD4) + database.child(asientoE1.noAsiento.toString()).setValue(asientoE1) + database.child(asientoE2.noAsiento.toString()).setValue(asientoE2) + database.child(asientoE3.noAsiento.toString()).setValue(asientoE3) + database.child(asientoE4.noAsiento.toString()).setValue(asientoE4) } } \ No newline at end of file diff --git a/app/src/main/java/com/example/pantallacompra/compra.kt b/app/src/main/java/com/example/pantallacompra/compra.kt index 8e750af..824c522 100644 --- a/app/src/main/java/com/example/pantallacompra/compra.kt +++ b/app/src/main/java/com/example/pantallacompra/compra.kt @@ -30,7 +30,7 @@ class compra: AppCompatActivity() { } btnCancelar.setOnClickListener { - val intent = Intent(this, EventList::class.java) + val intent = Intent(this, ChairList::class.java) startActivity(intent) } } diff --git a/app/src/main/res/layout/activity_chair_list.xml b/app/src/main/res/layout/activity_chair_list.xml index 3ddd335..e74561b 100644 --- a/app/src/main/res/layout/activity_chair_list.xml +++ b/app/src/main/res/layout/activity_chair_list.xml @@ -14,9 +14,10 @@ android:background="#08404F" android:gravity="center" android:text="Playpal" + android:fontFamily="@font/cinepolis" android:textAlignment="gravity" android:textColor="@color/white" - android:textSize="34sp" + android:textSize="50sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -33,11 +34,11 @@ @@ -59,35 +60,43 @@ android:id="@+id/eventoText" android:layout_width="292dp" android:layout_height="59dp" + android:layout_marginBottom="20dp" + android:fontFamily="@font/cinepolis" + android:gravity="center" android:text="Los Caligaris" + android:textAlignment="center" android:textSize="30sp" app:layout_constraintBottom_toTopOf="@+id/chairRecycleView" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/noSalaText" - app:layout_constraintTop_toBottomOf="@+id/eventTextTitle" /> + app:layout_constraintTop_toBottomOf="@+id/eventTextTitle" + app:layout_constraintVertical_bias="0.0" /> + app:layout_constraintTop_toBottomOf="@+id/textView8">