Initial commit
This commit is contained in:
40
app/src/main/AndroidManifest.xml
Normal file
40
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.helldivers.app">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Helldivers"
|
||||
android:hardwareAccelerated="true"
|
||||
android:largeHeap="true">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".ActivityQR"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:parentActivityName=".MainActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".ActivityGame"
|
||||
android:screenOrientation="landscape"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:parentActivityName=".MainActivity" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
210
app/src/main/java/com/helldivers/app/ActivityGame.java
Normal file
210
app/src/main/java/com/helldivers/app/ActivityGame.java
Normal file
@@ -0,0 +1,210 @@
|
||||
package com.helldivers.app;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class ActivityGame extends AppCompatActivity {
|
||||
|
||||
private static final String[] ARROWS = new String[]{"\u2191", "\u2193", "\u2190", "\u2192"};
|
||||
private static final int UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3;
|
||||
|
||||
private static final int[][] STRATAGEMS = new int[][]{
|
||||
new int[]{UP, DOWN, RIGHT, LEFT, UP},
|
||||
new int[]{DOWN, DOWN, UP, RIGHT},
|
||||
new int[]{UP, DOWN, RIGHT, UP},
|
||||
new int[]{RIGHT, UP, UP, DOWN},
|
||||
new int[]{DOWN, UP, LEFT, DOWN, UP, RIGHT, DOWN, UP},
|
||||
new int[]{DOWN, UP, DOWN, UP},
|
||||
new int[]{DOWN, LEFT, DOWN, UP, RIGHT},
|
||||
new int[]{DOWN, LEFT, RIGHT, UP, DOWN},
|
||||
new int[]{DOWN, LEFT, DOWN, UP, UP, LEFT},
|
||||
new int[]{DOWN, DOWN, LEFT, UP, RIGHT},
|
||||
new int[]{DOWN, LEFT, RIGHT, RIGHT, LEFT},
|
||||
new int[]{DOWN, LEFT, UP, DOWN, UP},
|
||||
new int[]{DOWN, LEFT, DOWN, UP, UP, RIGHT},
|
||||
new int[]{DOWN, RIGHT, DOWN, UP, LEFT, RIGHT},
|
||||
new int[]{DOWN, DOWN, UP, DOWN, DOWN},
|
||||
new int[]{RIGHT, DOWN, LEFT, UP, UP},
|
||||
new int[]{RIGHT, RIGHT, RIGHT},
|
||||
new int[]{RIGHT, RIGHT, DOWN, LEFT, RIGHT, DOWN},
|
||||
new int[]{RIGHT, DOWN, UP, UP, LEFT, DOWN, DOWN},
|
||||
new int[]{RIGHT, DOWN, RIGHT, DOWN, RIGHT, DOWN},
|
||||
new int[]{RIGHT, DOWN, UP, RIGHT, DOWN},
|
||||
new int[]{RIGHT, UP, DOWN, DOWN, RIGHT},
|
||||
new int[]{UP, RIGHT, RIGHT},
|
||||
new int[]{UP, RIGHT, DOWN, RIGHT},
|
||||
new int[]{UP, RIGHT, DOWN, DOWN, RIGHT},
|
||||
new int[]{UP, RIGHT, DOWN, UP},
|
||||
new int[]{DOWN, UP, UP, DOWN, UP},
|
||||
new int[]{UP, RIGHT, DOWN, UP},
|
||||
new int[]{UP, RIGHT, UP, LEFT},
|
||||
new int[]{UP, RIGHT, DOWN, DOWN, DOWN},
|
||||
new int[]{UP, UP, LEFT, UP, RIGHT},
|
||||
new int[]{RIGHT, RIGHT, UP},
|
||||
new int[]{RIGHT, RIGHT, DOWN, RIGHT},
|
||||
new int[]{RIGHT, RIGHT, LEFT, DOWN},
|
||||
new int[]{RIGHT, RIGHT, DOWN, UP},
|
||||
new int[]{DOWN, UP, LEFT, RIGHT, RIGHT, LEFT},
|
||||
new int[]{DOWN, DOWN, LEFT, RIGHT, LEFT, RIGHT},
|
||||
new int[]{DOWN, UP, RIGHT, UP, LEFT, RIGHT},
|
||||
new int[]{DOWN, LEFT, UP, RIGHT},
|
||||
new int[]{DOWN, LEFT, DOWN, UP, UP, DOWN},
|
||||
new int[]{DOWN, LEFT, UP, LEFT, DOWN},
|
||||
new int[]{DOWN, LEFT, DOWN, UP, LEFT},
|
||||
new int[]{DOWN, LEFT, LEFT, DOWN},
|
||||
new int[]{UP, DOWN, LEFT, UP, RIGHT, RIGHT},
|
||||
new int[]{DOWN, LEFT, DOWN, DOWN, UP, LEFT},
|
||||
new int[]{DOWN, RIGHT, DOWN, UP, LEFT, LEFT},
|
||||
new int[]{DOWN, UP, LEFT, RIGHT, LEFT, RIGHT},
|
||||
new int[]{DOWN, UP, RIGHT, RIGHT, UP},
|
||||
new int[]{DOWN, UP, RIGHT, LEFT},
|
||||
new int[]{DOWN, UP, RIGHT, RIGHT, DOWN},
|
||||
new int[]{DOWN, UP, LEFT, UP, RIGHT, DOWN},
|
||||
new int[]{DOWN, UP, RIGHT, UP, LEFT, UP},
|
||||
new int[]{DOWN, UP, RIGHT, RIGHT, LEFT},
|
||||
new int[]{DOWN, UP, RIGHT, DOWN, RIGHT}
|
||||
};
|
||||
|
||||
private static final String[] NAMES = new String[]{
|
||||
"Reforzamiento", "Reabastecimiento", "Baliza SOS", "Artilleria", "Bomba Infernal",
|
||||
"Bandera", "Ametralladora", "Rifle material", "Leal", "Antitanque",
|
||||
"Rifle retroceso", "Echador llama", "Canon auto", "Canon riel", "Lanza",
|
||||
"Bombardeo", "Ataque aereo", "HE 120mm", "HE 380mm", "Aluvion",
|
||||
"Laser orbital", "Riel orbital", "Carrera", "Ataque", "Racimo",
|
||||
"Napalm", "Salto", "Humo", "Cohetes", "Bomba 500kg",
|
||||
"Rearme", "Precision", "Gas", "EMS", "Humo2",
|
||||
"HMG", "Escudo", "Tesla", "Minas", "Suministros",
|
||||
"Granadas", "Laser", "Incendiarias", "Rover", "Balistico",
|
||||
"Arco", "Escudo2", "Centinela1", "Centinela2", "Centinela3",
|
||||
"Guardian", "Centinela4", "Centinela5", "Centinela6", "Centinela7"
|
||||
};
|
||||
|
||||
private SoundManager soundManager;
|
||||
private Handler handler = new Handler();
|
||||
|
||||
private TextView tvSequence;
|
||||
private TextView tvCounter;
|
||||
private Button btnUp, btnDown, btnLeft, btnRight;
|
||||
private Button btnVolver;
|
||||
|
||||
private int[] sequence;
|
||||
private int playerIndex = 0;
|
||||
private int completadas = 0;
|
||||
private boolean esperando = false;
|
||||
private boolean juegoActivo = true;
|
||||
private String[] ultimosArrows;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_game);
|
||||
|
||||
try { soundManager = new SoundManager(this); }
|
||||
catch (Exception e) { soundManager = null; }
|
||||
|
||||
tvSequence = findViewById(R.id.tv_sequence);
|
||||
tvCounter = findViewById(R.id.tv_counter);
|
||||
btnUp = findViewById(R.id.btn_up);
|
||||
btnDown = findViewById(R.id.btn_down);
|
||||
btnLeft = findViewById(R.id.btn_left);
|
||||
btnRight = findViewById(R.id.btn_right);
|
||||
btnVolver = findViewById(R.id.btn_volver);
|
||||
|
||||
btnVolver.setOnClickListener(v -> finish());
|
||||
|
||||
if (btnUp != null) btnUp.setOnClickListener(v -> onInputWithSound(UP));
|
||||
if (btnDown != null) btnDown.setOnClickListener(v -> onInputWithSound(DOWN));
|
||||
if (btnLeft != null) btnLeft.setOnClickListener(v -> onInputWithSound(LEFT));
|
||||
if (btnRight != null) btnRight.setOnClickListener(v -> onInputWithSound(RIGHT));
|
||||
|
||||
nuevaRonda();
|
||||
}
|
||||
|
||||
private void nuevaRonda() {
|
||||
int idx = (int)(Math.random() * STRATAGEMS.length);
|
||||
sequence = STRATAGEMS[idx];
|
||||
playerIndex = 0;
|
||||
juegoActivo = true;
|
||||
ultimosArrows = new String[sequence.length];
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < sequence.length; i++) {
|
||||
int dir = sequence[i];
|
||||
ultimosArrows[i] = ARROWS[dir];
|
||||
sb.append(ultimosArrows[i]).append(" ");
|
||||
}
|
||||
if (tvSequence != null) {
|
||||
tvSequence.setText(sb.toString().trim());
|
||||
tvSequence.setTextColor(Color.parseColor("#FFD700"));
|
||||
}
|
||||
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
handler.postDelayed(() -> { esperando = true; }, 1200);
|
||||
}
|
||||
|
||||
private void onInputWithSound(int dir) {
|
||||
if (soundManager != null) {
|
||||
try { soundManager.playTone(dir); } catch (Exception e) {}
|
||||
}
|
||||
onInput(dir);
|
||||
}
|
||||
|
||||
private void onInput(int dir) {
|
||||
if (!juegoActivo || !esperando) return;
|
||||
|
||||
if (dir == sequence[playerIndex]) {
|
||||
playerIndex++;
|
||||
|
||||
if (tvSequence != null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < sequence.length; i++) {
|
||||
if (i < playerIndex) {
|
||||
sb.append("<font color='#00FF00'>").append(ultimosArrows[i]).append("</font> ");
|
||||
} else {
|
||||
sb.append(ultimosArrows[i]).append(" ");
|
||||
}
|
||||
}
|
||||
try {
|
||||
tvSequence.setText(android.text.Html.fromHtml(sb.toString()));
|
||||
} catch (Exception e) {
|
||||
tvSequence.setText(sb.toString().replaceAll("<[^>]*>", ""));
|
||||
}
|
||||
}
|
||||
|
||||
if (playerIndex >= sequence.length) {
|
||||
if (soundManager != null) {
|
||||
try { soundManager.playSuccess(); } catch (Exception e) {}
|
||||
}
|
||||
completadas++;
|
||||
if (tvCounter != null) tvCounter.setText(String.valueOf(completadas));
|
||||
if (tvSequence != null) {
|
||||
tvSequence.setText("OK!");
|
||||
tvSequence.setTextColor(Color.parseColor("#00FF00"));
|
||||
}
|
||||
esperando = false;
|
||||
handler.postDelayed(this::nuevaRonda, 1200);
|
||||
}
|
||||
} else {
|
||||
if (soundManager != null) {
|
||||
try { soundManager.playFailure(); } catch (Exception e) {}
|
||||
}
|
||||
if (tvSequence != null) {
|
||||
tvSequence.setText("X");
|
||||
tvSequence.setTextColor(Color.parseColor("#FF0000"));
|
||||
}
|
||||
juegoActivo = false;
|
||||
handler.postDelayed(this::nuevaRonda, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
if (soundManager != null) soundManager.release();
|
||||
}
|
||||
}
|
||||
88
app/src/main/java/com/helldivers/app/ActivityQR.java
Normal file
88
app/src/main/java/com/helldivers/app/ActivityQR.java
Normal file
@@ -0,0 +1,88 @@
|
||||
package com.helldivers.app;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.EncodeHintType;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ActivityQR extends AppCompatActivity {
|
||||
|
||||
private static final String INSTAGRAM_URL = "https://www.instagram.com/la_forja_gigante";
|
||||
private static final int QR_SIZE = 512;
|
||||
|
||||
private SoundManager soundManager;
|
||||
private ImageView qrImageView;
|
||||
private Button btnVolver;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_qr);
|
||||
|
||||
soundManager = new SoundManager(this);
|
||||
|
||||
qrImageView = findViewById(R.id.qr_image);
|
||||
btnVolver = findViewById(R.id.btn_volver);
|
||||
|
||||
generateAndDisplayQR();
|
||||
|
||||
if (btnVolver != null) {
|
||||
btnVolver.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
soundManager.playButtonClick();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void generateAndDisplayQR() {
|
||||
try {
|
||||
QRCodeWriter writer = new QRCodeWriter();
|
||||
Map<EncodeHintType, Object> hints = new HashMap<>();
|
||||
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
|
||||
|
||||
BitMatrix bitMatrix = writer.encode(INSTAGRAM_URL, BarcodeFormat.QR_CODE, QR_SIZE, QR_SIZE, hints);
|
||||
|
||||
int width = bitMatrix.getWidth();
|
||||
int height = bitMatrix.getHeight();
|
||||
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
|
||||
|
||||
int black = 0xFF000000;
|
||||
int white = 0xFFFFFFFF;
|
||||
|
||||
for (int x = 0; x < width; x++) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
bmp.setPixel(x, y, bitMatrix.get(x, y) ? black : white);
|
||||
}
|
||||
}
|
||||
|
||||
if (qrImageView != null) {
|
||||
qrImageView.setImageBitmap(bmp);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (soundManager != null) {
|
||||
soundManager.release();
|
||||
}
|
||||
if (qrImageView != null) {
|
||||
qrImageView.setImageBitmap(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
78
app/src/main/java/com/helldivers/app/MainActivity.java
Normal file
78
app/src/main/java/com/helldivers/app/MainActivity.java
Normal file
@@ -0,0 +1,78 @@
|
||||
package com.helldivers.app;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/**
|
||||
* Main Activity - Menu principal con tematica Helldivers 2
|
||||
* Optimizado para Samsung Galaxy S3 (720x1280 xhdpi, landscape)
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private SoundManager soundManager;
|
||||
private Button btnQrInstagram;
|
||||
private Button btnMinijuego;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// Inicializar SoundManager
|
||||
soundManager = new SoundManager(this);
|
||||
|
||||
// Referencias UI
|
||||
btnQrInstagram = findViewById(R.id.btn_qr_instagram);
|
||||
btnMinijuego = findViewById(R.id.btn_minijuego);
|
||||
|
||||
if (btnQrInstagram == null || btnMinijuego == null) {
|
||||
throw new RuntimeException("Button not found in layout");
|
||||
}
|
||||
|
||||
// Configurar listeners
|
||||
btnQrInstagram.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
soundManager.playButtonClick();
|
||||
Intent intent = new Intent(MainActivity.this, ActivityQR.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
btnMinijuego.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
soundManager.playButtonClick();
|
||||
Intent intent = new Intent(MainActivity.this, ActivityGame.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (soundManager != null) {
|
||||
soundManager.resume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (soundManager != null) {
|
||||
soundManager.pause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (soundManager != null) {
|
||||
soundManager.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
127
app/src/main/java/com/helldivers/app/SoundManager.java
Normal file
127
app/src/main/java/com/helldivers/app/SoundManager.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.helldivers.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.ToneGenerator;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
/**
|
||||
* SoundManager - Gestor de sonidos usando ToneGenerator
|
||||
* Compatible con API 18+, mas ligero que SoundPool para dispositivos de baja potencia
|
||||
*/
|
||||
public class SoundManager {
|
||||
|
||||
private static final int VOLUME = 80; // 0-100
|
||||
|
||||
private ToneGenerator toneGenerator;
|
||||
private Handler handler;
|
||||
private boolean enabled = true;
|
||||
|
||||
public SoundManager(Context context) {
|
||||
// ToneGenerator.STREAM_MUSIC para compatibilidad API 18+
|
||||
toneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, VOLUME);
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sonido de click de boton - tono corto y agudo
|
||||
*/
|
||||
public void playButtonClick() {
|
||||
if (!enabled || toneGenerator == null) return;
|
||||
// Tono DTMF 6 - sonido tipo boton tactil
|
||||
toneGenerator.startTone(ToneGenerator.TONE_DTMF_6, 80);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sonido de exito - secuencia ascendente
|
||||
*/
|
||||
public void playSuccess() {
|
||||
if (!enabled || toneGenerator == null) return;
|
||||
// Tono de confirmacion propositivo
|
||||
toneGenerator.startTone(ToneGenerator.TONE_PROP_ACK, 150);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sonido de fallo - tono bajo grave
|
||||
*/
|
||||
public void playFailure() {
|
||||
if (!enabled || toneGenerator == null) return;
|
||||
// Tono de error
|
||||
toneGenerator.startTone(ToneGenerator.TONE_PROP_NACK, 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tono para direcciones del juego
|
||||
* Usa diferentes tonos DTMF para cada direccion
|
||||
*/
|
||||
public void playTone(int direction) {
|
||||
if (!enabled || toneGenerator == null) return;
|
||||
|
||||
int tone;
|
||||
switch (direction) {
|
||||
case 0: // UP
|
||||
tone = ToneGenerator.TONE_DTMF_2;
|
||||
break;
|
||||
case 1: // DOWN
|
||||
tone = ToneGenerator.TONE_DTMF_8;
|
||||
break;
|
||||
case 2: // LEFT
|
||||
tone = ToneGenerator.TONE_DTMF_4;
|
||||
break;
|
||||
case 3: // RIGHT
|
||||
tone = ToneGenerator.TONE_DTMF_6;
|
||||
break;
|
||||
default:
|
||||
tone = ToneGenerator.TONE_DTMF_0;
|
||||
}
|
||||
toneGenerator.startTone(tone, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tono de inicio de secuencia
|
||||
*/
|
||||
public void playSequenceStart() {
|
||||
if (!enabled || toneGenerator == null) return;
|
||||
toneGenerator.startTone(ToneGenerator.TONE_SUP_DIAL, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tono de alerta/peligro
|
||||
*/
|
||||
public void playAlert() {
|
||||
if (!enabled || toneGenerator == null) return;
|
||||
toneGenerator.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, 150);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stub para compatibilidad con ciclo de vida Activity
|
||||
* ToneGenerator no necesita pause/resume explicito
|
||||
*/
|
||||
public void pause() {
|
||||
// No-op: ToneGenerator se maneja automaticamente
|
||||
}
|
||||
|
||||
/**
|
||||
* Stub para compatibilidad con ciclo de vida Activity
|
||||
* ToneGenerator no necesita pause/resume explicito
|
||||
*/
|
||||
public void resume() {
|
||||
// No-op: ToneGenerator se maneja automaticamente
|
||||
}
|
||||
|
||||
public void release() {
|
||||
if (toneGenerator != null) {
|
||||
toneGenerator.release();
|
||||
toneGenerator = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
7
app/src/main/res/drawable/bg_direction_center.xml
Normal file
7
app/src/main/res/drawable/bg_direction_center.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Centro del D-Pad decorativo -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#2C3138" />
|
||||
<stroke android:width="2dp" android:color="#FFD700" />
|
||||
</shape>
|
||||
21
app/src/main/res/drawable/bg_helldivers_gradient.xml
Normal file
21
app/src/main/res/drawable/bg_helldivers_gradient.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Fondo con gradiente vertical estilo Helldivers 2 -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:startColor="#0D0D0D"
|
||||
android:centerColor="#121417"
|
||||
android:endColor="#1B1F25"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- Subtle hex pattern overlay -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#05050505" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
9
app/src/main/res/drawable/bg_qr_container.xml
Normal file
9
app/src/main/res/drawable/bg_qr_container.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Contenedor del codigo QR -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#FFFFFF" />
|
||||
<corners android:radius="12dp" />
|
||||
<stroke android:width="3dp" android:color="#FFD700" />
|
||||
<padding android:left="16dp" android:top="16dp" android:right="16dp" android:bottom="16dp" />
|
||||
</shape>
|
||||
27
app/src/main/res/drawable/btn_direction.xml
Normal file
27
app/src/main/res/drawable/btn_direction.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Boton de direccion para D-Pad del juego -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFD700" />
|
||||
<corners android:radius="4dp" />
|
||||
<stroke android:width="2dp" android:color="#FFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00BFFF" />
|
||||
<corners android:radius="4dp" />
|
||||
<stroke android:width="2dp" android:color="#1E90FF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="4dp" />
|
||||
<stroke android:width="2dp" android:color="#FFD700" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
57
app/src/main/res/drawable/btn_helldivers_primary.xml
Normal file
57
app/src/main/res/drawable/btn_helldivers_primary.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Boton primario estilo Helldivers - Amarillo neon -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#2C3138" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:width="3dp" android:color="#FFE135" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="2dp" android:left="2dp" android:right="2dp" android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
</item>
|
||||
|
||||
<item android:state_focused="true">
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:width="2dp" android:color="#FFE135" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="2dp" android:left="2dp" android:right="2dp" android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:width="2dp" android:color="#FFD700" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="2dp" android:left="2dp" android:right="2dp" android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
</item>
|
||||
</selector>
|
||||
39
app/src/main/res/drawable/btn_helldivers_secondary.xml
Normal file
39
app/src/main/res/drawable/btn_helldivers_secondary.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Boton secundario estilo Helldivers - Azul neon -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#2C3138" />
|
||||
<corners android:radius="6dp" />
|
||||
<stroke android:width="2dp" android:color="#1E90FF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="1dp" android:left="1dp" android:right="1dp" android:bottom="1dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="6dp" />
|
||||
<stroke android:width="1dp" android:color="#00BFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="1dp" android:left="1dp" android:right="1dp" android:bottom="1dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#1B1F25" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
</item>
|
||||
</selector>
|
||||
12
app/src/main/res/drawable/ic_gamepad.xml
Normal file
12
app/src/main/res/drawable/ic_gamepad.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Icono Gamepad/Estratagemas -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#FFD700">
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M21,6H3c-1.1,0 -2,0.9 -2,2v8c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2V8C23,6.9 22.1,6 21,6zM11,13H8v3H6v-3H3v-2h3V8h2v3h3V13zM15.5,15c-0.83,0 -1.5,-0.67 -1.5,-1.5S14.67,12 15.5,12s1.5,0.67 1.5,1.5S16.33,15 15.5,15zM19.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S18.67,9 19.5,9s1.5,0.67 1.5,1.5S20.33,12 19.5,12z" />
|
||||
</vector>
|
||||
17
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
17
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Foreground del icono - Estilo Helldivers 2 -->
|
||||
<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="#FFD700"
|
||||
android:pathData="M54,28 L70,44 L70,64 L54,80 L38,64 L38,44 Z" />
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M54,36 L62,44 L62,60 L54,68 L46,60 L46,44 Z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M54,44 L58,48 L58,56 L54,60 L50,56 L50,48 Z" />
|
||||
</vector>
|
||||
39
app/src/main/res/drawable/ic_qr_code.xml
Normal file
39
app/src/main/res/drawable/ic_qr_code.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Icono QR simple -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#FFD700">
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M3,11h8V3H3V11zM5,5h4v4H5V5z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M13,3v8h8V3H13zM19,9h-4V5h4V9z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M3,21h8v-8H3V21zM5,15h4v4H5V15z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M13,13h2v2h-2z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M13,17h2v2h-2z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M17,13h2v4h-2z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M19,17h2v2h-2z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M19,13h2v2h-2z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M17,19h4v2h-4z" />
|
||||
<path
|
||||
android:fillColor="#FFD700"
|
||||
android:pathData="M13,19h2v2h-2z" />
|
||||
</vector>
|
||||
20
app/src/main/res/drawable/logo_helldivers_placeholder.xml
Normal file
20
app/src/main/res/drawable/logo_helldivers_placeholder.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Placeholder para logo Helldivers 2 - Estilo text based -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Fondo oscuro -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#0D0D0D" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- Borde amarillo -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00000000" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:width="3dp" android:color="#FFD700" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
14
app/src/main/res/drawable/logo_helldivers_text.xml
Normal file
14
app/src/main/res/drawable/logo_helldivers_text.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#0D0D0D" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#00000000" />
|
||||
<stroke android:width="2dp" android:color="#FFD700" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
153
app/src/main/res/layout/activity_game.xml
Normal file
153
app/src/main/res/layout/activity_game.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_helldivers_gradient">
|
||||
|
||||
<!-- Contador -->
|
||||
<TextView
|
||||
android:id="@+id/tv_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_margin="8dp"
|
||||
android:text="0"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#00FF00" />
|
||||
|
||||
<!-- Secuencia - arriba -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_counter_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/tv_counter"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:layout_toStartOf="@id/tv_counter"
|
||||
android:text="ESTRATAGEMAS: "
|
||||
android:textColor="#00FF00"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sequence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_above="@id/buttons_grid"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text=""
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FFD700" />
|
||||
|
||||
<!-- Botones - mas separadas -->
|
||||
<GridLayout
|
||||
android:id="@+id/buttons_grid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="48dp"
|
||||
android:rowCount="3"
|
||||
android:columnCount="3"
|
||||
android:padding="16dp">
|
||||
|
||||
<Space
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_row="0"
|
||||
android:layout_column="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_up"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_row="0"
|
||||
android:layout_column="1"
|
||||
android:background="@drawable/btn_direction"
|
||||
android:text="↑"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="36sp"
|
||||
android:layout_margin="6dp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_row="0"
|
||||
android:layout_column="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_left"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_row="1"
|
||||
android:layout_column="0"
|
||||
android:background="@drawable/btn_direction"
|
||||
android:text="←"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="36sp"
|
||||
android:layout_margin="6dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_down"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_row="1"
|
||||
android:layout_column="1"
|
||||
android:background="@drawable/btn_direction"
|
||||
android:text="↓"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="36sp"
|
||||
android:layout_margin="6dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_right"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_row="1"
|
||||
android:layout_column="2"
|
||||
android:background="@drawable/btn_direction"
|
||||
android:text="→"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="36sp"
|
||||
android:layout_margin="6dp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_row="2"
|
||||
android:layout_column="0" />
|
||||
|
||||
<Space
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_row="2"
|
||||
android:layout_column="1" />
|
||||
|
||||
<Space
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_row="2"
|
||||
android:layout_column="2" />
|
||||
|
||||
</GridLayout>
|
||||
|
||||
<!-- Volver -->
|
||||
<Button
|
||||
android:id="@+id/btn_volver"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="VOLVER"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#FFD700"
|
||||
android:background="@drawable/btn_helldivers_secondary"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingVertical="8dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
87
app/src/main/res/layout/activity_main.xml
Normal file
87
app/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_helldivers_gradient"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Logo Helldivers 2 - Area superior -->
|
||||
<TextView
|
||||
android:id="@+id/logo_helldivers"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="HELLDIVERS"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FFD700"
|
||||
android:fontFamily="monospace"
|
||||
android:shadowColor="#FF6B00"
|
||||
android:shadowDx="2"
|
||||
android:shadowDy="2"
|
||||
android:shadowRadius="4" />
|
||||
|
||||
<!-- Contenedor principal de botones -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="48dp">
|
||||
|
||||
<!-- Boton QR Instagram -->
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_qr_instagram"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:minHeight="72dp"
|
||||
android:text="@string/btn_qr_instagram"
|
||||
android:textColor="@color/helldivers_yellow"
|
||||
android:textSize="18sp"
|
||||
android:textAllCaps="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:background="@drawable/btn_helldivers_primary"
|
||||
android:drawableTop="@drawable/ic_qr_code"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:gravity="center" />
|
||||
|
||||
<!-- Boton Minijuego -->
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_minijuego"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="32dp"
|
||||
android:minHeight="72dp"
|
||||
android:text="@string/btn_minijuego"
|
||||
android:textColor="@color/helldivers_yellow"
|
||||
android:textSize="18sp"
|
||||
android:textAllCaps="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:background="@drawable/btn_helldivers_primary"
|
||||
android:drawableTop="@drawable/ic_gamepad"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Footer con version -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/app_version"
|
||||
android:textColor="@color/helldivers_gray"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="sans-serif-condensed" />
|
||||
|
||||
</LinearLayout>
|
||||
33
app/src/main/res/layout/activity_qr.xml
Normal file
33
app/src/main/res/layout/activity_qr.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_helldivers_gradient">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/qr_image"
|
||||
android:layout_width="440dp"
|
||||
android:layout_height="379dp"
|
||||
android:layout_above="@id/btn_volver"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="-48dp"
|
||||
android:background="#FFFFFF"
|
||||
android:contentDescription="@string/qr_description"
|
||||
android:padding="8dp"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_volver"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/btn_helldivers_secondary"
|
||||
android:paddingHorizontal="36dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:text="VOLVER"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Adaptive icon for API 26+ -->
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/helldivers_black" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Adaptive icon round for API 26+ -->
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/helldivers_black" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
10
app/src/main/res/mipmap-hdpi/ic_launcher.xml
Normal file
10
app/src/main/res/mipmap-hdpi/ic_launcher.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/helldivers_black" />
|
||||
<item
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/ic_launcher_foreground" />
|
||||
</item>
|
||||
</layer-list>
|
||||
10
app/src/main/res/mipmap-mdpi/ic_launcher.xml
Normal file
10
app/src/main/res/mipmap-mdpi/ic_launcher.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/helldivers_black" />
|
||||
<item
|
||||
android:width="36dp"
|
||||
android:height="36dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/ic_launcher_foreground" />
|
||||
</item>
|
||||
</layer-list>
|
||||
10
app/src/main/res/mipmap-xhdpi/ic_launcher.xml
Normal file
10
app/src/main/res/mipmap-xhdpi/ic_launcher.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/helldivers_black" />
|
||||
<item
|
||||
android:width="72dp"
|
||||
android:height="72dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/ic_launcher_foreground" />
|
||||
</item>
|
||||
</layer-list>
|
||||
10
app/src/main/res/mipmap-xxhdpi/ic_launcher.xml
Normal file
10
app/src/main/res/mipmap-xxhdpi/ic_launcher.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/helldivers_black" />
|
||||
<item
|
||||
android:width="96dp"
|
||||
android:height="96dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/ic_launcher_foreground" />
|
||||
</item>
|
||||
</layer-list>
|
||||
10
app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml
Normal file
10
app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/helldivers_black" />
|
||||
<item
|
||||
android:width="144dp"
|
||||
android:height="144dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/ic_launcher_foreground" />
|
||||
</item>
|
||||
</layer-list>
|
||||
9
app/src/main/res/raw/placeholder.txt
Normal file
9
app/src/main/res/raw/placeholder.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# Placeholder for sound files
|
||||
#
|
||||
# Add these sound files for full functionality:
|
||||
# - btn_click.mp3 : Sound for button clicks
|
||||
# - success.mp3 : Sound for game success
|
||||
# - failure.mp3 : Sound for game failure
|
||||
# - tone.mp3 : Base tone for game directions
|
||||
#
|
||||
# Currently using system sounds as fallback.
|
||||
14
app/src/main/res/values-v21/themes.xml
Normal file
14
app/src/main/res/values-v21/themes.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tema para API 21+ con mejor soporte de Material -->
|
||||
<style name="Theme.Helldivers" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/helldivers_dark_secondary</item>
|
||||
<item name="colorPrimaryDark">@color/helldivers_black</item>
|
||||
<item name="colorAccent">@color/helldivers_yellow</item>
|
||||
<item name="android:windowBackground">@color/helldivers_black</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:textColorPrimary">@color/helldivers_white</item>
|
||||
<item name="android:textColorSecondary">@color/helldivers_gray</item>
|
||||
</style>
|
||||
</resources>
|
||||
39
app/src/main/res/values/colors.xml
Normal file
39
app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Colores Helldivers 2 Theme -->
|
||||
|
||||
<!-- Colores principales -->
|
||||
<color name="helldivers_black">#000000</color>
|
||||
<color name="helldivers_dark_bg">#0D0D0D</color>
|
||||
<color name="helldivers_dark_secondary">#1B1F25</color>
|
||||
<color name="helldivers_dark_tertiary">#121417</color>
|
||||
|
||||
<!-- Colores neon/accent -->
|
||||
<color name="helldivers_yellow">#FFD700</color>
|
||||
<color name="helldivers_yellow_bright">#FFE135</color>
|
||||
<color name="helldivers_blue">#00BFFF</color>
|
||||
<color name="helldivers_blue_bright">#1E90FF</color>
|
||||
<color name="helldivers_red">#FF3B30</color>
|
||||
<color name="helldivers_red_bright">#FF6B6B</color>
|
||||
<color name="helldivers_orange">#FF8C00</color>
|
||||
|
||||
<!-- Colores texto -->
|
||||
<color name="helldivers_white">#FFFFFF</color>
|
||||
<color name="helldivers_gray">#8E8E93</color>
|
||||
<color name="helldivers_gray_light">#C7C7CC</color>
|
||||
|
||||
<!-- Colores botones -->
|
||||
<color name="btn_bg_dark">#1B1F25</color>
|
||||
<color name="btn_bg_pressed">#2C3138</color>
|
||||
<color name="btn_border_yellow">#FFD700</color>
|
||||
<color name="btn_border_blue">#00BFFF</color>
|
||||
|
||||
<!-- Colores genericos de sistema -->
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
||||
49
app/src/main/res/values/dimens.xml
Normal file
49
app/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Dimensiones optimizadas para Samsung Galaxy S3 (720x1280, xhdpi, 4.8")
|
||||
Orientacion landscape (1280x720 usable)
|
||||
-->
|
||||
|
||||
<!-- Espaciado base -->
|
||||
<dimen name="spacing_xs">4dp</dimen>
|
||||
<dimen name="spacing_s">8dp</dimen>
|
||||
<dimen name="spacing_m">12dp</dimen>
|
||||
<dimen name="spacing_l">16dp</dimen>
|
||||
<dimen name="spacing_xl">24dp</dimen>
|
||||
<dimen name="spacing_xxl">32dp</dimen>
|
||||
|
||||
<!-- Tamanos de texto -->
|
||||
<dimen name="text_xs">10sp</dimen>
|
||||
<dimen name="text_s">12sp</dimen>
|
||||
<dimen name="text_m">14sp</dimen>
|
||||
<dimen name="text_l">16sp</dimen>
|
||||
<dimen name="text_xl">18sp</dimen>
|
||||
<dimen name="text_xxl">22sp</dimen>
|
||||
<dimen name="text_title">24sp</dimen>
|
||||
|
||||
<!-- Tamanos de botones (minimo 48dp para accesibilidad) -->
|
||||
<dimen name="btn_height_small">48dp</dimen>
|
||||
<dimen name="btn_height_medium">56dp</dimen>
|
||||
<dimen name="btn_height_large">72dp</dimen>
|
||||
<dimen name="btn_width_medium">140dp</dimen>
|
||||
<dimen name="btn_width_large">180dp</dimen>
|
||||
|
||||
<!-- Logo -->
|
||||
<dimen name="logo_width">280dp</dimen>
|
||||
<dimen name="logo_height">120dp</dimen>
|
||||
<dimen name="logo_width_small">200dp</dimen>
|
||||
<dimen name="logo_height_small">80dp</dimen>
|
||||
|
||||
<!-- Contenedores -->
|
||||
<dimen name="container_padding">16dp</dimen>
|
||||
<dimen name="card_corner_radius">8dp</dimen>
|
||||
<dimen name="card_elevation">4dp</dimen>
|
||||
|
||||
<!-- QR -->
|
||||
<dimen name="qr_size">300dp</dimen>
|
||||
<dimen name="qr_padding">24dp</dimen>
|
||||
|
||||
<!-- Game -->
|
||||
<dimen name="dpad_button_size">64dp</dimen>
|
||||
<dimen name="dpad_spacing">8dp</dimen>
|
||||
</resources>
|
||||
33
app/src/main/res/values/strings.xml
Normal file
33
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<resources>
|
||||
<!-- App Info -->
|
||||
<string name="app_name">Helldivers Terminal</string>
|
||||
<string name="app_version">LIBERTY DEFENSE OS v1.0</string>
|
||||
|
||||
<!-- Descripciones -->
|
||||
<string name="logo_description">Logo Helldivers 2</string>
|
||||
|
||||
<!-- Botones Main -->
|
||||
<string name="btn_qr_instagram">Seguir en\nInstagram</string>
|
||||
<string name="btn_minijuego">Estratagemas\nTraining</string>
|
||||
<string name="btn_volver">VOLVER</string>
|
||||
|
||||
<!-- QR Activity -->
|
||||
<string name="qr_title">Codigo QR</string>
|
||||
<string name="qr_loading">Generando codigo QR...</string>
|
||||
<string name="qr_description">Codigo QR para Instagram</string>
|
||||
|
||||
<!-- Game Activity -->
|
||||
<string name="game_title">Entrenamiento de Estratagemas</string>
|
||||
<string name="game_score_initial">PUNTUACION: 0 | NIVEL: 1</string>
|
||||
<string name="game_status_ready">PREPARADO</string>
|
||||
<string name="game_status_watch">OBSERVA LA SECUENCIA</string>
|
||||
<string name="game_status_your_turn">TU TURNO</string>
|
||||
<string name="game_status_correct">CORRECTO!</string>
|
||||
<string name="game_status_fail">FALLASTE</string>
|
||||
|
||||
<!-- Flechas -->
|
||||
<string name="arrow_up">↑</string>
|
||||
<string name="arrow_down">↓</string>
|
||||
<string name="arrow_left">←</string>
|
||||
<string name="arrow_right">→</string>
|
||||
</resources>
|
||||
78
app/src/main/res/values/styles.xml
Normal file
78
app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Tema principal Helldivers 2 - Optimizado para API 18+ -->
|
||||
<style name="Theme.Helldivers" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Colores principales -->
|
||||
<item name="colorPrimary">@color/helldivers_dark_secondary</item>
|
||||
<item name="colorPrimaryDark">@color/helldivers_black</item>
|
||||
<item name="colorAccent">@color/helldivers_yellow</item>
|
||||
|
||||
<!-- Fondo -->
|
||||
<item name="android:windowBackground">@color/helldivers_black</item>
|
||||
|
||||
<!-- Sin action bar -->
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
<!-- Fullscreen para inmersivo -->
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
|
||||
<!-- Texto -->
|
||||
<item name="android:textColorPrimary">@color/helldivers_white</item>
|
||||
<item name="android:textColorSecondary">@color/helldivers_gray</item>
|
||||
|
||||
<!-- Botones -->
|
||||
<item name="colorButtonNormal">@color/btn_bg_dark</item>
|
||||
<item name="colorControlHighlight">@color/helldivers_yellow</item>
|
||||
</style>
|
||||
|
||||
<!-- Estilo base para botones Helldivers -->
|
||||
<style name="HelldiversButton" parent="Widget.AppCompat.Button">
|
||||
<item name="android:minHeight">48dp</item>
|
||||
<item name="android:textColor">@color/helldivers_yellow</item>
|
||||
</style>
|
||||
|
||||
<!-- Estilo para botones primarios Helldivers -->
|
||||
<style name="HelldiversButton.Primary" parent="HelldiversButton">
|
||||
<item name="android:background">@drawable/btn_helldivers_primary</item>
|
||||
<item name="android:textColor">@color/helldivers_yellow</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:minHeight">48dp</item>
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:paddingRight">16dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Estilo para botones secundarios -->
|
||||
<style name="HelldiversButton.Secondary" parent="HelldiversButton">
|
||||
<item name="android:background">@drawable/btn_helldivers_secondary</item>
|
||||
<item name="android:textColor">@color/helldivers_yellow</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:minHeight">40dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Estilo base para texto Helldivers -->
|
||||
<style name="HelldiversText">
|
||||
<item name="android:textColor">@color/helldivers_white</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
</style>
|
||||
|
||||
<!-- Estilo para texto de titulo -->
|
||||
<style name="HelldiversText.Title" parent="HelldiversText">
|
||||
<item name="android:textColor">@color/helldivers_yellow</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:fontFamily">sans-serif-condensed</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
</style>
|
||||
|
||||
<!-- Estilo para texto de cuerpo -->
|
||||
<style name="HelldiversText.Body" parent="HelldiversText">
|
||||
<item name="android:textColor">@color/helldivers_white</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user