commit 80a4a23786f0e53355773b94233422515ccf14f0
Author: Fábio Oliveira Ceia <240405@MacBook-Pro-6.local>
Date: Thu Nov 6 16:22:13 2025 +0000
first commit
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..1ed260a
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+tcg
\ No newline at end of file
diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml
new file mode 100644
index 0000000..4a53bee
--- /dev/null
+++ b/.idea/AndroidProjectSystem.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..b86273d
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml
new file mode 100644
index 0000000..b268ef3
--- /dev/null
+++ b/.idea/deploymentTargetSelector.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml
new file mode 100644
index 0000000..91f9558
--- /dev/null
+++ b/.idea/deviceManager.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..97f0a8e
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/migrations.xml b/.idea/migrations.xml
new file mode 100644
index 0000000..f8051a6
--- /dev/null
+++ b/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..74dd639
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..16660f1
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
new file mode 100644
index 0000000..ed0a3d5
--- /dev/null
+++ b/app/build.gradle.kts
@@ -0,0 +1,44 @@
+plugins {
+ alias(libs.plugins.android.application)
+}
+
+android {
+ namespace = "com.example.tcg"
+ compileSdk {
+ version = release(36)
+ }
+
+ defaultConfig {
+ applicationId = "com.example.tcg"
+ minSdk = 24
+ targetSdk = 36
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
+ }
+}
+
+dependencies {
+ implementation(libs.appcompat)
+ implementation(libs.material)
+ implementation(libs.activity)
+ implementation(libs.constraintlayout)
+ testImplementation(libs.junit)
+ androidTestImplementation(libs.ext.junit)
+ androidTestImplementation(libs.espresso.core)
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/example/tcg/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/tcg/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..467079b
--- /dev/null
+++ b/app/src/androidTest/java/com/example/tcg/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.tcg;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.tcg", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..e64e81b
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/tcg/Carta.java b/app/src/main/java/com/example/tcg/Carta.java
new file mode 100644
index 0000000..ba68527
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/Carta.java
@@ -0,0 +1,45 @@
+package com.example.tcg;
+
+public class Carta {
+ private int id;
+ private String nome;
+ private String raridade;
+ private String imagem;
+
+ public Carta(String nome, String raridade, String imagem) {
+ this.nome = nome;
+ this.raridade = raridade;
+ this.imagem = imagem;
+ }
+
+
+ public Carta(int id, String nome, String raridade, String imagem) {
+ this.id = id;
+ this.nome = nome;
+ this.raridade = raridade;
+ this.imagem = imagem;
+ }
+
+ // Getters e Setters
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getNome() {
+ return nome;
+ }
+
+ public String getRaridade() {
+ return raridade;
+ }
+
+ public String getImagem() {
+ return imagem;
+ }
+}
+
+
diff --git a/app/src/main/java/com/example/tcg/CartaComProbabilidade.java b/app/src/main/java/com/example/tcg/CartaComProbabilidade.java
new file mode 100644
index 0000000..628d85f
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/CartaComProbabilidade.java
@@ -0,0 +1,21 @@
+package com.example.tcg;
+
+public class CartaComProbabilidade {
+ private Carta carta;
+ private double probabilidade;
+
+ public CartaComProbabilidade(Carta carta, double probabilidade) {
+ this.carta = carta;
+ this.probabilidade = probabilidade;
+ }
+
+ public Carta getCarta() {
+ return carta;
+ }
+
+ public double getProbabilidade() {
+ return probabilidade;
+ }
+}
+
+
diff --git a/app/src/main/java/com/example/tcg/ColecaoActivity.java b/app/src/main/java/com/example/tcg/ColecaoActivity.java
new file mode 100644
index 0000000..99ebd9f
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/ColecaoActivity.java
@@ -0,0 +1,291 @@
+package com.example.tcg;
+
+import android.app.AlertDialog;
+import android.content.Intent;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.GridView;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.tcg.adapters.CartaAdapter;
+import com.example.tcg.db.DbHelper;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class ColecaoActivity extends AppCompatActivity {
+
+ private GridView gridView;
+ private CartaAdapter adapter;
+ private ArrayList listaCartas;
+ private FloatingActionButton voltarBtn;
+ private TextView textoOuro;
+ private JogadorManager jogador;
+ private Spinner filtroSpinner;
+ private Button lojaBtn;
+ private Button venderTodasBtn;
+
+ private String raridadeSelecionada = "Todas";
+
+
+ private final String[] raridades = {"Todas", "Comum", "Incomum", "Rara", "Épica", "Lendária", "Especial"};
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ );
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_colecao);
+
+ gridView = findViewById(R.id.gridCartas);
+ voltarBtn = findViewById(R.id.voltarBtn);
+ textoOuro = findViewById(R.id.textoOuro);
+ filtroSpinner = findViewById(R.id.spinnerFiltro);
+ lojaBtn = findViewById(R.id.botaoLoja);
+ venderTodasBtn = findViewById(R.id.botaoVenderTodas);
+
+ jogador = new JogadorManager(this);
+
+ configurarFiltro();
+ carregarCartas();
+ atualizarOuro();
+
+ voltarBtn.setOnClickListener(v -> {
+ startActivity(new Intent(ColecaoActivity.this, MainActivity.class));
+ finish();
+ });
+
+ lojaBtn.setOnClickListener(v -> startActivity(new Intent(ColecaoActivity.this, LojaActivity.class)));
+
+ // O botão agora abre o novo diálogo com "Todas" incluída
+ venderTodasBtn.setOnClickListener(v -> abrirDialogSelecaoRaridades());
+ }
+
+ private void abrirDialogSelecaoRaridades() {
+ boolean[] selecionadas = new boolean[raridades.length];
+
+ new AlertDialog.Builder(this)
+ .setTitle("Seleciona as raridades a vender:")
+ .setMultiChoiceItems(raridades, selecionadas, (dialog, which, isChecked) -> {
+ // Se o jogador marcar "Todas", desmarca as outras
+ if (which == 0 && isChecked) {
+ for (int i = 1; i < selecionadas.length; i++) {
+ selecionadas[i] = false;
+ ((AlertDialog) dialog).getListView().setItemChecked(i, false);
+ }
+ } else if (which > 0 && isChecked) {
+ // Se marcar uma específica, desmarca "Todas"
+ selecionadas[0] = false;
+ ((AlertDialog) dialog).getListView().setItemChecked(0, false);
+ }
+ selecionadas[which] = isChecked;
+ })
+ .setPositiveButton("Vender", (dialog, which) -> {
+ List raridadesEscolhidas = new ArrayList<>();
+ for (int i = 0; i < raridades.length; i++) {
+ if (selecionadas[i]) {
+ raridadesEscolhidas.add(raridades[i]);
+ }
+ }
+
+ if (raridadesEscolhidas.isEmpty()) {
+ Toast.makeText(this, "Seleciona pelo menos uma raridade.", Toast.LENGTH_SHORT).show();
+ return;
+ }
+
+ // Se "Todas" for escolhida, ignora as outras e vende tudo
+ if (raridadesEscolhidas.contains("Todas")) {
+ confirmarVendaTodas();
+ } else {
+ confirmarVendaVariasRaridades(raridadesEscolhidas);
+ }
+ })
+ .setNegativeButton("Cancelar", null)
+ .show();
+ }
+
+ private void confirmarVendaTodas() {
+ new AlertDialog.Builder(this)
+ .setTitle("Confirmar venda")
+ .setMessage("Tens a certeza que queres vender TODAS as tuas cartas?")
+ .setPositiveButton("Sim", (dialog, which) -> venderTodas())
+ .setNegativeButton("Cancelar", null)
+ .show();
+ }
+
+ private void confirmarVendaVariasRaridades(List raridadesEscolhidas) {
+ new AlertDialog.Builder(this)
+ .setTitle("Confirmar venda")
+ .setMessage("Vender todas as cartas das raridades: " +
+ String.join(", ", raridadesEscolhidas) + "?")
+ .setPositiveButton("Sim", (dialog, which) -> venderVariasRaridades(raridadesEscolhidas))
+ .setNegativeButton("Cancelar", null)
+ .show();
+ }
+
+ private void venderTodas() {
+ int totalGanho = 0;
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getWritableDatabase();
+
+ for (Carta carta : new ArrayList<>(listaCartas)) {
+ totalGanho += calcularValorPorRaridade(carta.getRaridade());
+ db.delete("colecao", "id=?", new String[]{String.valueOf(carta.getId())});
+ }
+
+ listaCartas.clear();
+ db.close();
+
+ jogador.adicionarOuro(totalGanho);
+ adapter.notifyDataSetChanged();
+ atualizarOuro();
+
+ Toast.makeText(this, "Vendeste TODAS as cartas! +" +
+ JogadorManager.formatarOuro(totalGanho) + " ouro ganho!", Toast.LENGTH_LONG).show();
+ }
+
+ private void venderVariasRaridades(List raridadesEscolhidas) {
+ int totalGanho = 0;
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getWritableDatabase();
+
+ Iterator iterator = listaCartas.iterator();
+ while (iterator.hasNext()) {
+ Carta carta = iterator.next();
+ if (raridadesEscolhidas.contains(carta.getRaridade())) {
+ totalGanho += calcularValorPorRaridade(carta.getRaridade());
+ db.delete("colecao", "id=?", new String[]{String.valueOf(carta.getId())});
+ iterator.remove();
+ }
+ }
+ db.close();
+
+ jogador.adicionarOuro(totalGanho);
+ adapter.notifyDataSetChanged();
+ atualizarOuro();
+
+ Toast.makeText(this, "Vendeste cartas (" + JogadorManager.formatarOuro(totalGanho) +
+ " ouro ganho)", Toast.LENGTH_LONG).show();
+ }
+
+ private void atualizarOuro() {
+ textoOuro.setText("Ouro: " + JogadorManager.formatarOuro(jogador.getOuro()));
+ }
+
+ private void carregarCartas() {
+ listaCartas = new ArrayList<>();
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getReadableDatabase();
+
+ String query = "SELECT id, nome, raridade, imagem FROM colecao";
+ if (!raridadeSelecionada.equals("Todas")) {
+ query += " WHERE raridade='" + raridadeSelecionada + "'";
+ }
+
+ Cursor cursor = db.rawQuery(query, null);
+ if (cursor.moveToFirst()) {
+ do {
+ Carta carta = new Carta(
+ cursor.getInt(0),
+ cursor.getString(1),
+ cursor.getString(2),
+ cursor.getString(3)
+ );
+ listaCartas.add(carta);
+ } while (cursor.moveToNext());
+ }
+
+ cursor.close();
+ db.close();
+
+ adapter = new CartaAdapter(this, listaCartas, this::confirmarVendaCarta);
+ gridView.setAdapter(adapter);
+ }
+
+ private void confirmarVendaCarta(Carta carta) {
+ if (carta.getRaridade().equals("Épica") ||
+ carta.getRaridade().equals("Lendária") ||
+ carta.getRaridade().equals("Especial")) {
+
+ new AlertDialog.Builder(this)
+ .setTitle("Confirmar venda")
+ .setMessage("Tens a certeza que queres vender a carta " +
+ carta.getNome() + " (" + carta.getRaridade() + ")?")
+ .setPositiveButton("Sim", (dialog, which) -> venderCarta(carta))
+ .setNegativeButton("Cancelar", null)
+ .show();
+ } else {
+ venderCarta(carta);
+ }
+ }
+
+ private void venderCarta(Carta carta) {
+ int valorVenda = calcularValorPorRaridade(carta.getRaridade());
+ jogador.adicionarOuro(valorVenda);
+
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getWritableDatabase();
+ db.delete("colecao", "id=?", new String[]{String.valueOf(carta.getId())});
+ db.close();
+
+ listaCartas.remove(carta);
+ adapter.notifyDataSetChanged();
+ atualizarOuro();
+
+ Toast.makeText(this, "Carta vendida com sucesso!", Toast.LENGTH_SHORT).show();
+ }
+
+ private int calcularValorPorRaridade(String raridade) {
+ switch (raridade) {
+ case "Comum": return 10;
+ case "Incomum": return 25;
+ case "Rara": return 50;
+ case "Épica": return 100;
+ case "Lendária": return 200;
+ case "Especial": return 500;
+ default: return 0;
+ }
+ }
+
+ private void configurarFiltro() {
+ String[] opcoes = {"Todas", "Comum", "Incomum", "Rara", "Épica", "Lendária", "Especial"};
+ ArrayAdapter adapterFiltro = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, opcoes);
+ filtroSpinner.setAdapter(adapterFiltro);
+
+ filtroSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ raridadeSelecionada = opcoes[position];
+ carregarCartas();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {}
+ });
+ }
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/example/tcg/JogadorManager.java b/app/src/main/java/com/example/tcg/JogadorManager.java
new file mode 100644
index 0000000..4000daf
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/JogadorManager.java
@@ -0,0 +1,87 @@
+package com.example.tcg;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+public class JogadorManager {
+ private static final String PREFS_NAME = "jogador_prefs";
+
+ private static final String KEY_OURO = "ouro";
+ private static final String KEY_LIMITE_CARTAS = "limite_cartas";
+ private static final String KEY_MULTIPLICADOR_SORTE = "multiplicador_sorte";
+
+ private static final String CHAVE_PRECO_LIMITE = "preco_limite";
+ private static final String CHAVE_PRECO_SORTE = "preco_sorte";
+
+ private final SharedPreferences prefs;
+
+ public JogadorManager(Context context) {
+ prefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
+ }
+
+ // ========= OURO =========
+ public int getOuro() {
+ return prefs.getInt(KEY_OURO, 100);
+ }
+
+ public void adicionarOuro(int valor) {
+ prefs.edit().putInt(KEY_OURO, getOuro() + valor).apply();
+ }
+
+ public void removerOuro(int valor) {
+ prefs.edit().putInt(KEY_OURO, Math.max(0, getOuro() - valor)).apply();
+ }
+
+ // ========= LIMITE DE CARTAS =========
+ public int getLimiteCartas() {
+ return prefs.getInt(KEY_LIMITE_CARTAS, 5);
+ }
+
+ public void aumentarLimiteCartas() {
+ prefs.edit().putInt(KEY_LIMITE_CARTAS, getLimiteCartas() + 1).apply();
+ }
+
+ // ========= MULTIPLICADOR DE SORTE =========
+ public int getMultiplicadorSorte() {
+ return prefs.getInt(KEY_MULTIPLICADOR_SORTE, 1);
+ }
+
+ public void aumentarMultiplicadorSorte() {
+ int atual = getMultiplicadorSorte();
+ if (atual < 3) {
+ prefs.edit().putInt(KEY_MULTIPLICADOR_SORTE, atual + 1).apply();
+ }
+ }
+
+ // ========= PREÇOS DA LOJA =========
+ public int getPrecoLimite() {
+ return prefs.getInt(CHAVE_PRECO_LIMITE, 100);
+ }
+
+ public void salvarPrecoLimite(int preco) {
+ prefs.edit().putInt(CHAVE_PRECO_LIMITE, preco).apply();
+ }
+
+ public int getPrecoSorte() {
+ return prefs.getInt(CHAVE_PRECO_SORTE, 200);
+ }
+
+ public void salvarPrecoSorte(int preco) {
+ prefs.edit().putInt(CHAVE_PRECO_SORTE, preco).apply();
+ }
+
+ // ========= FORMATAÇÃO =========
+ public static String formatarOuro(int valor) {
+ if (valor >= 1_000_000_000)
+ return String.format("%.1fB", valor / 1_000_000_000.0);
+ else if (valor >= 1_000_000)
+ return String.format("%.1fM", valor / 1_000_000.0);
+ else if (valor >= 1_000)
+ return String.format("%.1fK", valor / 1_000.0);
+ else
+ return String.valueOf(valor);
+ }
+}
+
+
+
diff --git a/app/src/main/java/com/example/tcg/LojaActivity.java b/app/src/main/java/com/example/tcg/LojaActivity.java
new file mode 100644
index 0000000..75fa685
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/LojaActivity.java
@@ -0,0 +1,98 @@
+package com.example.tcg;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class LojaActivity extends AppCompatActivity {
+
+ private TextView ouroText, limiteText, sorteText;
+ private Button comprarLimiteBtn, comprarSorteBtn, voltarBtn;
+
+ private int precoLimite;
+ private int precoSorte;
+
+ private JogadorManager jogador;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_loja);
+
+ jogador = new JogadorManager(this);
+
+ ouroText = findViewById(R.id.ouroText);
+ limiteText = findViewById(R.id.limiteText);
+ sorteText = findViewById(R.id.sorteText);
+ comprarLimiteBtn = findViewById(R.id.comprarLimiteBtn);
+ comprarSorteBtn = findViewById(R.id.comprarSorteBtn);
+ voltarBtn = findViewById(R.id.voltarBtn);
+
+ // Recupera preços salvos
+ precoLimite = jogador.getPrecoLimite();
+ precoSorte = jogador.getPrecoSorte();
+
+ atualizarUI();
+
+ comprarLimiteBtn.setOnClickListener(v -> comprarLimite());
+ comprarSorteBtn.setOnClickListener(v -> comprarSorte());
+ voltarBtn.setOnClickListener(v -> {
+ startActivity(new Intent(LojaActivity.this, ColecaoActivity.class));
+ finish();
+ });
+ }
+
+ private void atualizarUI() {
+ ouroText.setText("Ouro: " + JogadorManager.formatarOuro(jogador.getOuro()));
+ limiteText.setText("Limite de cartas: " + jogador.getLimiteCartas());
+ sorteText.setText("Multiplicador de sorte: x" + jogador.getMultiplicadorSorte());
+
+ comprarLimiteBtn.setText("Aumentar limite (" + precoLimite + " ouro)");
+
+ if (jogador.getMultiplicadorSorte() >= 3) {
+ comprarSorteBtn.setEnabled(false);
+ comprarSorteBtn.setText("A tua sorte já está no nível máximo!");
+ } else {
+ comprarSorteBtn.setEnabled(true);
+ comprarSorteBtn.setText("Aumentar sorte (" + precoSorte + " ouro)");
+ }
+ }
+
+ private void comprarLimite() {
+ if (jogador.getOuro() >= precoLimite) {
+ jogador.removerOuro(precoLimite);
+ jogador.aumentarLimiteCartas();
+ precoLimite += 100;
+ jogador.salvarPrecoLimite(precoLimite);
+ Toast.makeText(this, "Limite aumentado!", Toast.LENGTH_SHORT).show();
+ atualizarUI();
+ } else {
+ Toast.makeText(this, "Ouro insuficiente!", Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ private void comprarSorte() {
+ if (jogador.getMultiplicadorSorte() >= 3) {
+ Toast.makeText(this, "Sorte já no máximo!", Toast.LENGTH_SHORT).show();
+ atualizarUI();
+ return;
+ }
+ if (jogador.getOuro() >= precoSorte) {
+ jogador.removerOuro(precoSorte);
+ jogador.aumentarMultiplicadorSorte();
+ precoSorte += 200;
+ jogador.salvarPrecoSorte(precoSorte);
+ Toast.makeText(this, "Multiplicador aumentado!", Toast.LENGTH_SHORT).show();
+ atualizarUI();
+ } else {
+ Toast.makeText(this, "Ouro insuficiente!", Toast.LENGTH_SHORT).show();
+ }
+ }
+}
+
+
+
diff --git a/app/src/main/java/com/example/tcg/MainActivity.java b/app/src/main/java/com/example/tcg/MainActivity.java
new file mode 100644
index 0000000..6dfa056
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/MainActivity.java
@@ -0,0 +1,52 @@
+package com.example.tcg;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+import androidx.activity.OnBackPressedCallback;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class MainActivity extends AppCompatActivity {
+
+ Button abrirPacotesButton, colecaoButton;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // Modo "FullScreen"
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ );
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ colecaoButton = findViewById(R.id.colecaoButton);
+ abrirPacotesButton = findViewById(R.id.abrirPacotesButton);
+
+ abrirPacotesButton.setOnClickListener(v -> {
+ Intent intent = new Intent(MainActivity.this, PacotesActivity.class);
+ startActivity(intent);
+ });
+
+ colecaoButton.setOnClickListener(v -> {
+ Intent intent = new Intent(MainActivity.this, ColecaoActivity.class);
+ startActivity(intent);
+ });
+
+ getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
+ @Override
+ public void handleOnBackPressed() {
+ // Minimiza a app
+ moveTaskToBack(true);
+ overridePendingTransition(0, 0);
+ }
+ });
+ }
+}
+
+
+
diff --git a/app/src/main/java/com/example/tcg/PacotesActivity.java b/app/src/main/java/com/example/tcg/PacotesActivity.java
new file mode 100644
index 0000000..d1ac534
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/PacotesActivity.java
@@ -0,0 +1,273 @@
+package com.example.tcg;
+
+import android.content.ContentValues;
+import android.content.Intent;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.Button;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.tcg.db.DbHelper;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PacotesActivity extends AppCompatActivity {
+
+ private FloatingActionButton voltarFloatingActionButton;
+ private Button botaoAbrirPacote;
+ private ImageView imagemPacote;
+ private TextView textoInventario;
+
+ private boolean pacoteAberto = false;
+ private List cartasDisponiveis;
+ private JogadorManager jogador;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ );
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_pacotes);
+
+ voltarFloatingActionButton = findViewById(R.id.voltarFloatingActionButton);
+ botaoAbrirPacote = findViewById(R.id.botaoAbrirPacote);
+ imagemPacote = findViewById(R.id.imagemPacote);
+ textoInventario = findViewById(R.id.textoInventario);
+
+ jogador = new JogadorManager(this);
+ atualizarInventario();
+
+ inicializarCartas();
+
+ voltarFloatingActionButton.setOnClickListener(v -> {
+ Intent intent = new Intent(PacotesActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ });
+
+ botaoAbrirPacote.setOnClickListener(v -> abrirPacote());
+ }
+
+ //Se quisermos inserir alguma carta nova é só colcoar aqui
+ private void inicializarCartas() {
+ cartasDisponiveis = new ArrayList<>();
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Catch'em All!", "Comum", "peaceful_morning"), 0.4));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Evolve", "Comum", "eevelutions"), 0.4));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Give It Your All", "Comum", "boyfriend"), 0.4));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Surgeon of Death", "Incomum", "surgeon"), 0.30));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Bites the Dust", "Incomum", "killerqueen"), 0.30));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Altruist Heart", "Incomum", "tanjiro"), 0.30));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("The Fastest Blue", "Rara", "sonicrevamp"), 0.20));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Ferrous Faker", "Rara", "fake"), 0.20));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Drums Of Liberation", "Épica", "luffy"), 0.10));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Aura Farmer", "Épica", "piccolo"), 0.10));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("The Crew", "Lendária", "thecrew"), 0.05));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Another Tale For the Next Dreamer", "Lendária", "lucydavid"), 0.05));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Bravery", "Especial", "bravery"), 0.005));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Kindness", "Especial", "kindness"), 0.005));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Integrity", "Especial", "integrity"), 0.005));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Perseverance", "Especial", "perseverance"), 0.005));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Determination", "Especial", "determination"), 0.005));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Patience", "Especial", "patience"), 0.005));
+ cartasDisponiveis.add(new CartaComProbabilidade(new Carta("Justice", "Especial", "justice"), 0.005));
+
+ }
+
+ //Tudo aquilo que acontece quando clicamos pra abrir pacote
+ private void abrirPacote() {
+ if (pacoteAberto) return;
+
+ int totalCartas = contarCartasNaColecao();
+ int limite = jogador.getLimiteCartas();
+
+ if (totalCartas >= limite) {
+ Toast.makeText(this, "⚠ Inventário cheio! Venda cartas ou aumente o limite na loja.", Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ pacoteAberto = true;
+ botaoAbrirPacote.setEnabled(false);
+
+ Carta cartaEscolhida = escolherCartaPorRaridade();
+ guardarCartaNaColecao(cartaEscolhida.getNome(), cartaEscolhida.getRaridade(), cartaEscolhida.getImagem());
+ mostrarCartaGanha(cartaEscolhida);
+ botaoAbrirPacote.setText("Abrir outro pacote");
+ botaoAbrirPacote.setEnabled(true);
+ pacoteAberto = false;
+ atualizarInventario();
+
+ }
+
+ private Carta escolherCartaPorRaridade() {
+ double random = Math.random();
+ double acumulado = 0.0;
+
+ int multiplicador = jogador.getMultiplicadorSorte();
+ List probAjustada = new ArrayList<>();
+ double soma = 0;
+
+ for (CartaComProbabilidade cartaProb : cartasDisponiveis) {
+ double chance = cartaProb.getProbabilidade();
+
+ if (cartaProb.getCarta().getRaridade().equals("Épica") ||
+ cartaProb.getCarta().getRaridade().equals("Lendária")) {
+ chance *= multiplicador;
+ }
+
+ probAjustada.add(chance);
+ soma += chance;
+ }
+
+ for (int i = 0; i < probAjustada.size(); i++) {
+ probAjustada.set(i, probAjustada.get(i) / soma);
+ }
+
+ for (int i = 0; i < cartasDisponiveis.size(); i++) {
+ acumulado += probAjustada.get(i);
+ if (random <= acumulado) {
+ return cartasDisponiveis.get(i).getCarta();
+ }
+ }
+
+ return cartasDisponiveis.get(cartasDisponiveis.size() - 1).getCarta();
+ }
+
+ private void guardarCartaNaColecao(String nome, String raridade, String imagem) {
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("nome", nome);
+ values.put("raridade", raridade);
+ values.put("imagem", imagem);
+
+ db.insert("colecao", null, values);
+ db.close();
+ }
+
+ private int contarCartasNaColecao() {
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getReadableDatabase();
+
+ Cursor cursor = db.rawQuery("SELECT COUNT(*) FROM colecao", null);
+ int count = 0;
+ if (cursor.moveToFirst()) count = cursor.getInt(0);
+ cursor.close();
+ db.close();
+ return count;
+ }
+
+ private void atualizarInventario() {
+ DbHelper dbHelper = new DbHelper(this);
+ SQLiteDatabase db = dbHelper.getReadableDatabase();
+
+ Cursor cursor = db.rawQuery("SELECT COUNT(*) FROM colecao", null);
+ int totalCartas = 0;
+ if (cursor.moveToFirst()) totalCartas = cursor.getInt(0);
+ cursor.close();
+ db.close();
+
+ int limite = jogador.getLimiteCartas();
+ textoInventario.setText("Inventário: " + totalCartas + " / " + limite);
+
+ if (totalCartas >= limite) {
+ textoInventario.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
+ textoInventario.setText("Inventário Cheio!");
+ } else {
+ textoInventario.setTextColor(getResources().getColor(android.R.color.black));
+ }
+ }
+ private void mostrarCartaGanha(Carta carta) {
+ // Mostra a carta depois de abrir pacote
+ FrameLayout container = findViewById(R.id.containerCartaObtida);
+ container.setVisibility(View.VISIBLE);
+ container.removeAllViews();
+
+ // Infla o layout da carta
+ View view = getLayoutInflater().inflate(R.layout.item_carta_ganha, container, false);
+
+ ImageView imagemCarta = view.findViewById(R.id.imagemCarta);
+ TextView textoNome = view.findViewById(R.id.textoNomeCarta);
+ TextView textoRaridade = view.findViewById(R.id.textoRaridade);
+ View cartaLayout = view.findViewById(R.id.cartaLayout);
+
+ // Define texto e imagem
+ textoNome.setText(carta.getNome());
+ textoRaridade.setText(carta.getRaridade());
+
+ int resId = getResources().getIdentifier(carta.getImagem(), "drawable", getPackageName());
+ imagemCarta.setImageResource(resId);
+
+ // Ajusta proporções da imagem
+ imagemCarta.setAdjustViewBounds(true);
+ imagemCarta.setScaleType(ImageView.ScaleType.FIT_CENTER);
+
+
+
+ // Aplica borda conforme raridade
+ switch (carta.getRaridade()) {
+ case "Comum":
+ cartaLayout.setBackgroundResource(R.drawable.borda_comum);
+ textoRaridade.setTextColor(Color.parseColor("#607D8B"));
+ break;
+ case "Incomum":
+ cartaLayout.setBackgroundResource(R.drawable.borda_incomum);
+ textoRaridade.setTextColor(Color.parseColor("#4CAF50"));
+ break;
+ case "Rara":
+ cartaLayout.setBackgroundResource(R.drawable.borda_rara);
+ textoRaridade.setTextColor(Color.parseColor("#7E57C2"));
+ break;
+ case "Épica":
+ cartaLayout.setBackgroundResource(R.drawable.borda_epica);
+ textoRaridade.setTextColor(Color.parseColor("#6A1B9A"));
+ break;
+ case "Lendária":
+ cartaLayout.setBackgroundResource(R.drawable.borda_lendaria);
+ textoRaridade.setTextColor(Color.parseColor("#FFD600"));
+ break;
+ case "Especial":
+ cartaLayout.setBackgroundResource(R.drawable.borda_especial);
+ textoRaridade.setTextColor(Color.parseColor("#ef736c"));
+ break;
+ }
+
+ // Animação (XML + interpolação)
+ Animation anim = AnimationUtils.loadAnimation(this, R.anim.reveal_card);
+ view.startAnimation(anim);
+ if (carta.getRaridade().equals("Lendária") || carta.getRaridade().equals("Especial")) {
+ view.setElevation(20f); // brilho leve da sombra
+ view.animate().rotationYBy(15).setDuration(300).withEndAction(() ->
+ view.animate().rotationY(0).setDuration(300)
+ ).start();
+ }
+ // Adiciona a carta ao container
+ container.addView(view);
+
+ }
+
+
+
+}
+
+
+
+
diff --git a/app/src/main/java/com/example/tcg/adapters/CartaAdapter.java b/app/src/main/java/com/example/tcg/adapters/CartaAdapter.java
new file mode 100644
index 0000000..11b763f
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/adapters/CartaAdapter.java
@@ -0,0 +1,207 @@
+package com.example.tcg.adapters;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.example.tcg.Carta;
+import com.example.tcg.R;
+
+import java.util.ArrayList;
+import java.util.function.Consumer;
+// Adaptador responsável por exibir uma lista de cartas em um ListView ou GridView
+public class CartaAdapter extends BaseAdapter {
+
+ private Context context; //contexto da activity onde a carta é usado
+ private ArrayList cartas; //listas de cartas a serem vendidas
+ private Consumer onVenderClick; //função a ser chamada quando clickado para vender
+
+
+ // Construtor do adaptador
+ public CartaAdapter(Context context, ArrayList cartas, Consumer onVenderClick) {
+ this.context = context;
+ this.cartas = cartas;
+ this.onVenderClick = onVenderClick;
+ }
+
+ @Override
+ public int getCount() {
+ return cartas.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return cartas.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ Carta carta = cartas.get(position);
+
+ if (convertView == null) {
+ convertView = LayoutInflater.from(context).inflate(R.layout.item_carta, parent, false);
+ }
+
+ ImageView imagemCarta = convertView.findViewById(R.id.imagemCarta);
+ TextView textoNome = convertView.findViewById(R.id.textoNomeCarta);
+ TextView textoRaridade = convertView.findViewById(R.id.textoRaridade);
+ Button botaoVender = convertView.findViewById(R.id.botaoVender);
+ View cartaLayout = convertView.findViewById(R.id.cartaLayout);
+
+ // Define nome e raridade
+ textoNome.setText(carta.getNome());
+ textoRaridade.setText(carta.getRaridade());
+
+ // Define imagem
+ int resId = context.getResources().getIdentifier(carta.getImagem(), "drawable", context.getPackageName());
+ imagemCarta.setImageResource(resId);
+
+ // Mostrar o valor no botão
+ int valor = getValorCarta(carta.getRaridade());
+ botaoVender.setText("Vender (" + valor + " ouro)");
+
+ // Define a cor/borda conforme raridade
+ switch (carta.getRaridade()) {
+ case "Comum":
+ textoRaridade.setTextColor(Color.parseColor("#607D8B")); // cinza azulado
+ cartaLayout.setBackgroundResource(R.drawable.borda_comum);
+ break;
+ case "Incomum":
+ textoRaridade.setTextColor(Color.parseColor("#4CAF50")); // verde elegante
+ cartaLayout.setBackgroundResource(R.drawable.borda_incomum);
+ break;
+ case "Rara":
+ textoRaridade.setTextColor(Color.parseColor("#7E57C2")); // roxo
+ cartaLayout.setBackgroundResource(R.drawable.borda_rara);
+ break;
+ case "Épica":
+ cartaLayout.setBackgroundResource(R.drawable.borda_epica);
+ textoRaridade.setTextColor(0xFF6A1B9A); // roxo vibrante
+ break;
+ case "Lendária":
+ cartaLayout.setBackgroundResource(R.drawable.borda_lendaria);
+ textoRaridade.setTextColor(0xFFFFD600); // dourado
+ break;
+ case "Especial":
+ cartaLayout.setBackgroundResource(R.drawable.borda_especial);
+ textoRaridade.setTextColor(0xFFFF7D7D); // vermelho
+ break;
+ }
+
+ // Clique com animação
+ botaoVender.setOnClickListener(v -> {
+ animarVenda(cartaLayout, () -> {
+ onVenderClick.accept(carta);
+ Toast.makeText(context, "Carta vendida!", Toast.LENGTH_SHORT).show();
+ });
+ });
+
+ imagemCarta.setOnClickListener(v -> mostrarCartaAmpliada(carta));
+ return convertView;
+ }
+
+ // Retorna o valor da carta conforme raridade
+ private int getValorCarta(String raridade) {
+ switch (raridade) {
+ case "Comum": return 10;
+ case "Incomum": return 25;
+ case "Rara": return 50;
+ case "Épica": return 100;
+ case "Lendária": return 200;
+ case "Especial": return 500;
+ default: return 0;
+ }
+ }
+
+ // Pequena animação ao vender (fade + scale)
+ private void animarVenda(View view, Runnable onComplete) {
+ view.animate()
+ .alpha(0f)
+ .scaleX(0.85f)
+ .scaleY(0.85f)
+ .setDuration(300)
+ .withEndAction(() -> {
+ view.setAlpha(1f);
+ view.setScaleX(1f);
+ view.setScaleY(1f);
+ onComplete.run();
+ })
+ .start();
+ }
+
+ private void mostrarCartaAmpliada(Carta carta) {
+ android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(context);
+ View dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_carta_ampliada, null);
+
+ ImageView imagemAmpliada = dialogView.findViewById(R.id.imagemCartaAmpliada);
+ TextView nomeAmpliado = dialogView.findViewById(R.id.nomeCartaAmpliada);
+ TextView raridadeAmpliada = dialogView.findViewById(R.id.raridadeCartaAmpliada);
+ View cartaLayout = dialogView.findViewById(R.id.cartaLayoutAmpliada); // container para a borda
+
+ nomeAmpliado.setText(carta.getNome());
+ raridadeAmpliada.setText(carta.getRaridade());
+
+ int resId = context.getResources().getIdentifier(carta.getImagem(), "drawable", context.getPackageName());
+ if (resId != 0) {
+ imagemAmpliada.setImageResource(resId);
+ }
+
+ // Define a borda conforme raridade (mesmo estilo da PacotesActivity)
+ switch (carta.getRaridade()) {
+ case "Comum":
+ cartaLayout.setBackgroundResource(R.drawable.borda_comum);
+ raridadeAmpliada.setTextColor(Color.parseColor("#607D8B"));
+ break;
+ case "Incomum":
+ cartaLayout.setBackgroundResource(R.drawable.borda_incomum);
+ raridadeAmpliada.setTextColor(Color.parseColor("#4CAF50"));
+ break;
+ case "Rara":
+ cartaLayout.setBackgroundResource(R.drawable.borda_rara);
+ raridadeAmpliada.setTextColor(Color.parseColor("#7E57C2"));
+ break;
+ case "Épica":
+ cartaLayout.setBackgroundResource(R.drawable.borda_epica);
+ raridadeAmpliada.setTextColor(Color.parseColor("#6A1B9A"));
+ break;
+ case "Lendária":
+ cartaLayout.setBackgroundResource(R.drawable.borda_lendaria);
+ raridadeAmpliada.setTextColor(Color.parseColor("#FFD600"));
+ break;
+ case "Especial":
+ cartaLayout.setBackgroundResource(R.drawable.borda_especial);
+ raridadeAmpliada.setTextColor(Color.parseColor("#ef736c"));
+ break;
+ }
+
+ builder.setView(dialogView);
+ android.app.AlertDialog dialog = builder.create();
+
+ // Fundo transparente e animação de entrada
+ if (dialog.getWindow() != null) {
+ dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
+ dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog;
+ }
+
+ dialog.show();
+ }
+
+
+}
+
+
+
+
+
diff --git a/app/src/main/java/com/example/tcg/db/DbHelper.java b/app/src/main/java/com/example/tcg/db/DbHelper.java
new file mode 100644
index 0000000..08d9384
--- /dev/null
+++ b/app/src/main/java/com/example/tcg/db/DbHelper.java
@@ -0,0 +1,41 @@
+package com.example.tcg.db;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+public class DbHelper extends SQLiteOpenHelper {
+
+ public static final int DATABASE_VERSION = 3; // incrementar no número da versão sempre que algo trocar aqui para resetar a anterior e comerçar com a versão nova
+ public static final String DATABASE_NAME = "TCG.db";
+
+ public static final String TABLE_COLECAO = "colecao";
+ public static final String COLUMN_ID = "id";
+ public static final String COLUMN_NOME = "nome";
+ public static final String COLUMN_RARIDADE = "raridade";
+
+ private static final String SQL_CREATE_COLECAO =
+ "CREATE TABLE " + TABLE_COLECAO + " (" +
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
+ COLUMN_NOME + " TEXT," +
+ COLUMN_RARIDADE + " TEXT," +
+ "imagem TEXT)";
+
+ private static final String SQL_DELETE_COLECAO =
+ "DROP TABLE IF EXISTS " + TABLE_COLECAO;
+
+ public DbHelper(Context context) {
+ super(context, DATABASE_NAME, null, DATABASE_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(SQL_CREATE_COLECAO);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ db.execSQL(SQL_DELETE_COLECAO);
+ onCreate(db);
+ }
+}
diff --git a/app/src/main/res/anim/fade_zoom_in.xml b/app/src/main/res/anim/fade_zoom_in.xml
new file mode 100644
index 0000000..ef9ef27
--- /dev/null
+++ b/app/src/main/res/anim/fade_zoom_in.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/anim/fade_zoom_out.xml b/app/src/main/res/anim/fade_zoom_out.xml
new file mode 100644
index 0000000..c84103d
--- /dev/null
+++ b/app/src/main/res/anim/fade_zoom_out.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/anim/reveal_card.xml b/app/src/main/res/anim/reveal_card.xml
new file mode 100644
index 0000000..8aa6838
--- /dev/null
+++ b/app/src/main/res/anim/reveal_card.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/backgroundcollection.jpg b/app/src/main/res/drawable/backgroundcollection.jpg
new file mode 100644
index 0000000..7bb3d4f
Binary files /dev/null and b/app/src/main/res/drawable/backgroundcollection.jpg differ
diff --git a/app/src/main/res/drawable/backgroundpackage.jpg b/app/src/main/res/drawable/backgroundpackage.jpg
new file mode 100644
index 0000000..b246925
Binary files /dev/null and b/app/src/main/res/drawable/backgroundpackage.jpg differ
diff --git a/app/src/main/res/drawable/backgroundrevamp.jpg b/app/src/main/res/drawable/backgroundrevamp.jpg
new file mode 100644
index 0000000..16951f1
Binary files /dev/null and b/app/src/main/res/drawable/backgroundrevamp.jpg differ
diff --git a/app/src/main/res/drawable/backrevamp.jpg b/app/src/main/res/drawable/backrevamp.jpg
new file mode 100644
index 0000000..6d11f72
Binary files /dev/null and b/app/src/main/res/drawable/backrevamp.jpg differ
diff --git a/app/src/main/res/drawable/bg_card.xml b/app/src/main/res/drawable/bg_card.xml
new file mode 100644
index 0000000..0047f8b
--- /dev/null
+++ b/app/src/main/res/drawable/bg_card.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/borda_comum.xml b/app/src/main/res/drawable/borda_comum.xml
new file mode 100644
index 0000000..9aee7ef
--- /dev/null
+++ b/app/src/main/res/drawable/borda_comum.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/borda_epica.xml b/app/src/main/res/drawable/borda_epica.xml
new file mode 100644
index 0000000..4a8dc6d
--- /dev/null
+++ b/app/src/main/res/drawable/borda_epica.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/borda_especial.xml b/app/src/main/res/drawable/borda_especial.xml
new file mode 100644
index 0000000..da7f55c
--- /dev/null
+++ b/app/src/main/res/drawable/borda_especial.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/borda_incomum.xml b/app/src/main/res/drawable/borda_incomum.xml
new file mode 100644
index 0000000..14ce79d
--- /dev/null
+++ b/app/src/main/res/drawable/borda_incomum.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/borda_lendaria.xml b/app/src/main/res/drawable/borda_lendaria.xml
new file mode 100644
index 0000000..26fadac
--- /dev/null
+++ b/app/src/main/res/drawable/borda_lendaria.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/borda_rara.xml b/app/src/main/res/drawable/borda_rara.xml
new file mode 100644
index 0000000..f29eab5
--- /dev/null
+++ b/app/src/main/res/drawable/borda_rara.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/botaocolectionimage.jpeg b/app/src/main/res/drawable/botaocolectionimage.jpeg
new file mode 100644
index 0000000..6a1c177
Binary files /dev/null and b/app/src/main/res/drawable/botaocolectionimage.jpeg differ
diff --git a/app/src/main/res/drawable/botaoopenimage.jpeg b/app/src/main/res/drawable/botaoopenimage.jpeg
new file mode 100644
index 0000000..7d2703e
Binary files /dev/null and b/app/src/main/res/drawable/botaoopenimage.jpeg differ
diff --git a/app/src/main/res/drawable/botaoplayimage.jpeg b/app/src/main/res/drawable/botaoplayimage.jpeg
new file mode 100644
index 0000000..3dc0e6f
Binary files /dev/null and b/app/src/main/res/drawable/botaoplayimage.jpeg differ
diff --git a/app/src/main/res/drawable/botaosellnimage.jpeg b/app/src/main/res/drawable/botaosellnimage.jpeg
new file mode 100644
index 0000000..efac3ba
Binary files /dev/null and b/app/src/main/res/drawable/botaosellnimage.jpeg differ
diff --git a/app/src/main/res/drawable/botaoshopnimage.jpeg b/app/src/main/res/drawable/botaoshopnimage.jpeg
new file mode 100644
index 0000000..bdbe7d0
Binary files /dev/null and b/app/src/main/res/drawable/botaoshopnimage.jpeg differ
diff --git a/app/src/main/res/drawable/boyfriend.jpg b/app/src/main/res/drawable/boyfriend.jpg
new file mode 100644
index 0000000..0352428
Binary files /dev/null and b/app/src/main/res/drawable/boyfriend.jpg differ
diff --git a/app/src/main/res/drawable/bravery.jpg b/app/src/main/res/drawable/bravery.jpg
new file mode 100644
index 0000000..454c5c3
Binary files /dev/null and b/app/src/main/res/drawable/bravery.jpg differ
diff --git a/app/src/main/res/drawable/determination.jpg b/app/src/main/res/drawable/determination.jpg
new file mode 100644
index 0000000..ea65396
Binary files /dev/null and b/app/src/main/res/drawable/determination.jpg differ
diff --git a/app/src/main/res/drawable/eevelutions.jpg b/app/src/main/res/drawable/eevelutions.jpg
new file mode 100644
index 0000000..b27716a
Binary files /dev/null and b/app/src/main/res/drawable/eevelutions.jpg differ
diff --git a/app/src/main/res/drawable/fake.jpg b/app/src/main/res/drawable/fake.jpg
new file mode 100644
index 0000000..37ce4d0
Binary files /dev/null and b/app/src/main/res/drawable/fake.jpg differ
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/integrity.jpg b/app/src/main/res/drawable/integrity.jpg
new file mode 100644
index 0000000..2ac3d08
Binary files /dev/null and b/app/src/main/res/drawable/integrity.jpg differ
diff --git a/app/src/main/res/drawable/justice.jpg b/app/src/main/res/drawable/justice.jpg
new file mode 100644
index 0000000..4e8f39b
Binary files /dev/null and b/app/src/main/res/drawable/justice.jpg differ
diff --git a/app/src/main/res/drawable/killerqueen.jpg b/app/src/main/res/drawable/killerqueen.jpg
new file mode 100644
index 0000000..9ed8a7e
Binary files /dev/null and b/app/src/main/res/drawable/killerqueen.jpg differ
diff --git a/app/src/main/res/drawable/kindness.jpg b/app/src/main/res/drawable/kindness.jpg
new file mode 100644
index 0000000..1b55f4e
Binary files /dev/null and b/app/src/main/res/drawable/kindness.jpg differ
diff --git a/app/src/main/res/drawable/lucydavid.jpg b/app/src/main/res/drawable/lucydavid.jpg
new file mode 100644
index 0000000..51bf781
Binary files /dev/null and b/app/src/main/res/drawable/lucydavid.jpg differ
diff --git a/app/src/main/res/drawable/luffy.png b/app/src/main/res/drawable/luffy.png
new file mode 100644
index 0000000..25e6a2e
Binary files /dev/null and b/app/src/main/res/drawable/luffy.png differ
diff --git a/app/src/main/res/drawable/nc.jpg b/app/src/main/res/drawable/nc.jpg
new file mode 100644
index 0000000..ff6e128
Binary files /dev/null and b/app/src/main/res/drawable/nc.jpg differ
diff --git a/app/src/main/res/drawable/open.jpg b/app/src/main/res/drawable/open.jpg
new file mode 100644
index 0000000..6b3db53
Binary files /dev/null and b/app/src/main/res/drawable/open.jpg differ
diff --git a/app/src/main/res/drawable/pacote.jpg b/app/src/main/res/drawable/pacote.jpg
new file mode 100644
index 0000000..5378b94
Binary files /dev/null and b/app/src/main/res/drawable/pacote.jpg differ
diff --git a/app/src/main/res/drawable/pacote_cartas.png b/app/src/main/res/drawable/pacote_cartas.png
new file mode 100644
index 0000000..0ccf2b7
Binary files /dev/null and b/app/src/main/res/drawable/pacote_cartas.png differ
diff --git a/app/src/main/res/drawable/pacoterevamp.jpg b/app/src/main/res/drawable/pacoterevamp.jpg
new file mode 100644
index 0000000..cdf80fe
Binary files /dev/null and b/app/src/main/res/drawable/pacoterevamp.jpg differ
diff --git a/app/src/main/res/drawable/patience.jpg b/app/src/main/res/drawable/patience.jpg
new file mode 100644
index 0000000..6c96f28
Binary files /dev/null and b/app/src/main/res/drawable/patience.jpg differ
diff --git a/app/src/main/res/drawable/peaceful_morning.png b/app/src/main/res/drawable/peaceful_morning.png
new file mode 100644
index 0000000..c0cebaa
Binary files /dev/null and b/app/src/main/res/drawable/peaceful_morning.png differ
diff --git a/app/src/main/res/drawable/perseverance.jpg b/app/src/main/res/drawable/perseverance.jpg
new file mode 100644
index 0000000..8bb6f66
Binary files /dev/null and b/app/src/main/res/drawable/perseverance.jpg differ
diff --git a/app/src/main/res/drawable/piccolo.png b/app/src/main/res/drawable/piccolo.png
new file mode 100644
index 0000000..6af9a31
Binary files /dev/null and b/app/src/main/res/drawable/piccolo.png differ
diff --git a/app/src/main/res/drawable/sellall.jpeg b/app/src/main/res/drawable/sellall.jpeg
new file mode 100644
index 0000000..c872b48
Binary files /dev/null and b/app/src/main/res/drawable/sellall.jpeg differ
diff --git a/app/src/main/res/drawable/shop.jpg b/app/src/main/res/drawable/shop.jpg
new file mode 100644
index 0000000..fffcce8
Binary files /dev/null and b/app/src/main/res/drawable/shop.jpg differ
diff --git a/app/src/main/res/drawable/sonicgroup.jpg b/app/src/main/res/drawable/sonicgroup.jpg
new file mode 100644
index 0000000..b799302
Binary files /dev/null and b/app/src/main/res/drawable/sonicgroup.jpg differ
diff --git a/app/src/main/res/drawable/sonicrevamp.png b/app/src/main/res/drawable/sonicrevamp.png
new file mode 100644
index 0000000..c5fa8c9
Binary files /dev/null and b/app/src/main/res/drawable/sonicrevamp.png differ
diff --git a/app/src/main/res/drawable/surgeon.jpg b/app/src/main/res/drawable/surgeon.jpg
new file mode 100644
index 0000000..0d7f184
Binary files /dev/null and b/app/src/main/res/drawable/surgeon.jpg differ
diff --git a/app/src/main/res/drawable/tanjiro.png b/app/src/main/res/drawable/tanjiro.png
new file mode 100644
index 0000000..cca2360
Binary files /dev/null and b/app/src/main/res/drawable/tanjiro.png differ
diff --git a/app/src/main/res/drawable/thecrew.jpg b/app/src/main/res/drawable/thecrew.jpg
new file mode 100644
index 0000000..9446837
Binary files /dev/null and b/app/src/main/res/drawable/thecrew.jpg differ
diff --git a/app/src/main/res/drawable/voltar.png b/app/src/main/res/drawable/voltar.png
new file mode 100644
index 0000000..ce2abcc
Binary files /dev/null and b/app/src/main/res/drawable/voltar.png differ
diff --git a/app/src/main/res/layout/activity_colecao.xml b/app/src/main/res/layout/activity_colecao.xml
new file mode 100644
index 0000000..7a26990
--- /dev/null
+++ b/app/src/main/res/layout/activity_colecao.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_loja.xml b/app/src/main/res/layout/activity_loja.xml
new file mode 100644
index 0000000..f0259e7
--- /dev/null
+++ b/app/src/main/res/layout/activity_loja.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..2d56e9f
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_pacotes.xml b/app/src/main/res/layout/activity_pacotes.xml
new file mode 100644
index 0000000..f10f828
--- /dev/null
+++ b/app/src/main/res/layout/activity_pacotes.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/dialog_carta_ampliada.xml b/app/src/main/res/layout/dialog_carta_ampliada.xml
new file mode 100644
index 0000000..8153b15
--- /dev/null
+++ b/app/src/main/res/layout/dialog_carta_ampliada.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/item_carta.xml b/app/src/main/res/layout/item_carta.xml
new file mode 100644
index 0000000..21e0c70
--- /dev/null
+++ b/app/src/main/res/layout/item_carta.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/item_carta_ganha.xml b/app/src/main/res/layout/item_carta_ganha.xml
new file mode 100644
index 0000000..33d01f1
--- /dev/null
+++ b/app/src/main/res/layout/item_carta_ganha.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..a5f6747
--- /dev/null
+++ b/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c8524cd
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..b834ac5
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+ tcg
+ TITULO BUE FODA
+ Abrir pacotes de cartas
+ Acessar coleção
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..4eea31a
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..4df9255
--- /dev/null
+++ b/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/example/tcg/ExampleUnitTest.java b/app/src/test/java/com/example/tcg/ExampleUnitTest.java
new file mode 100644
index 0000000..be541a2
--- /dev/null
+++ b/app/src/test/java/com/example/tcg/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.tcg;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..3756278
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,4 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ alias(libs.plugins.android.application) apply false
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..4387edc
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. For more details, visit
+# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..4bf5e48
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,22 @@
+[versions]
+agp = "8.13.0"
+junit = "4.13.2"
+junitVersion = "1.3.0"
+espressoCore = "3.7.0"
+appcompat = "1.7.1"
+material = "1.13.0"
+activity = "1.11.0"
+constraintlayout = "2.2.1"
+
+[libraries]
+junit = { group = "junit", name = "junit", version.ref = "junit" }
+ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
+espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
+appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
+material = { group = "com.google.android.material", name = "material", version.ref = "material" }
+activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
+constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
+
+[plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8bdaf60
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..8ed5194
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,8 @@
+#Sat Oct 25 14:01:04 WEST 2025
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..ef07e01
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,251 @@
+#!/bin/sh
+
+#
+# Copyright © 2015 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH="\\\"\\\""
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..5eed7ee
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,94 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..7f3737f
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,24 @@
+pluginManagement {
+ repositories {
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "tcg"
+include(":app")
+
\ No newline at end of file