From 70251d37d747e0b2489959961c17e58b9bb037b0 Mon Sep 17 00:00:00 2001 From: Miguel Do Carmo Date: Thu, 28 May 2020 16:12:31 -0300 Subject: [PATCH] Crasheaba porque no declare en el Manifest el Activity ... arreglao --- TolucaGraphics - copia/app/src/main/AndroidManifest.xml | 1 + TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaEnJuego.kt | 48 ------------------------------------------------ TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaJugando.kt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesasActivity.kt | 4 ++-- TolucaGraphics - copia/app/src/main/res/drawable-v24/carta_oculta.png | Bin 80748 -> 0 bytes TolucaGraphics - copia/app/src/main/res/drawable-xxhdpi/carta_oculta.png | Bin 0 -> 80748 bytes TolucaGraphics - copia/app/src/main/res/layout/activity_mesa_en_juego.xml | 2 +- TolucaGraphics - copia/app/src/main/res/layout/activity_mesas_players.xml | 454 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- TolucaGraphics - copia/app/src/main/res/layout/modelo_recycler_mesas.xml | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------- 9 files changed, 376 insertions(+), 375 deletions(-) delete mode 100644 TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaEnJuego.kt create mode 100644 TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaJugando.kt delete mode 100644 TolucaGraphics - copia/app/src/main/res/drawable-v24/carta_oculta.png create mode 100644 TolucaGraphics - copia/app/src/main/res/drawable-xxhdpi/carta_oculta.png diff --git a/TolucaGraphics - copia/app/src/main/AndroidManifest.xml b/TolucaGraphics - copia/app/src/main/AndroidManifest.xml index c1b17b4..217b194 100644 --- a/TolucaGraphics - copia/app/src/main/AndroidManifest.xml +++ b/TolucaGraphics - copia/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ android:usesCleartextTraffic="true" tools:targetApi="m"> + diff --git a/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaEnJuego.kt b/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaEnJuego.kt deleted file mode 100644 index f1cad02..0000000 --- a/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaEnJuego.kt +++ /dev/null @@ -1,48 +0,0 @@ -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") - } - } -} diff --git a/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaJugando.kt b/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaJugando.kt new file mode 100644 index 0000000..37408ac --- /dev/null +++ b/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesaJugando.kt @@ -0,0 +1,48 @@ +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 MesaJugando : 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") + } + } +} diff --git a/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesasActivity.kt b/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesasActivity.kt index 868e31f..131dc58 100644 --- a/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesasActivity.kt +++ b/TolucaGraphics - copia/app/src/main/java/com/example/tolucagraphics/MesasActivity.kt @@ -69,8 +69,8 @@ class MesasActivity : AppCompatActivity() { fun iniciarRecyclerMesas(){ mesasAdapter = MesaAdapter(listaMesas){ cadena, join -> Toast.makeText(this@MesasActivity, cadena, Toast.LENGTH_LONG).show() - val intentJuego = Intent(this@MesasActivity, MesaEnJuego::class.java) - intentJuego.putExtra("join", gson.toJson(join)) + val intentJuego = Intent(this@MesasActivity, MesaJugando::class.java) + //intentJuego.putExtra("join", gson.toJson(join)) startActivity(intentJuego) } lista_mesas.apply { diff --git a/TolucaGraphics - copia/app/src/main/res/drawable-v24/carta_oculta.png b/TolucaGraphics - copia/app/src/main/res/drawable-v24/carta_oculta.png deleted file mode 100644 index 69033ed..0000000 Binary files a/TolucaGraphics - copia/app/src/main/res/drawable-v24/carta_oculta.png and /dev/null differ diff --git a/TolucaGraphics - copia/app/src/main/res/drawable-xxhdpi/carta_oculta.png b/TolucaGraphics - copia/app/src/main/res/drawable-xxhdpi/carta_oculta.png new file mode 100644 index 0000000..69033ed Binary files /dev/null and b/TolucaGraphics - copia/app/src/main/res/drawable-xxhdpi/carta_oculta.png differ diff --git a/TolucaGraphics - copia/app/src/main/res/layout/activity_mesa_en_juego.xml b/TolucaGraphics - copia/app/src/main/res/layout/activity_mesa_en_juego.xml index 16dd633..de9bb21 100644 --- a/TolucaGraphics - copia/app/src/main/res/layout/activity_mesa_en_juego.xml +++ b/TolucaGraphics - copia/app/src/main/res/layout/activity_mesa_en_juego.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".MesaEnJuego"> + tools:context=".MesaJugando"> - - - - + + + app:layout_constraintEnd_toEndOf="parent"> - + - + - + - + - + - + - + - + - + - + - + - + + - - - - - - + + + - + + app:layout_constraintTop_toBottomOf="@+id/lobbyMesas" + app:layout_constraintBottom_toTopOf="@+id/btnCreaMesa"> + + + - + + + + + + + + + +