first commit
|
|
@ -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
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
|
|
@ -0,0 +1 @@
|
|||
El Faro del Peregrino
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AppInsightsSettings">
|
||||
<option name="tabSettings">
|
||||
<map>
|
||||
<entry key="Firebase Crashlytics">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="PLACEHOLDER" />
|
||||
<option name="mobileSdkAppId" value="" />
|
||||
<option name="projectId" value="" />
|
||||
<option name="projectNumber" value="" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DeviceTable">
|
||||
<option name="columnSorters">
|
||||
<list>
|
||||
<ColumnSorterState>
|
||||
<option name="column" value="Name" />
|
||||
<option name="order" value="ASCENDING" />
|
||||
</ColumnSorterState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "es.tatvil.elfarodelperegrino"
|
||||
compileSdk {
|
||||
version = release(36) {
|
||||
minorApiLevel = 1
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "es.tatvil.elfarodelperegrino"
|
||||
minSdk = 27
|
||||
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)
|
||||
implementation("com.google.android.gms:play-services-location:21.3.0")
|
||||
implementation(libs.volley)
|
||||
implementation(libs.glide)
|
||||
annotationProcessor(libs.glide.compiler)
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("es.tatvil.elfarodelperegrino", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.ElFaroDelPeregrino">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".DetalleEtapaActivity"
|
||||
android:label="Detalle de la Etapa"
|
||||
android:parentActivityName=".MainActivity">
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Albergue implements Serializable {
|
||||
private String nombre, telefono, tipo, comentario;
|
||||
private double latitud, longitud;
|
||||
private boolean tieneCocina;
|
||||
|
||||
public Albergue(String nombre, String telefono, String tipo, double lat, double lon, boolean cocina, String comentario) {
|
||||
this.nombre = nombre;
|
||||
this.telefono = telefono;
|
||||
this.tipo = tipo;
|
||||
this.latitud = lat;
|
||||
this.longitud = lon;
|
||||
this.tieneCocina = cocina;
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
// Getters
|
||||
public String getNombre() { return nombre; }
|
||||
public String getTelefono() { return telefono; }
|
||||
public String getTipo() { return tipo; }
|
||||
public double getLatitud() { return latitud; }
|
||||
public double getLongitud() { return longitud; }
|
||||
public boolean isTieneCocina() { return tieneCocina; }
|
||||
public String getComentario() { return comentario; }
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class AlbergueAdapter extends RecyclerView.Adapter<AlbergueAdapter.AlbergueViewHolder> {
|
||||
|
||||
private List<Albergue> listaAlbergues;
|
||||
private double etapaLat, etapaLon;
|
||||
|
||||
public AlbergueAdapter(List<Albergue> listaAlbergues, double etapaLat, double etapaLon) {
|
||||
this.listaAlbergues = listaAlbergues;
|
||||
this.etapaLat = etapaLat;
|
||||
this.etapaLon = etapaLon;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AlbergueViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_albergue, parent, false);
|
||||
return new AlbergueViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AlbergueViewHolder holder, int position) {
|
||||
Albergue albergue = listaAlbergues.get(position);
|
||||
holder.tvNombre.setText(albergue.getNombre());
|
||||
holder.tvTipo.setText("Tipo: " + albergue.getTipo());
|
||||
holder.tvTelefono.setText("Tel: " + albergue.getTelefono());
|
||||
|
||||
float[] results = new float[1];
|
||||
android.location.Location.distanceBetween(etapaLat, etapaLon, albergue.getLatitud(), albergue.getLongitud(), results);
|
||||
float distanciaKm = results[0] / 1000;
|
||||
|
||||
holder.tvDistancia.setText(String.format(Locale.getDefault(), "A %.1f km del destino", distanciaKm));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listaAlbergues.size();
|
||||
}
|
||||
|
||||
public static class AlbergueViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvNombre, tvTipo, tvDistancia, tvTelefono;
|
||||
|
||||
public AlbergueViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvNombre = itemView.findViewById(R.id.tvAlbergueNombre);
|
||||
tvTipo = itemView.findViewById(R.id.tvAlbergueTipo);
|
||||
tvDistancia = itemView.findViewById(R.id.tvAlbergueDistancia);
|
||||
tvTelefono = itemView.findViewById(R.id.tvAlbergueTelefono);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import android.content.Context;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CaminoData {
|
||||
|
||||
private static String loadJSONFromRaw(Context context, int resourceId) {
|
||||
try {
|
||||
InputStream is = context.getResources().openRawResource(resourceId);
|
||||
int size = is.available();
|
||||
byte[] buffer = new byte[size];
|
||||
is.read(buffer);
|
||||
is.close();
|
||||
return new String(buffer, StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Etapa> getTodasLasEtapas(Context context) {
|
||||
List<Etapa> lista = new ArrayList<>();
|
||||
String json = loadJSONFromRaw(context, R.raw.etapas);
|
||||
if (json == null) return lista;
|
||||
try {
|
||||
JSONArray jsonArray = new JSONArray(json);
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
lista.add(new Etapa(
|
||||
obj.getString("nombre"),
|
||||
obj.optString("origen", ""),
|
||||
obj.optString("destino", ""),
|
||||
obj.optString("ruta", obj.optString("origen") + " - " + obj.optString("destino")),
|
||||
obj.optString("camino", "Norte"),
|
||||
obj.getDouble("distancia"),
|
||||
obj.optInt("dificultad", 0),
|
||||
obj.optString("reflexionEspiritual", obj.optString("reflexion", "")),
|
||||
obj.optString("hitoHistorico", obj.optString("historia", "")),
|
||||
obj.getDouble("latitud"),
|
||||
obj.getDouble("longitud")
|
||||
));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lista;
|
||||
}
|
||||
|
||||
public static List<Etapa> getEtapasPorCamino(Context context, String nombreCamino) {
|
||||
List<Etapa> todas = getTodasLasEtapas(context);
|
||||
List<Etapa> filtradas = new ArrayList<>();
|
||||
for (Etapa e : todas) {
|
||||
if (e.getCamino().equalsIgnoreCase(nombreCamino)) {
|
||||
filtradas.add(e);
|
||||
}
|
||||
}
|
||||
return filtradas;
|
||||
}
|
||||
|
||||
public static List<Albergue> getAlbergues(Context context) {
|
||||
List<Albergue> lista = new ArrayList<>();
|
||||
String json = loadJSONFromRaw(context, R.raw.albergues);
|
||||
if (json == null) return lista;
|
||||
try {
|
||||
JSONArray jsonArray = new JSONArray(json);
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
|
||||
// Manejo de servicios para determinar si tiene cocina
|
||||
boolean tieneCocina = false;
|
||||
JSONArray servicios = obj.optJSONArray("servicios");
|
||||
if (servicios != null) {
|
||||
for (int j = 0; j < servicios.length(); j++) {
|
||||
if (servicios.getString(j).equalsIgnoreCase("cocina")) {
|
||||
tieneCocina = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lista.add(new Albergue(
|
||||
obj.getString("nombre"),
|
||||
obj.optString("telefono", "Sin teléfono"),
|
||||
obj.optString("tipo", "Albergue"),
|
||||
obj.getDouble("latitud"),
|
||||
obj.getDouble("longitud"),
|
||||
tieneCocina,
|
||||
obj.optString("comentarioEspiritual", "")
|
||||
));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lista;
|
||||
}
|
||||
|
||||
public static List<Iglesia> getIglesias(Context context) {
|
||||
List<Iglesia> lista = new ArrayList<>();
|
||||
String json = loadJSONFromRaw(context, R.raw.iglesias);
|
||||
if (json == null) return lista;
|
||||
try {
|
||||
JSONArray jsonArray = new JSONArray(json);
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
lista.add(new Iglesia(
|
||||
obj.getString("nombre"),
|
||||
obj.getDouble("latitud"),
|
||||
obj.getDouble("longitud")
|
||||
));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lista;
|
||||
}
|
||||
|
||||
public static List<Restaurante> getRestaurantes(Context context) {
|
||||
List<Restaurante> lista = new ArrayList<>();
|
||||
String json = loadJSONFromRaw(context, R.raw.restaurantes);
|
||||
if (json == null) return lista;
|
||||
try {
|
||||
JSONArray jsonArray = new JSONArray(json);
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
lista.add(new Restaurante(
|
||||
obj.getString("nombre"),
|
||||
obj.getDouble("latitud"),
|
||||
obj.getDouble("longitud")
|
||||
));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lista;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.JsonObjectRequest;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DetalleEtapaActivity extends AppCompatActivity {
|
||||
|
||||
private static final String API_KEY = "69ef7f26726bba12b03c74b1e97b550f";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_detalle_etapa);
|
||||
|
||||
Etapa etapa = (Etapa) getIntent().getSerializableExtra("etapa");
|
||||
|
||||
if (etapa != null) {
|
||||
ImageView ivImagen = findViewById(R.id.ivDetalleImagen);
|
||||
TextView tvTitulo = findViewById(R.id.tvDetalleTitulo);
|
||||
TextView tvDistancia = findViewById(R.id.tvDetalleDistancia);
|
||||
TextView tvHistoria = findViewById(R.id.tvDetalleHistoria);
|
||||
TextView tvReflexion = findViewById(R.id.tvDetalleReflexion);
|
||||
TextView tvClima = findViewById(R.id.tvDetalleClima);
|
||||
|
||||
tvTitulo.setText(etapa.getOrigen() + " - " + etapa.getDestino());
|
||||
tvDistancia.setText("Distancia: " + etapa.getDistancia() + " km");
|
||||
tvHistoria.setText(etapa.getHitoHistorico());
|
||||
tvReflexion.setText(etapa.getReflexionEspiritual());
|
||||
|
||||
Glide.with(this)
|
||||
.load(etapa.getImagenUrl())
|
||||
.placeholder(android.R.drawable.ic_menu_gallery)
|
||||
.into(ivImagen);
|
||||
|
||||
obtenerClima(etapa.getLatitud(), etapa.getLongitud(), tvClima);
|
||||
|
||||
findViewById(R.id.btnVerClima).setOnClickListener(v ->
|
||||
obtenerClima(etapa.getLatitud(), etapa.getLongitud(), tvClima));
|
||||
|
||||
// Botón Albergues
|
||||
findViewById(R.id.btnVerAlbergues).setOnClickListener(v -> {
|
||||
List<Albergue> cercanos = filtrarAlbergues(CaminoData.getAlbergues(this), etapa);
|
||||
mostrarDialogoAlbergues("Albergues en " + etapa.getDestino(), cercanos, etapa);
|
||||
});
|
||||
|
||||
// Botón Iglesias
|
||||
findViewById(R.id.btnVerIglesias).setOnClickListener(v -> {
|
||||
List<Iglesia> todas = CaminoData.getIglesias(this);
|
||||
List<Iglesia> cercanas = new ArrayList<>();
|
||||
for(Iglesia i : todas) {
|
||||
if (calcularDistancia(etapa.getLatitud(), etapa.getLongitud(), i.getLatitud(), i.getLongitud()) < 10) {
|
||||
cercanas.add(i);
|
||||
}
|
||||
}
|
||||
if (cercanas.isEmpty()) {
|
||||
Toast.makeText(this, "No hay iglesias registradas cerca", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
mostrarDialogoSimple("Iglesias cercanas", cercanas);
|
||||
}
|
||||
});
|
||||
|
||||
// Botón Restaurantes
|
||||
findViewById(R.id.btnVerRestaurantes).setOnClickListener(v -> {
|
||||
List<Restaurante> todos = CaminoData.getRestaurantes(this);
|
||||
List<Restaurante> cercanos = new ArrayList<>();
|
||||
for(Restaurante r : todos) {
|
||||
if (calcularDistancia(etapa.getLatitud(), etapa.getLongitud(), r.getLatitud(), r.getLongitud()) < 10) {
|
||||
cercanos.add(r);
|
||||
}
|
||||
}
|
||||
if (cercanos.isEmpty()) {
|
||||
Toast.makeText(this, "No hay restaurantes registrados cerca", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
mostrarDialogoSimple("Restaurantes cercanos", cercanos);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Albergue> filtrarAlbergues(List<Albergue> todos, Etapa etapa) {
|
||||
List<Albergue> filtrados = new ArrayList<>();
|
||||
for (Albergue a : todos) {
|
||||
if (calcularDistancia(etapa.getLatitud(), etapa.getLongitud(), a.getLatitud(), a.getLongitud()) < 10) {
|
||||
filtrados.add(a);
|
||||
}
|
||||
}
|
||||
return filtrados;
|
||||
}
|
||||
|
||||
private void mostrarDialogoAlbergues(String titulo, List<Albergue> lista, Etapa etapa) {
|
||||
if (lista.isEmpty()) {
|
||||
Toast.makeText(this, "No hay albergues registrados cerca de " + etapa.getDestino(), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
View view = LayoutInflater.from(this).inflate(R.layout.dialog_lista_albergues, null);
|
||||
RecyclerView rv = view.findViewById(R.id.rvDialogo);
|
||||
rv.setLayoutManager(new LinearLayoutManager(this));
|
||||
rv.setAdapter(new AlbergueAdapter(lista, etapa.getLatitud(), etapa.getLongitud()));
|
||||
|
||||
builder.setTitle(titulo)
|
||||
.setView(view)
|
||||
.setPositiveButton("Cerrar", null)
|
||||
.show();
|
||||
}
|
||||
|
||||
private void mostrarDialogoSimple(String titulo, List<?> items) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object item : items) {
|
||||
if (item instanceof Iglesia) sb.append("• ").append(((Iglesia) item).getNombre()).append("\n");
|
||||
if (item instanceof Restaurante) sb.append("• ").append(((Restaurante) item).getNombre()).append("\n");
|
||||
}
|
||||
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle(titulo)
|
||||
.setMessage(sb.toString())
|
||||
.setPositiveButton("OK", null)
|
||||
.show();
|
||||
}
|
||||
|
||||
private double calcularDistancia(double lat1, double lon1, double lat2, double lon2) {
|
||||
float[] results = new float[1];
|
||||
Location.distanceBetween(lat1, lon1, lat2, lon2, results);
|
||||
return results[0] / 1000; // Retorna km
|
||||
}
|
||||
|
||||
private void obtenerClima(double lat, double lon, TextView tvClima) {
|
||||
String url = "https://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&appid=" + API_KEY + "&units=metric&lang=es";
|
||||
RequestQueue queue = Volley.newRequestQueue(this);
|
||||
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,
|
||||
response -> {
|
||||
try {
|
||||
JSONObject main = response.getJSONObject("main");
|
||||
double temp = main.getDouble("temp");
|
||||
String desc = response.getJSONArray("weather").getJSONObject(0).getString("description");
|
||||
tvClima.setText("Clima actual: " + temp + "°C, " + desc);
|
||||
} catch (JSONException e) {
|
||||
tvClima.setText("Error al procesar clima");
|
||||
}
|
||||
},
|
||||
error -> tvClima.setText("Error al obtener clima"));
|
||||
queue.add(request);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Etapa implements Serializable {
|
||||
private String nombre;
|
||||
private String origen;
|
||||
private String destino;
|
||||
private String ruta;
|
||||
private String camino;
|
||||
private double distancia;
|
||||
private int dificultad;
|
||||
private String reflexionEspiritual;
|
||||
private String hitoHistorico;
|
||||
private double latitud, longitud;
|
||||
private String imagenUrl;
|
||||
|
||||
public Etapa(String nombre, String origen, String destino, String ruta, String camino, double distancia,
|
||||
int dificultad, String reflexionEspiritual, String hitoHistorico,
|
||||
double latitud, double longitud) {
|
||||
this.nombre = nombre;
|
||||
this.origen = origen;
|
||||
this.destino = destino;
|
||||
this.ruta = ruta;
|
||||
this.camino = camino;
|
||||
this.distancia = distancia;
|
||||
this.dificultad = dificultad;
|
||||
this.reflexionEspiritual = reflexionEspiritual;
|
||||
this.hitoHistorico = hitoHistorico;
|
||||
this.latitud = latitud;
|
||||
this.longitud = longitud;
|
||||
this.imagenUrl = "https://picsum.photos/seed/" + nombre.replace(" ", "") + "/800/400";
|
||||
}
|
||||
|
||||
// Getters
|
||||
public String getImagenUrl() { return imagenUrl; }
|
||||
public void setImagenUrl(String imagenUrl) { this.imagenUrl = imagenUrl; }
|
||||
public String getNombre() { return nombre; }
|
||||
public String getOrigen() { return origen; }
|
||||
public String getDestino() { return destino; }
|
||||
public String getRuta() { return ruta; }
|
||||
public String getCamino() { return camino; }
|
||||
public double getDistancia() { return distancia; }
|
||||
public int getDificultad() { return dificultad; }
|
||||
public String getReflexionEspiritual() { return reflexionEspiritual; }
|
||||
public String getHitoHistorico() { return hitoHistorico; }
|
||||
public double getLatitud() { return latitud; }
|
||||
public double getLongitud() { return longitud; }
|
||||
|
||||
// Setters
|
||||
public void setNombre(String nombre) { this.nombre = nombre; }
|
||||
public void setOrigen(String origen) { this.origen = origen; }
|
||||
public void setDestino(String destino) { this.destino = destino; }
|
||||
public void setRuta(String ruta) { this.ruta = ruta; }
|
||||
public void setCamino(String camino) { this.camino = camino; }
|
||||
public void setDistancia(double distancia) { this.distancia = distancia; }
|
||||
public void setDificultad(int dificultad) { this.dificultad = dificultad; }
|
||||
public void setReflexionEspiritual(String reflexionEspiritual) { this.reflexionEspiritual = reflexionEspiritual; }
|
||||
public void setHitoHistorico(String hitoHistorico) { this.hitoHistorico = hitoHistorico; }
|
||||
public void setLatitud(double latitud) { this.latitud = latitud; }
|
||||
public void setLongitud(double longitud) { this.longitud = longitud; }
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import java.util.List;
|
||||
|
||||
public class EtapaAdapter extends RecyclerView.Adapter<EtapaAdapter.EtapaViewHolder> {
|
||||
|
||||
private List<Etapa> listaEtapas;
|
||||
|
||||
public EtapaAdapter(List<Etapa> listaEtapas) {
|
||||
this.listaEtapas = listaEtapas;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public EtapaViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_etapa, parent, false);
|
||||
return new EtapaViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull EtapaViewHolder holder, int position) {
|
||||
Etapa etapa = listaEtapas.get(position);
|
||||
String titulo = (position + 1) + ". " + etapa.getOrigen() + " - " + etapa.getDestino();
|
||||
holder.tvNombre.setText(titulo);
|
||||
holder.tvDistancia.setText(etapa.getDistancia() + " km");
|
||||
|
||||
Glide.with(holder.itemView.getContext())
|
||||
.load(etapa.getImagenUrl())
|
||||
.placeholder(android.R.drawable.ic_menu_gallery)
|
||||
.into(holder.ivMiniatura);
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(v.getContext(), DetalleEtapaActivity.class);
|
||||
intent.putExtra("etapa", etapa);
|
||||
v.getContext().startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listaEtapas.size();
|
||||
}
|
||||
|
||||
// El ViewHolder es el "molde" para los elementos de la vista
|
||||
public static class EtapaViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvNombre, tvDistancia;
|
||||
ImageView ivMiniatura;
|
||||
|
||||
public EtapaViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvNombre = itemView.findViewById(R.id.tvNombreEtapa);
|
||||
tvDistancia = itemView.findViewById(R.id.tvDistancia);
|
||||
ivMiniatura = itemView.findViewById(R.id.ivEtapaMiniatura);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Iglesia implements Serializable {
|
||||
private String nombre;
|
||||
private double latitud, longitud;
|
||||
|
||||
public Iglesia(String nombre, double latitud, double longitud) {
|
||||
this.nombre = nombre;
|
||||
this.latitud = latitud;
|
||||
this.longitud = longitud;
|
||||
}
|
||||
|
||||
public String getNombre() { return nombre; }
|
||||
public double getLatitud() { return latitud; }
|
||||
public double getLongitud() { return longitud; }
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private FusedLocationProviderClient fusedLocationClient;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// 1. SIEMPRE debes llamar al super y establecer la vista
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main); // Esto vincula el XML activity_main
|
||||
|
||||
// 2. Ahora sí, inicializamos el RecyclerView después de que la vista exista
|
||||
RecyclerView recyclerView = findViewById(R.id.recyclerViewEtapas);
|
||||
|
||||
// 3. Configuración del LayoutManager
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
// 4. Configuración del Spinner para seleccionar el camino
|
||||
Spinner spinner = findViewById(R.id.spinnerCaminos);
|
||||
String[] opcionesCaminos = {"Norte", "Francés"};
|
||||
|
||||
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this,
|
||||
android.R.layout.simple_spinner_item, opcionesCaminos);
|
||||
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner.setAdapter(spinnerAdapter);
|
||||
|
||||
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
String caminoSeleccionado = opcionesCaminos[position];
|
||||
actualizarListaEtapas(caminoSeleccionado, recyclerView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
});
|
||||
|
||||
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
obtenerUbicacionActual();
|
||||
}
|
||||
|
||||
private void actualizarListaEtapas(String camino, RecyclerView recyclerView) {
|
||||
List<Etapa> etapas = CaminoData.getEtapasPorCamino(this, camino);
|
||||
EtapaAdapter adapter = new EtapaAdapter(etapas);
|
||||
recyclerView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
private void obtenerUbicacionActual() {
|
||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
fusedLocationClient.getLastLocation().addOnSuccessListener(this, location -> {
|
||||
if (location != null) {
|
||||
double miLat = location.getLatitude();
|
||||
double miLon = location.getLongitude();
|
||||
// Aquí se compararía con las etapas
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == 1) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
obtenerUbicacionActual();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<Etapa> cargarEtapasDesdeJSON() {
|
||||
List<Etapa> lista = new ArrayList<>();
|
||||
try {
|
||||
InputStream is = getResources().openRawResource(R.raw.etapas);
|
||||
byte[] buffer = new byte[is.available()];
|
||||
is.read(buffer);
|
||||
is.close();
|
||||
String json = new String(buffer, "UTF-8");
|
||||
|
||||
JSONArray jsonArray = new JSONArray(json);
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
lista.add(new Etapa(
|
||||
obj.getString("nombre"),
|
||||
obj.optString("origen", ""),
|
||||
obj.optString("destino", ""),
|
||||
obj.optString("ruta", obj.optString("origen") + " - " + obj.optString("destino")),
|
||||
obj.optString("camino", "Norte"),
|
||||
obj.getDouble("distancia"),
|
||||
obj.optInt("dificultad", 0),
|
||||
obj.optString("reflexionEspiritual", obj.optString("reflexion", "")),
|
||||
obj.optString("hitoHistorico", obj.optString("historia", "")),
|
||||
obj.getDouble("latitud"),
|
||||
obj.getDouble("longitud")
|
||||
));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lista;
|
||||
}
|
||||
|
||||
private List<Etapa> leerEtapasDesdeRaw() {
|
||||
List<Etapa> lista = new ArrayList<>();
|
||||
try {
|
||||
// Abrimos el archivo etapas.json que debes crear en res/raw
|
||||
InputStream is = getResources().openRawResource(R.raw.etapas);
|
||||
int size = is.available();
|
||||
byte[] buffer = new byte[size];
|
||||
is.read(buffer);
|
||||
is.close();
|
||||
|
||||
String jsonString = new String(buffer, "UTF-8");
|
||||
JSONArray jsonArray = new JSONArray(jsonString);
|
||||
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject obj = jsonArray.getJSONObject(i);
|
||||
lista.add(new Etapa(
|
||||
obj.getString("nombre"),
|
||||
obj.optString("origen", ""),
|
||||
obj.optString("destino", ""),
|
||||
obj.optString("ruta", obj.optString("origen") + " - " + obj.optString("destino")),
|
||||
obj.optString("camino", "Norte"),
|
||||
obj.getDouble("distancia"),
|
||||
obj.optInt("dificultad", 0),
|
||||
obj.optString("reflexionEspiritual", obj.optString("reflexion", "")),
|
||||
obj.optString("hitoHistorico", obj.optString("historia", "")),
|
||||
obj.getDouble("latitud"),
|
||||
obj.getDouble("longitud")
|
||||
));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lista;
|
||||
}
|
||||
|
||||
// Método para calcular distancia entre dos puntos (Fórmula de Haversine simplificada)
|
||||
public double calcularDistancia(double lat1, double lon1, double lat2, double lon2) {
|
||||
double theta = lon1 - lon2;
|
||||
double dist = Math.sin(Math.toRadians(lat1)) * Math.sin(Math.toRadians(lat2)) +
|
||||
Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) *
|
||||
Math.cos(Math.toRadians(theta));
|
||||
dist = Math.acos(dist);
|
||||
dist = Math.toDegrees(dist);
|
||||
return dist * 60 * 1.1515 * 1.609344; // Retorna Kilómetros
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Restaurante implements Serializable {
|
||||
private String nombre;
|
||||
private double latitud, longitud;
|
||||
|
||||
public Restaurante(String nombre, double latitud, double longitud) {
|
||||
this.nombre = nombre;
|
||||
this.latitud = latitud;
|
||||
this.longitud = longitud;
|
||||
}
|
||||
|
||||
public String getNombre() { return nombre; }
|
||||
public double getLatitud() { return latitud; }
|
||||
public double getLongitud() { return longitud; }
|
||||
}
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/dark_background">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDetalleImagen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="#333333"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetalleTitulo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
android:text="Nombre de la Etapa"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetalleDistancia"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#BBBBBB"
|
||||
android:text="Distancia: 24 km"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Historia y Hitos"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetalleHistoria"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_primary"
|
||||
android:text="Cargando historia..."
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Reflexión Espiritual"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetalleReflexion"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_primary"
|
||||
android:text="Cargando reflexión..."
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetalleClima"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#FFEB3B"
|
||||
android:text="Clima: --"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnVerClima"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ver Clima Actual"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnVerAlbergues"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Albergues Cercanos"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnVerIglesias"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Iglesias y Monumentos"
|
||||
android:layout_marginBottom="8dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnVerRestaurantes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Restaurantes"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerCaminos"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@android:drawable/btn_dropdown"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerViewEtapas"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/dark_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/spinnerCaminos"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvDialogo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp" />
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView 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="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardBackgroundColor="@color/dark_surface">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbergueNombre"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
android:text="Nombre del Albergue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbergueTipo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#BBBBBB"
|
||||
android:text="Tipo: Municipal"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbergueDistancia"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#FFEB3B"
|
||||
android:text="A 1.2 km de la etapa"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbergueTelefono"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:text="Tel: +34 000 000 000"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@color/dark_surface">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<ImageView
|
||||
android:id="@+id/ivEtapaMiniatura"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="#333333"/>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNombreEtapa"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:text="1. Origen - Destino"
|
||||
android:textColor="@color/text_primary"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDistancia"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.0 km"
|
||||
android:textColor="#757575"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
|
@ -0,0 +1,63 @@
|
|||
[
|
||||
{
|
||||
"nombre": "Albergue Monasterio de La Magdalena",
|
||||
"telefono": "+34982533568",
|
||||
"latitud": 42.77919,
|
||||
"longitud": -7.42142,
|
||||
"servicios": [ "cocina", "lavanderia", "internet", "capilla" ]
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue La Casona",
|
||||
"telefono": "+34982533568",
|
||||
"latitud": 42.78126,
|
||||
"longitud": -7.42079
|
||||
},
|
||||
{
|
||||
"nombre": "Hostel Andaina",
|
||||
"telefono": "+34628232103",
|
||||
"latitud": 42.78366,
|
||||
"longitud": -7.41780,
|
||||
"servicios": [ "cocina", "duchas" ]
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue-Restaurante Casa Cruceiro de Ferreiros",
|
||||
"telefono": "+34982541240",
|
||||
"latitud": 42.78360,
|
||||
"longitud": -7.53327
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue Ferramenteiro",
|
||||
"telefono": "+34982545362",
|
||||
"latitud": 42.806058534927566,
|
||||
"longitud": -7.618350683684074
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue y Pensión San Marcos",
|
||||
"telefono": "+34982380711",
|
||||
"latitud": 42.87273765561729,
|
||||
"longitud": -7.867945993822368
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue San Antón",
|
||||
"telefono": "+34698153672",
|
||||
"latitud": 42.914956239247715,
|
||||
"longitud": -8.017238007962227
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue Los Tres Abetos",
|
||||
"latitud": 42.93049593906094,
|
||||
"longitud": -8.152886126990555
|
||||
},
|
||||
{
|
||||
"nombre": "Pensión23 - Vinte e tres",
|
||||
"telefono": "+34667570012",
|
||||
"latitud": 42.90283892120907,
|
||||
"longitud": -8.362711036495853
|
||||
},
|
||||
{
|
||||
"nombre": "Albergue Cruceiro de Pedrouzo",
|
||||
"telefono": "+34981511371",
|
||||
"latitud": 42.902985030005205,
|
||||
"longitud": -8.362755160016018
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
[
|
||||
{
|
||||
"nombre": "Etapa 1",
|
||||
"origen": "Irún",
|
||||
"destino": "San Sebastián",
|
||||
"distancia": 24.8,
|
||||
"latitud": 43.339,
|
||||
"longitud": -1.789,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 2",
|
||||
"origen": "San Sebastián",
|
||||
"destino": "Zarautz",
|
||||
"distancia": 22.2,
|
||||
"latitud": 43.312,
|
||||
"longitud": -1.974,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 3",
|
||||
"origen": "Zarautz",
|
||||
"destino": "Deba",
|
||||
"distancia": 21.8,
|
||||
"latitud": 43.284,
|
||||
"longitud": -2.174,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 4",
|
||||
"origen": "Deba",
|
||||
"destino": "Markina-Xemein",
|
||||
"distancia": 24.0,
|
||||
"latitud": 43.295,
|
||||
"longitud": -2.355,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 5",
|
||||
"origen": "Markina-Xemein",
|
||||
"destino": "Gernika-Lumo",
|
||||
"distancia": 24.6,
|
||||
"latitud": 43.268,
|
||||
"longitud": -2.497,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 6",
|
||||
"origen": "Gernika-Lumo",
|
||||
"destino": "Lezama",
|
||||
"distancia": 20.8,
|
||||
"latitud": 43.316,
|
||||
"longitud": -2.679,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 7",
|
||||
"origen": "Lezama",
|
||||
"destino": "Bilbao",
|
||||
"distancia": 10.8,
|
||||
"latitud": 43.271,
|
||||
"longitud": -2.834,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 8",
|
||||
"origen": "Bilbao",
|
||||
"destino": "Portugalete",
|
||||
"distancia": 19.4,
|
||||
"latitud": 43.263,
|
||||
"longitud": -2.935,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 9",
|
||||
"origen": "Portugalete",
|
||||
"destino": "Pobeña",
|
||||
"distancia": 12.0,
|
||||
"latitud": 43.321,
|
||||
"longitud": -3.018,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Etapa 10",
|
||||
"origen": "Pobeña",
|
||||
"destino": "Castro Urdiales",
|
||||
"distancia": 13.5,
|
||||
"latitud": 43.348,
|
||||
"longitud": -3.125,
|
||||
"camino": "Norte"
|
||||
},
|
||||
{
|
||||
"nombre": "Sarria - Portomarín",
|
||||
"origen": "Sarria",
|
||||
"destino": "Portomarín",
|
||||
"distancia": 22.2,
|
||||
"latitud": 42.776,
|
||||
"longitud": -7.416,
|
||||
"camino": "Francés",
|
||||
"historia": "Sarria es el punto de inicio mínimo para obtener la Compostela.",
|
||||
"reflexion": "Hoy doy el primer paso con alegría y determinación."
|
||||
},
|
||||
{
|
||||
"nombre": "Portomarín - Palas de Rei",
|
||||
"origen": "Portomarín",
|
||||
"destino": "Palas de Rei",
|
||||
"distancia": 24.8,
|
||||
"latitud": 42.808,
|
||||
"longitud": -7.618,
|
||||
"camino": "Francés",
|
||||
"historia": "Se atraviesan los Montes de Ligonde con su famoso crucero.",
|
||||
"reflexion": "La subida me recuerda que el esfuerzo precede a la recompensa."
|
||||
},
|
||||
{
|
||||
"nombre": "Palas de Rei - Arzúa",
|
||||
"origen": "Palas de Rei",
|
||||
"destino": "Arzúa",
|
||||
"distancia": 28.5,
|
||||
"latitud": 42.873,
|
||||
"longitud": -7.869,
|
||||
"camino": "Francés",
|
||||
"historia": "Arzúa es famosa por sus quesos y por la unión del Camino del Norte.",
|
||||
"reflexion": "Donde los caminos se unen, las historias se comparten."
|
||||
},
|
||||
{
|
||||
"nombre": "Arzúa - O Pedrouzo",
|
||||
"origen": "Arzúa",
|
||||
"destino": "O Pedrouzo",
|
||||
"distancia": 19.3,
|
||||
"latitud": 42.926,
|
||||
"longitud": -8.163,
|
||||
"camino": "Francés",
|
||||
"historia": "Caminamos por frondosos bosques de eucaliptos gallegos.",
|
||||
"reflexion": "El aroma del bosque purifica mis pensamientos."
|
||||
},
|
||||
{
|
||||
"nombre": "O Pedrouzo - Santiago",
|
||||
"origen": "O Pedrouzo",
|
||||
"destino": "Santiago de Compostela",
|
||||
"distancia": 19.4,
|
||||
"latitud": 42.913,
|
||||
"longitud": -8.361,
|
||||
"camino": "Francés",
|
||||
"historia": "Llegada al Monte del Gozo y finalmente a la Catedral.",
|
||||
"reflexion": "Al fin, el abrazo al Apóstol y la paz del camino cumplido."
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
[
|
||||
{
|
||||
"nombre": "Iglesia de Santiago de Barbadelo",
|
||||
"latitud": 42.77145,
|
||||
"longitud": -7.44823
|
||||
},
|
||||
{
|
||||
"nombre": "Iglesia de San Tirso de Palas de Rei",
|
||||
"latitud": 42.87252339376324,
|
||||
"longitud": -7.867988909161996
|
||||
},
|
||||
{
|
||||
"nombre": "Catedral de Santiago de Compostela",
|
||||
"latitud": 42.88130509331078,
|
||||
"longitud": -8.5446667965316
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
[
|
||||
{
|
||||
"nombre": "Pulperia A Garnacha",
|
||||
"latitud": 42.91390034545274,
|
||||
"longitud": -8.011660067243549
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.ElFaroDelPeregrino" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Colores principales espirituales -->
|
||||
<item name="colorPrimary">@color/maritime_blue_mary</item>
|
||||
<item name="colorOnPrimary">@color/maritime_blue_deep</item>
|
||||
<item name="colorPrimaryContainer">@color/maritime_blue_deep</item>
|
||||
<item name="colorOnPrimaryContainer">@color/maritime_blue_mary</item>
|
||||
|
||||
<item name="colorSecondary">@color/spiritual_gold</item>
|
||||
<item name="colorOnSecondary">@color/spiritual_black</item>
|
||||
|
||||
<!-- Fondo y superficies -->
|
||||
<item name="android:windowBackground">@color/spiritual_black</item>
|
||||
<item name="colorSurface">@color/spiritual_surface</item>
|
||||
<item name="colorOnSurface">@color/spiritual_text_bright</item>
|
||||
<item name="colorSurfaceVariant">@color/maritime_blue_deep</item>
|
||||
<item name="colorOnSurfaceVariant">@color/spiritual_text_dim</item>
|
||||
|
||||
<!-- Acentos -->
|
||||
<item name="colorOutline">@color/spiritual_gold</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
|
||||
<!-- Spiritual Dark Theme Colors -->
|
||||
<color name="spiritual_black">#050505</color>
|
||||
<color name="maritime_blue_deep">#003366</color>
|
||||
<color name="maritime_blue_mary">#87CEEB</color>
|
||||
<color name="spiritual_gold">#FFD700</color>
|
||||
<color name="spiritual_surface">#16213E</color>
|
||||
<color name="spiritual_text_dim">#B0B0B0</color>
|
||||
<color name="spiritual_text_bright">#E0E0E0</color>
|
||||
|
||||
<!-- Legacy colors (kept for compatibility if needed) -->
|
||||
<color name="dark_background">#121212</color>
|
||||
<color name="dark_surface">#1E1E1E</color>
|
||||
<color name="accent_green">#81C784</color>
|
||||
<color name="accent_blue">#42A5F5</color>
|
||||
<color name="text_primary">#FFFFFF</color>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<resources>
|
||||
<string name="app_name">El Faro del Peregrino</string>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.ElFaroDelPeregrino" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.ElFaroDelPeregrino" parent="Base.Theme.ElFaroDelPeregrino" />
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older than API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package es.tatvil.elfarodelperegrino;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# 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
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/73bcfb608d1fde9fb62e462f834a3299/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/846ee0d876d26a26f37aa1ce8de73224/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9482ddec596298c84656d31d16652665/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/39701d92e1756bb2f141eb67cd4c660e/redirect
|
||||
toolchainVersion=21
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
[versions]
|
||||
agp = "9.1.1"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.3.0"
|
||||
espressoCore = "3.7.0"
|
||||
appcompat = "1.7.1"
|
||||
material = "1.13.0"
|
||||
activity = "1.13.0"
|
||||
constraintlayout = "2.2.1"
|
||||
volley = "1.2.1"
|
||||
glide = "4.16.0"
|
||||
|
||||
[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" }
|
||||
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
|
||||
glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }
|
||||
glide-compiler = { group = "com.github.bumptech.glide", name = "compiler", version.ref = "glide" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#Thu Apr 30 01:39:08 CEST 2026
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=b266d5ff6b90eada6dc3b20cb090e3731302e553a27c5d3e4df1f0d76beaff06
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
@ -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" "$@"
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
google {
|
||||
content {
|
||||
includeGroupByRegex("com\\.android.*")
|
||||
includeGroupByRegex("com\\.google.*")
|
||||
includeGroupByRegex("androidx.*")
|
||||
}
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "El Faro del Peregrino"
|
||||
include(":app")
|
||||
|
||||