Commit f7efdcbd by Miguel Do Carmo

bueno se agregaron cositas para recibir adecuadamente y de manera mas ordenada…

bueno se agregaron cositas para recibir adecuadamente y de manera mas ordenada los eventos utilizados\n Al acceder en la sala de juego se me cierra la coneccion y no encuentro manera de levantar aun
parent e7d65461
TolucaGraphics
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
package com.example.tolucagraphics
import android.view.View
import android.widget.TextView
import okhttp3.WebSocket
import okhttp3.WebSocketListener
class ClassRandom :WebSocketListener() {
override fun onMessage(webSocket: WebSocket, text: String) {
super.onMessage(webSocket, text)
var view : View?=null
view?.findViewById<TextView>(R.id.textID)
}
}
\ No newline at end of file
package com.example.tolucagraphics
object KeysWebSocket {
const val commandResponse = "COMMAND_RESPONSE"
const val trucoRoomEvent = "TRUCO_ROOM_EVENT"
const val trucoTableEvent = "TRUCO_TABLE_EVENT"
const val tablePositionSetted = "TABLE_POSITION_SETTED"
const val roomUserJoined = "ROOM_USER_JOINED"
const val roomLeftRoom = "USER_LEFT_ROOM"
const val roomTableCreated = "ROOM_TABLE_CREATED"
const val roomTableUserJoined = "ROOM_TABLE_USER_JOINED"
const val commandGetRooms = "get_rooms"
const val commandJoinRoom = "join_room"
const val commandCreateRoomTable = "create_room_table"
}
\ No newline at end of file
...@@ -8,7 +8,7 @@ import android.view.View ...@@ -8,7 +8,7 @@ import android.view.View
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.tolucagraphics.datas.GetRooms import com.example.tolucagraphics.datas.GetRooms
import com.example.tolucagraphics.events.Events import com.example.tolucagraphics.events.EventGetRoom
import com.google.gson.Gson import com.google.gson.Gson
import kotlinx.android.synthetic.main.activity_lobby.* import kotlinx.android.synthetic.main.activity_lobby.*
import okhttp3.* import okhttp3.*
...@@ -16,12 +16,10 @@ import java.util.concurrent.TimeUnit ...@@ -16,12 +16,10 @@ import java.util.concurrent.TimeUnit
class LobbyActivity : AppCompatActivity(){ class LobbyActivity : AppCompatActivity(){
val conection = Conection val conection = Socket
private val SERVER_PATH = "ws://3.222.70.21:5000/ws?" private val SERVER_PATH = "ws://3.222.70.21:5000/ws?"
lateinit var webSocket : WebSocket
var username : String? = null var username : String? = null
private val gson = Gson() private val gson = Gson()
var eventReceived : Events?= null
lateinit var campoIDroom : TextView lateinit var campoIDroom : TextView
lateinit var campotestNameRoom : TextView lateinit var campotestNameRoom : TextView
...@@ -77,12 +75,12 @@ class LobbyActivity : AppCompatActivity(){ ...@@ -77,12 +75,12 @@ class LobbyActivity : AppCompatActivity(){
Log.d("request", "Receiving : $text") Log.d("request", "Receiving : $text")
val gsonreceived = Gson() val gsonreceived = Gson()
runOnUiThread { runOnUiThread {
eventReceived = gsonreceived.fromJson(text, Events::class.java) val eventReceived = gsonreceived.fromJson(text, EventGetRoom::class.java)
campoIDroom = findViewById(R.id.campoID) campoIDroom = findViewById(R.id.campoID)
campotestNameRoom = findViewById(R.id.campoNAME) campotestNameRoom = findViewById(R.id.campoNAME)
if (eventReceived != null) { if (eventReceived != null) {
campoIDroom.text = eventReceived?.data?.rooms?.get(0)?.id ?: "0" campoIDroom.text = eventReceived.data?.rooms?.get(0)?.id ?: "0"
campotestNameRoom.text = eventReceived?.data?.rooms?.get(0)?.name ?: "-" campotestNameRoom.text = eventReceived.data?.rooms?.get(0)?.name ?: "-"
} }
} }
} }
...@@ -93,23 +91,4 @@ class LobbyActivity : AppCompatActivity(){ ...@@ -93,23 +91,4 @@ class LobbyActivity : AppCompatActivity(){
Log.d("request","Error : " + t.message) Log.d("request","Error : " + t.message)
} }
} }
object Conection{
var username: String?= null
var SERVER_PATH: String?= null
val client = OkHttpClient.Builder()
.readTimeout(1, TimeUnit.SECONDS)
.build()
var request : Request?=null
var listener : WebSocketListener?=null
fun realizarConex() {
request = Request.Builder()
.url(SERVER_PATH + username)
.build()
}
var webSocketSingle : WebSocket?=null
fun conectarconWS(){
webSocketSingle = client.newWebSocket(request!!, listener!!)
}
}
} }
\ No newline at end of file
package com.example.tolucagraphics
import android.annotation.SuppressLint
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.google.gson.Gson
import okhttp3.Response
import okhttp3.WebSocket
import okhttp3.WebSocketListener
class MesaEnJuego : AppCompatActivity() {
val single = Socket
val gson = Gson()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_mesa_en_juego)
val intentJoin = intent.getStringExtra("join")!!
Log.d("TAG", "Join from Intent: $intentJoin")
//single.listener = Listener2()
single.conectarconWS()
}
fun mensajeRecibido(text : String){
Log.d("TAG", text)
}
inner class Listener2 : WebSocketListener(){
@SuppressLint("SetTextI18n")
override fun onMessage(webSocket: WebSocket, text: String) {
super.onMessage(webSocket, text)
runOnUiThread {
Log.d("TAG", "Undefined text -> $text")
/*if (text.contains(KeysWebSocket.commandResponse,true) && text.contains(KeysWebSocket.commandGetRooms)){
}*/
mensajeRecibido(text)
}
}
override fun onOpen(webSocket: WebSocket, response: Response) {
super.onOpen(webSocket, response)
Log.d("TAG", "established connection! Table Game!!! <3")
}
override fun onClosing(webSocket: WebSocket, code: Int, reason: String) {
super.onClosing(webSocket, code, reason)
Log.d("TAG", "$code $reason")
}
}
}
package com.example.tolucagraphics
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.WebSocket
import okhttp3.WebSocketListener
import java.util.concurrent.TimeUnit
object Socket {
var username: String?= null
var SERVER_PATH: String?= null
private val client = OkHttpClient.Builder()
.readTimeout(1, TimeUnit.SECONDS)
.build()
var request : Request?=null
lateinit var listener : WebSocketListener
fun realizarConex() {
request = Request.Builder()
.url(SERVER_PATH + username)
.build()
}
var webSocketSingle : WebSocket?=null
fun conectarconWS(){
webSocketSingle = client.newWebSocket(request!!, listener)
}
}
\ No newline at end of file
...@@ -7,8 +7,9 @@ import android.widget.TextView ...@@ -7,8 +7,9 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.tolucagraphics.R import com.example.tolucagraphics.R
import com.example.tolucagraphics.events.UserElement import com.example.tolucagraphics.events.UserElement
import com.example.tolucagraphics.events.UserElementJoin
class JugadoresAdapter (val listaJugadores : ArrayList<UserElement?>) : RecyclerView.Adapter<JugadoresAdapter.MesaHolder>() { class JugadoresAdapter (val listaJugadores : ArrayList<UserElementJoin>) : RecyclerView.Adapter<JugadoresAdapter.MesaHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MesaHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MesaHolder {
var layoutInflate = LayoutInflater.from(parent.context) var layoutInflate = LayoutInflater.from(parent.context)
...@@ -21,7 +22,7 @@ class JugadoresAdapter (val listaJugadores : ArrayList<UserElement?>) : Recycler ...@@ -21,7 +22,7 @@ class JugadoresAdapter (val listaJugadores : ArrayList<UserElement?>) : Recycler
} }
override fun onBindViewHolder(holder: MesaHolder, position: Int) { override fun onBindViewHolder(holder: MesaHolder, position: Int) {
listaJugadores[position]?.let { holder.binder(it) } holder.binder(listaJugadores[position])
} }
class MesaHolder(view: View) : RecyclerView.ViewHolder(view) { class MesaHolder(view: View) : RecyclerView.ViewHolder(view) {
...@@ -29,7 +30,7 @@ class JugadoresAdapter (val listaJugadores : ArrayList<UserElement?>) : Recycler ...@@ -29,7 +30,7 @@ class JugadoresAdapter (val listaJugadores : ArrayList<UserElement?>) : Recycler
private val rank: TextView = view.findViewById(R.id.campoRanking) private val rank: TextView = view.findViewById(R.id.campoRanking)
fun binder(element : UserElement) { fun binder(element : UserElementJoin) {
name.text = element.user?.id.toString() name.text = element.user?.id.toString()
rank.text = element.user?.username.toString() rank.text = element.user?.username.toString()
......
package com.example.tolucagraphics.adapters
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.tolucagraphics.R
import com.example.tolucagraphics.datas.DataJT
import com.example.tolucagraphics.datas.JoinTable
import com.example.tolucagraphics.events.EventCreateMesa
class MesaAdapter(val mesasCreadas: ArrayList<EventCreateMesa>, var callback: (String, JoinTable) -> Unit) : RecyclerView.Adapter<MesaAdapter.JugadoresHolder>() {
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): JugadoresHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.modelo_recycler_mesas, parent, false)
return JugadoresHolder(view)
}
override fun getItemCount(): Int {
return mesasCreadas.size
}
override fun onBindViewHolder(holder: JugadoresHolder, position: Int) {
holder.binding(mesasCreadas[position])
holder.itemView.findViewById<Button>(R.id.campoMesaacc).setOnClickListener {
val joinTable = JoinTable()
joinTable.data?.tableID = mesasCreadas[position].data?.table?.id
Log.d("TAG", "LO QUE TIENE TABLA ID ${mesasCreadas[position].data?.table?.id}")
callback("Con mucho amor Hasta aqui llegue ♥", joinTable)
}
}
class JugadoresHolder(view: View):RecyclerView.ViewHolder(view){
var id= view.findViewById<TextView>(R.id.campoMesaId)
var st= view.findViewById<TextView>(R.id.campoMesaEstado)
var s1= view.findViewById<TextView>(R.id.campoMesaS1)
var s2= view.findViewById<TextView>(R.id.campoMesaS2)
var s3= view.findViewById<TextView>(R.id.campoMesaS3)
var s4= view.findViewById<TextView>(R.id.campoMesaS4)
var s5= view.findViewById<TextView>(R.id.campoMesaS5)
var s6= view.findViewById<TextView>(R.id.campoMesaS6)
fun binding(userElementJoin: EventCreateMesa) {
id.text = userElementJoin.data?.table?.id.toString()
st.text = userElementJoin.data?.table?.status.toString()
/*
s1.text = if(userElementJoin.data?.table?.users?.get(0)?.username !=null) userElementJoin.data.table.users?.get(0)?.username else "-"
s2.text = if(userElementJoin.data?.table?.users?.get(1)?.username !=null) userElementJoin.data.table.users?.get(1)?.username else "-"
s3.text = if(userElementJoin.data?.table?.users?.get(2)?.username !=null) userElementJoin.data.table.users?.get(2)?.username else "-"
s4.text = if(userElementJoin.data?.table?.users?.get(3)?.username !=null) userElementJoin.data.table.users?.get(3)?.username else "-"
s5.text = if(userElementJoin.data?.table?.users?.get(4)?.username !=null) userElementJoin.data.table.users?.get(4)?.username else "-"
s6.text = if(userElementJoin.data?.table?.users?.get(5)?.username !=null) userElementJoin.data.table.users?.get(5)?.username else "-"*/
s1.text = "-"
s2.text = "-"
s3.text = "-"
s4.text = "-"
s5.text = "-"
s6.text = "-"
}
}
}
\ No newline at end of file
package com.example.tolucagraphics.adapters
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.tolucagraphics.R
import com.example.tolucagraphics.events.UserElement
class MesasAdapter (val listamesa : ArrayList<UserElement>) : RecyclerView.Adapter<MesasAdapter.MesaHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MesaHolder {
var layoutInflate = LayoutInflater.from(parent.context)
.inflate(R.layout.modelo_recycler_mesas, parent, false)
return MesaHolder(layoutInflate)
}
override fun getItemCount(): Int {
return listamesa.size
}
override fun onBindViewHolder(holder: MesaHolder, position: Int) {
holder.vindeando(listamesa[position])
}
class MesaHolder(view: View) : RecyclerView.ViewHolder(view) {
val id = view.findViewById<TextView>(R.id.campoMesaId)
val st = view.findViewById<TextView>(R.id.campoMesaEstado)
val s1 = view.findViewById<TextView>(R.id.campoMesaS1)
val s2 = view.findViewById<TextView>(R.id.campoMesaS2)
val s3 = view.findViewById<TextView>(R.id.campoMesaS3)
val s4 = view.findViewById<TextView>(R.id.campoMesaS4)
val s5 = view.findViewById<TextView>(R.id.campoMesaS5)
val s6 = view.findViewById<TextView>(R.id.campoMesaS6)
fun vindeando(elemento : UserElement) {
}
}
}
package com.example.tolucagraphics.datas
data class CreateTable (
val command: String = "create_room_table",
val data: DataCreate = DataCreate("1", 30)
)
data class DataCreate (
val roomId: String? = null,
val points: Long? = null
)
\ No newline at end of file
package com.example.tolucagraphics.datas
data class UsernameData (
val username: String? = null,
val id: String? = null
)
data class Data (
val roomId: String? = null,
val points: String? = null
)
data class GetRooms(
val command: String? =null
)
data class JoinData (
val command: String? = null,
val data: Data? = null
)
data class JoinTable (
val command: String? = null,
val data: Data? = null
)
data class ModeloJugadores(
val jugadorNombre: String?= null,
val jugadorRanking: String?= null
)
\ No newline at end of file
package com.example.tolucagraphics.datas
data class GetRooms(
val command: String = "get_rooms"
)
\ No newline at end of file
package com.example.tolucagraphics.datas
data class JoinRoom (
val command: String = "join_room",
val data: Data = Data("1")
)
data class Data (
val roomId: String?=null
)
\ No newline at end of file
package com.example.tolucagraphics.datas
data class JoinTable (
val command: String = "join_room_table",
val data: DataJT? = null
)
data class DataJT (
val roomID: String = "1",
var tableID: String? = null
)
\ No newline at end of file
package com.example.tolucagraphics.events
data class EventCreateMesa (
var type: String? = null,
var command: String? = null,
val data: DataECT? = null
)
data class DataECT (
var eventName: String? = null,
var user: User? = null,
var room: RoomECT? = null,
val table: Table? = null
)
data class RoomECT (
val id: String? = null,
val name: String? = null
)
data class Table (
var id: String? = null,
var status: String? = null,
var roomID: String? = null,
var points: Long? = null,
var owner: User? = null,
var privateTable: Boolean? = null,
var users : ArrayList<User>? = null
)
data class User (
var id: String? = null,
var username: String? = null
)
\ No newline at end of file
package com.example.tolucagraphics.events
data class EventCreateMesaTRE (
val type: String? = null,
val data: DataCRTRE? = null
)
data class DataCRTRE (
val eventName: String? = null,
val user: User? = null,
val room: RoomCRTRE? = null,
val table: TableCRTRE? = null
)
data class RoomCRTRE (
val id: String? = null,
val name: String? = null
)
data class TableCRTRE (
val id: String? = null,
val status: String? = null,
val roomID: String? = null,
val points: Long? = null,
val owner: UserCRTRE? = null,
val privateTable: Boolean? = null,
val users: List<UserCRTRE>? = null
)
data class UserCRTRE (
val id: String? = null,
val username: String? = null
)
package com.example.tolucagraphics.events
data class EventGetRoom (
val type: String? = null,
val command: String? = null,
val data: Data? = null
)
data class Data (
val eventName: String? = null,
val user: UserUser? = null,
val rooms: List<Room>? = null
)
data class Room (
val id: String? = null,
val name: String? = null,
val users: List<UserElement>? = null,
val tables: List<TableGR>? = null
)
data class UserElement (
val user: UserUser? = null,
val online: Boolean? = null
)
data class UserUser (
val id: String? = null,
val username: String? = null
)
data class TableGR (
val id: String? = null,
val status: String? = null,
val roomID: String? = null,
val points: Long? = null,
val owner: OwnerClass? = null,
val privateTable: Boolean? = null,
val users: List<OwnerClass>? = null,
val positions: List<OwnerClass>? = null
)
data class OwnerClass (
val id: String? = null,
val username: String? = null
)
\ No newline at end of file
package com.example.tolucagraphics.events
data class EventJoinRoom (
val type: String? = null,
val command: String? = null,
val data: DataJoin? = null
)
data class DataJoin (
val eventName: String? = null,
val message: String? = null,
val user: UserUser? = null,
val room: RoomJoin? = null
)
data class RoomJoin (
val id: String? = null,
val name: String? = null,
val users: List<UserElementJoin>? = null,
val tables: List<Any?>? = null
)
data class UserElementJoin (
val user: UserUserJoin? = null,
val online: Boolean? = null
)
data class UserUserJoin (
val id: String? = null,
val username: String? = null
)
package com.example.tolucagraphics.events
data class EventJoinRoomTRE (
val type: String? = null,
val data: DataJRTRE? = null
)
data class DataJRTRE (
val eventName: String? = null,
val message: String? = null,
val user: UserUserJRTRE? = null,
val room: RoomJRTRE? = null
)
data class RoomJRTRE (
val id: String? = null,
val name: String? = null,
val users: List<UserElementJRTRE>? = null,
val tables: List<Any?>? = null
)
data class UserElementJRTRE (
val user: UserUserJRTRE? = null,
val online: Boolean? = null
)
data class UserUserJRTRE (
val id: String? = null,
val username: String? = null
)
\ No newline at end of file
package com.example.tolucagraphics.events
data class EventTablePositionSetted (
val type: String? = null,
val data: DataETPS? = null
)
data class DataETPS (
val eventName: String? = null,
val message: String? = null,
val roomID: String? = null,
val user: User? = null,
val tableID: String? = null,
val position: Long? = null,
val table: TableETPS? = null
)
data class TableETPS (
val id: String? = null,
val status: String? = null,
val roomID: String? = null,
val points: Long? = null,
val owner: UserETPS? = null,
val privateTable: Boolean? = null,
val positions: ArrayList<UserETPS?>? = null
)
data class UserETPS (
val id: String? = null,
val username: String? = null
)
package com.example.tolucagraphics.events
data class Events (
val type: String? = null,
val command: String? = null,
val data: Data? = null
)
data class Data (
val eventName: String? = null,
val user: UserUser? = null,
val message: String? = null,
val room: Room? = null,
val rooms: Array<Room>? = null
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as Data
if (eventName != other.eventName) return false
if (user != other.user) return false
if (rooms != null) {
if (other.rooms == null) return false
if (!rooms.contentEquals(other.rooms)) return false
} else if (other.rooms != null) return false
return true
}
override fun hashCode(): Int {
var result = eventName?.hashCode() ?: 0
result = 31 * result + (user?.hashCode() ?: 0)
result = 31 * result + (rooms?.contentHashCode() ?: 0)
return result
}
}
data class Room (
val id: String? = null,
val name: String? = null,
val users: List<UserElement>? = null,
val tables: List<Any?>? = null
)
data class UserElement (
val user: UserUser? = null,
val online: Boolean? = null
)
data class UserUser (
val id: String? = null,
val username: String? = null
)
\ No newline at end of file
package com.example.tolucagraphics.models
import com.example.tolucagraphics.events.OwnerClass
data class ModelForTables(
val id : String?= null,
val state:String?=null,
var users : List<OwnerClass>?=null
)
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/blue" />
<corners android:radius="20dp" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?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=".MesaEnJuego">
<TextView
android:id="@+id/textoPuntajeLocal"
android:text="@string/puntajes_local"
android:textColor="@color/black"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/textoPuntajeVisitante"/>
<TextView
android:id="@+id/textoPuntajeVisitante"
android:text="@string/puntajes_visitante"
android:textColor="@color/black"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/textoPuntajeLocal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/layoutVisitante"/>
<TextView
android:id="@+id/puntajeLocal"
android:text="@string/_00"
android:textColor="@color/black"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
app:layout_constraintTop_toTopOf="@id/textoPuntajeLocal"
app:layout_constraintStart_toEndOf="@id/textoPuntajeLocal"
android:layout_marginStart="10dp" />
<TextView
android:id="@+id/puntajeVisitante"
android:text="@string/_00"
android:textColor="@color/black"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
app:layout_constraintTop_toTopOf="@id/textoPuntajeVisitante"
app:layout_constraintStart_toEndOf="@id/textoPuntajeVisitante"
android:layout_marginStart="10dp" />
<!-- Layout de Jugador Visitante -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layoutVisitante"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/puntajeVisitante">
<ImageView
android:id="@+id/cartaVisitante1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginLeft="50dp"
android:background="@drawable/carta_oculta"
app:layout_constraintEnd_toStartOf="@id/cartaVisitante2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cartaoculta" />
<ImageView
android:id="@+id/cartaVisitante2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/carta_oculta"
app:layout_constraintEnd_toStartOf="@id/cartaVisitante3"
app:layout_constraintStart_toEndOf="@id/cartaVisitante1"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cartaoculta" />
<ImageView
android:id="@+id/cartaVisitante3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:background="@drawable/carta_oculta"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cartaVisitante2"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cartaoculta" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:text="@string/esperando_oponente"
android:id="@+id/empezarJuego"
android:focusable="false"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/layoutVisitante"
app:layout_constraintBottom_toTopOf="@id/layoutLocal"/>
<!-- Layout de Jugador Visitante -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layoutLocal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="100dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView
android:id="@+id/cartaLocal1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginLeft="50dp"
android:background="@drawable/carta_oculta"
app:layout_constraintEnd_toStartOf="@id/cartaLocal2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cartaoculta" />
<ImageView
android:id="@+id/cartaLocal2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/carta_oculta"
app:layout_constraintEnd_toStartOf="@id/cartaLocal3"
app:layout_constraintStart_toEndOf="@id/cartaLocal1"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cartaoculta" />
<ImageView
android:id="@+id/cartaLocal3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:background="@drawable/carta_oculta"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cartaLocal2"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cartaoculta" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -6,4 +6,9 @@ ...@@ -6,4 +6,9 @@
<string name="ranking">Ranking</string> <string name="ranking">Ranking</string>
<string name="crear_mesa">Crear Mesa</string> <string name="crear_mesa">Crear Mesa</string>
<string name="volver">Volver</string> <string name="volver">Volver</string>
<string name="cartaoculta">CartaOculta</string>
<string name="puntajes_visitante">Puntajes Visitante:</string>
<string name="puntajes_local">Puntajes Local:</string>
<string name="_00">00</string>
<string name="esperando_oponente">Esperando Oponente</string>
</resources> </resources>
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