Reorganización pantalla Sala

This commit is contained in:
AngelSuarez03 2024-03-18 16:36:29 -06:00
parent 4d44833c01
commit 2d61c2003e
5 changed files with 96 additions and 39 deletions

View File

@ -19,7 +19,7 @@ class ChairList : AppCompatActivity() {
private lateinit var dbreference : DatabaseReference
private lateinit var recycleView: RecyclerView
private lateinit var eventList : ArrayList<Asiento>
private lateinit var seleccionados : ArrayList<String>
public lateinit var seleccionados : ArrayList<String>
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)
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/chairRecycleView"
android:layout_width="374dp"
android:layout_height="499dp"
android:layout_marginTop="60dp"
android:layout_width="375dp"
android:layout_height="299dp"
android:layout_marginTop="76dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.567"
app:layout_constraintHorizontal_bias="0.444"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/eventTextTitle" />
@ -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" />
<LinearLayout
android:layout_width="409dp"
android:layout_height="81dp"
android:layout_marginTop="502dp"
android:id="@+id/linearLayout"
android:layout_width="366dp"
android:layout_height="77dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="2dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.511"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/chairRecycleView">
app:layout_constraintTop_toBottomOf="@+id/textView8">
<Button
android:id="@+id/btncancelar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:backgroundTint="#D9D9D9"
android:text="Cancelar"
android:fontFamily="@font/cinepolis"
android:text="Cancelar"
android:textColor="#000000"
android:layout_marginTop="15dp"
android:layout_marginLeft="4dp"
android:textSize="18dp" />
<Button
@ -105,4 +114,20 @@
</LinearLayout>
<TextView
android:id="@+id/textView8"
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_marginTop="16dp"
android:background="#612020"
android:fontFamily="@font/cinepolis"
android:gravity="center"
android:text="Escenario"
android:textColor="@color/white"
android:textSize="50dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/chairRecycleView" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -97,8 +97,8 @@
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="DETALLES DE LA VENTA"
android:textColor="#FFFFFF"
@ -207,20 +207,6 @@
app:layout_constraintStart_toStartOf="@id/textView7"
app:layout_constraintTop_toBottomOf="@id/editTextNombre" />
<Button
android:id="@+id/buttonComprar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:backgroundTint="#D9D9D9"
android:text="Comprar"
android:textColor="#000000"
android:textSize="10sp"
app:layout_constraintEnd_toStartOf="@id/buttonCancelar"
app:layout_constraintStart_toStartOf="@id/editTextNombre"
app:layout_constraintTop_toBottomOf="@id/editTextTelefono" />
<Button
android:id="@+id/buttonCancelar"
android:layout_width="0dp"
@ -229,11 +215,27 @@
android:layout_marginTop="16dp"
android:backgroundTint="#D9D9D9"
android:text="Cancelar"
android:fontFamily="@font/cinepolis"
android:textColor="#000000"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="@id/editTextTelefono"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/buttonComprar"
app:layout_constraintTop_toBottomOf="@id/editTextTelefono" />
<Button
android:id="@+id/buttonComprar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:backgroundTint="#D9D9D9"
android:text="Comprar"
android:fontFamily="@font/cinepolis"
android:textColor="#000000"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@id/buttonCancelar"
app:layout_constraintStart_toStartOf="@id/editTextNombre"
app:layout_constraintTop_toBottomOf="@id/editTextTelefono" />
</androidx.constraintlayout.widget.ConstraintLayout>