Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4437d839b | ||
|
|
8d16ad0b60 | ||
|
|
082569f8a7 | ||
|
|
a7dc176318 | ||
|
|
4919118fc5 | ||
|
|
37a802705a | ||
|
|
8fdda5c701 | ||
|
|
b25be4cfcd |
No files matched your search
@@ -39,18 +39,25 @@ SDK: `~/android-sdk` (compileSdk 37, build-tools 36). JDK 17+.
|
|||||||
`DailyNotifWorker` ejecuta). No volver a AlarmManager/Service (crasheaba en
|
`DailyNotifWorker` ejecuta). No volver a AlarmManager/Service (crasheaba en
|
||||||
Android 8+). Permiso POST_NOTIFICATIONS se pide en OptsActivity.
|
Android 8+). Permiso POST_NOTIFICATIONS se pide en OptsActivity.
|
||||||
5. **AdMob**: siempre UMP consent antes de `MobileAds.initialize` (política
|
5. **AdMob**: siempre UMP consent antes de `MobileAds.initialize` (política
|
||||||
Google en EEA). `initialize` SIEMPRE en hilo background.
|
Google en EEA). `initialize` SIEMPRE en hilo background. Banner adaptativo
|
||||||
|
por código (`UiUtils.loadBannerAd`) en todas las pantallas; rewarded
|
||||||
|
("CAMBIAR FRASE") solo en MainActivity, recargado tras cada uso.
|
||||||
6. **Estilo código**: sin switch sobre R.id (AGP 9 genera R no-final; usar
|
6. **Estilo código**: sin switch sobre R.id (AGP 9 genera R no-final; usar
|
||||||
if-else). Strings de UI SIEMPRE en `res/values/strings.xml`. Queries SQLite
|
if-else). Strings de UI SIEMPRE en `res/values/strings.xml`. Queries SQLite
|
||||||
SIEMPRE parametrizadas (`?` + selectionArgs), jamás concatenación.
|
SIEMPRE parametrizadas (`?` + selectionArgs), jamás concatenación.
|
||||||
7. **robotocalendarview** (jitpack, 2017): lib pre-AndroidX; por eso
|
7. **robotocalendarview** (jitpack, 2017): lib pre-AndroidX; por eso
|
||||||
`android.enableJetifier=true` sigue activo. No actualizar la lib a ciegas.
|
`android.enableJetifier=true` sigue activo. No actualizar la lib a ciegas.
|
||||||
|
Se estiliza SOLO por resource-merge desde la app (colores/dimens
|
||||||
|
`roboto_calendar_*` y los drawables `circle`/`ring` que la lib usa para
|
||||||
|
día seleccionado/hoy), sin tocar la lib.
|
||||||
8. **Idioma**: código y comentarios en inglés (histórico del repo), UI en
|
8. **Idioma**: código y comentarios en inglés (histórico del repo), UI en
|
||||||
español en strings.xml, docs (README/este fichero) en español.
|
español en strings.xml, docs (README/este fichero) en español.
|
||||||
9. **Edge-to-edge** (targetSdk 35+): Android 15+ fuerza el dibujo bajo las
|
9. **Edge-to-edge** (targetSdk 35+): Android 15+ fuerza el dibujo bajo las
|
||||||
barras del sistema y el ActionBar clásico ya no aparta el contenido.
|
barras del sistema y el ActionBar clásico ya no aparta el contenido.
|
||||||
TODA activity llama a `UiUtils.applySystemBarsInsets(this)` justo tras
|
TODA activity llama a `UiUtils.applySystemBarsInsets(activity, root,
|
||||||
`setContentView` — las nuevas pantallas también.
|
navColor, darkNavbar)` justo tras `setContentView` — las nuevas pantallas
|
||||||
|
también. El rediseño 2026-10 oculta el ActionBar y usa header propio +
|
||||||
|
bottom nav compartida (view_bottom_nav.xml + UiUtils.setupBottomNav).
|
||||||
|
|
||||||
## Verificación antes de dar por cerrado un cambio
|
## Verificación antes de dar por cerrado un cambio
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ El `versionCode` se auto-incrementa en cada compilación (`app/version.count`).
|
|||||||
|
|
||||||
### IDs de AdMob (obligatorio)
|
### IDs de AdMob (obligatorio)
|
||||||
|
|
||||||
La app integra AdMob (banner) con consentimiento UMP. Los IDs de AdMob viven en
|
La app integra AdMob (banner adaptativo en todas las pantallas + anuncio
|
||||||
|
recompensado para "CAMBIAR FRASE") con consentimiento UMP. Los IDs de AdMob viven en
|
||||||
`app/src/main/res/values/admob.xml`, que está **ignorado por git** para no exponerlos.
|
`app/src/main/res/values/admob.xml`, que está **ignorado por git** para no exponerlos.
|
||||||
|
|
||||||
Antes de compilar por primera vez:
|
Antes de compilar por primera vez:
|
||||||
@@ -32,7 +33,7 @@ cp admob.example.xml app/src/main/res/values/admob.xml
|
|||||||
```
|
```
|
||||||
|
|
||||||
El example trae los IDs de **test** públicos de Google, válidos para desarrollo.
|
El example trae los IDs de **test** públicos de Google, válidos para desarrollo.
|
||||||
Para producción, pon ahí tus IDs reales de AdMob (app ID y banner).
|
Para producción, pon ahí tus IDs reales de AdMob (app ID, banner y rewarded).
|
||||||
|
|
||||||
### Firma de release
|
### Firma de release
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,8 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Copia este fichero como admob.xml (gitignored) con tus IDs reales de AdMob.
|
<!-- Copia este fichero como admob.xml (gitignored) con tus IDs reales de AdMob.
|
||||||
La app no compila sin él: AndroidManifest y activity_main lo referencian. -->
|
La app no compila sin él: AndroidManifest, MainActivity y UiUtils lo referencian. -->
|
||||||
<!-- IDs de TEST públicos de Google: no producen ingresos ni violan política -->
|
<!-- IDs de TEST públicos de Google: no producen ingresos ni violan política -->
|
||||||
<string name="admob_launch_api">ca-app-pub-3940256099942544~3347511713</string>
|
<string name="admob_launch_api">ca-app-pub-3940256099942544~3347511713</string>
|
||||||
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
|
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
|
||||||
|
<string name="rewarded_ad_unit_id">ca-app-pub-3940256099942544/5224354917</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".OptsActivity" android:label="Opciones" android:exported="false"/>
|
<activity android:name=".OptsActivity" android:label="@string/nav_opciones" android:exported="false"/>
|
||||||
<activity android:name=".FavsActivity" android:label="Favoritos" android:exported="false"/>
|
<activity android:name=".FavsActivity" android:label="@string/nav_favoritos" android:exported="false"/>
|
||||||
<activity android:name=".AboutOfActivity" android:label="Acerca de" android:exported="false"/>
|
<activity android:name=".AboutOfActivity" android:label="@string/aboutOf" android:exported="false"/>
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||||
android:value="@string/admob_launch_api"/>
|
android:value="@string/admob_launch_api"/>
|
||||||
|
|||||||
@@ -1,19 +1,29 @@
|
|||||||
package com.jkanetwork.st.calendariodefrases;
|
package com.jkanetwork.st.calendariodefrases;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by kprkpr on 24/03/17.
|
* Created by kprkpr on 24/03/17.
|
||||||
|
* Rediseño 2026-10: header con volver + card de créditos.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AboutOfActivity extends AppCompatActivity {
|
public class AboutOfActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
UiUtils.applySystemBarsInsets(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
}
|
||||||
|
UiUtils.applySystemBarsInsets(this, findViewById(R.id.main_root),
|
||||||
|
ContextCompat.getColor(this, R.color.bgCard), UiUtils.isDarkTheme(this));
|
||||||
|
|
||||||
|
ImageButton btnBack = findViewById(R.id.btn_back);
|
||||||
|
btnBack.setOnClickListener(v -> finish());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -320,6 +320,50 @@ public class DatabaseHelper {
|
|||||||
cal.get(java.util.Calendar.DAY_OF_MONTH));
|
cal.get(java.util.Calendar.DAY_OF_MONTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cambia la frase asignada a un día (rewarded): borra la asignación y
|
||||||
|
* asigna una frase sin usar distinta de la anterior. Devuelve el nuevo ID
|
||||||
|
* (0 si no quedan frases).
|
||||||
|
*/
|
||||||
|
int changeDaySentence(int year, int month, int dayOfMonth) {
|
||||||
|
String diaArg = String.format(Locale.US, "%04d%02d%02d", year, month, dayOfMonth);
|
||||||
|
int oldId = -1;
|
||||||
|
try (Cursor c = userDb.rawQuery("SELECT IDFrase FROM frasesG WHERE Tday = ?",
|
||||||
|
new String[]{diaArg})) {
|
||||||
|
if (c.moveToFirst()) {
|
||||||
|
oldId = c.getInt(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userDb.delete("frasesG", "Tday = ?", new String[]{diaArg});
|
||||||
|
int nuevoId = pickUnusedID();
|
||||||
|
if (nuevoId == 0 || nuevoId == oldId) {
|
||||||
|
/* Sin frases nuevas: reponer la que había si la borró sin reemplazo */
|
||||||
|
if (nuevoId == 0) {
|
||||||
|
if (oldId > 0) {
|
||||||
|
ContentValues cv = new ContentValues();
|
||||||
|
cv.put("Tday", diaArg);
|
||||||
|
cv.put("IDFrase", oldId);
|
||||||
|
userDb.insertWithOnConflict("frasesG", null, cv, SQLiteDatabase.CONFLICT_IGNORE);
|
||||||
|
}
|
||||||
|
return oldId > 0 ? oldId : 0;
|
||||||
|
}
|
||||||
|
/* La aleatoria cayó en la misma: reintentar una vez */
|
||||||
|
nuevoId = pickUnusedID();
|
||||||
|
if (nuevoId == 0 || nuevoId == oldId) {
|
||||||
|
ContentValues cv = new ContentValues();
|
||||||
|
cv.put("Tday", diaArg);
|
||||||
|
cv.put("IDFrase", oldId > 0 ? oldId : nuevoId);
|
||||||
|
userDb.insertWithOnConflict("frasesG", null, cv, SQLiteDatabase.CONFLICT_IGNORE);
|
||||||
|
return oldId > 0 ? oldId : nuevoId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ContentValues cv = new ContentValues();
|
||||||
|
cv.put("Tday", diaArg);
|
||||||
|
cv.put("IDFrase", nuevoId);
|
||||||
|
userDb.insertWithOnConflict("frasesG", null, cv, SQLiteDatabase.CONFLICT_IGNORE);
|
||||||
|
return nuevoId;
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns an array of favorite IDs */
|
/** Returns an array of favorite IDs */
|
||||||
Integer[] getIDFavs() {
|
Integer[] getIDFavs() {
|
||||||
List<Integer> a = new ArrayList<>();
|
List<Integer> a = new ArrayList<>();
|
||||||
|
|||||||
@@ -5,69 +5,188 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.SimpleAdapter;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import java.util.HashMap;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by kprkpr on 21/03/17.
|
* Created by kprkpr on 21/03/17.
|
||||||
* Help from: http://androidexample.com/Create_A_Simple_Listview_-_Android_Example/index.php?view=article_discription&aid=65
|
* Rediseño 2026-10 (mockup SVG): header + búsqueda + cards con autor y
|
||||||
|
* estrella. Long-press en card: copiar / compartir / borrar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FavsActivity extends AppCompatActivity {
|
public class FavsActivity extends AppCompatActivity {
|
||||||
|
|
||||||
DatabaseHelper db;
|
DatabaseHelper db;
|
||||||
|
|
||||||
|
/** Fila de una card de favorito */
|
||||||
|
static class CardItem {
|
||||||
|
final int idf;
|
||||||
|
final String sentence;
|
||||||
|
final String autor;
|
||||||
|
|
||||||
|
CardItem(int idf, String sentence, String autor) {
|
||||||
|
this.idf = idf;
|
||||||
|
this.sentence = sentence;
|
||||||
|
this.autor = autor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Adapter de cards (item_quote_card.xml): autor accent, estrella quita fav */
|
||||||
|
class QuoteCardAdapter extends BaseAdapter {
|
||||||
|
private List<CardItem> items = new ArrayList<>();
|
||||||
|
|
||||||
|
void update(List<CardItem> newItems) {
|
||||||
|
items = newItems;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getItem(int position) {
|
||||||
|
return items.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
View v = convertView != null ? convertView
|
||||||
|
: getLayoutInflater().inflate(R.layout.item_quote_card, parent, false);
|
||||||
|
CardItem item = items.get(position);
|
||||||
|
TextView autor = v.findViewById(R.id.card_autor);
|
||||||
|
TextView sentence = v.findViewById(R.id.card_sentence);
|
||||||
|
ImageView star = v.findViewById(R.id.card_star);
|
||||||
|
autor.setText(item.autor);
|
||||||
|
sentence.setText(item.sentence);
|
||||||
|
star.setOnClickListener(x -> onUnfav(item));
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private final QuoteCardAdapter adapter = new QuoteCardAdapter();
|
||||||
|
private final List<CardItem> allItems = new ArrayList<>();
|
||||||
|
/* IDs de la vista FILTRADA, en el mismo orden que el adapter: si el
|
||||||
|
adapter se reordena tras filtrar, el long-press debe actuar sobre la
|
||||||
|
frase visible (esta lista), no sobre la BD en crudo */
|
||||||
|
private final List<Integer> listIDFrases = new ArrayList<>();
|
||||||
|
private String query = "";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_favs);
|
setContentView(R.layout.activity_favs);
|
||||||
UiUtils.applySystemBarsInsets(this);
|
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
}
|
||||||
|
UiUtils.applySystemBarsInsets(this, findViewById(R.id.main_root),
|
||||||
|
ContextCompat.getColor(this, R.color.bgCard), UiUtils.isDarkTheme(this));
|
||||||
|
UiUtils.setupBottomNav(this, UiUtils.NavTab.FAVORITOS);
|
||||||
|
UiUtils.loadBannerAd(this, (android.widget.FrameLayout) findViewById(R.id.adContainer));
|
||||||
|
|
||||||
db = new DatabaseHelper(this);
|
db = new DatabaseHelper(this);
|
||||||
|
|
||||||
final ListView listFavs = (ListView) findViewById(R.id.listSentences);
|
ListView list = findViewById(R.id.view_list);
|
||||||
|
list.setAdapter(adapter);
|
||||||
|
list.setEmptyView(findViewById(R.id.empty_list));
|
||||||
|
registerForContextMenu(list);
|
||||||
|
|
||||||
// Defined Array values to show in ListView
|
/* Búsqueda: refiltra al teclear */
|
||||||
|
EditText search = findViewById(R.id.search_input);
|
||||||
|
search.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
query = s.toString().trim();
|
||||||
|
applyFilters();
|
||||||
|
}
|
||||||
|
|
||||||
//Get IDs of sentences that are favs, and create an array of same length
|
@Override
|
||||||
final Integer[] IDFavs = db.getIDFavs();
|
public void beforeTextChanged(CharSequence s, int a, int b, int c) {
|
||||||
|
}
|
||||||
|
|
||||||
final String[] sentences = new String[IDFavs.length];
|
@Override
|
||||||
final String[] authorNames = new String[IDFavs.length];
|
public void onTextChanged(CharSequence s, int a, int b, int c) {
|
||||||
//Follow all IDFavs recovering sentence
|
}
|
||||||
if (IDFavs.length != 0) {
|
});
|
||||||
for (int x = 0; x <= IDFavs.length - 1; x++) {
|
|
||||||
sentences[x] = db.getFraseFromID(IDFavs[x]);
|
/* Restaurar búsqueda tras recrear la activity (giro, etc.) */
|
||||||
authorNames[x] = db.getAutorFromID(IDFavs[x]);
|
if (savedInstanceState != null) {
|
||||||
|
query = savedInstanceState.getString("query", "");
|
||||||
|
if (!query.isEmpty()) {
|
||||||
|
search.setText(query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IDFavs.length != 0) {
|
@Override
|
||||||
ArrayList<HashMap<String, String>> items = new ArrayList<>();
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
HashMap<String, String> listItem;
|
super.onSaveInstanceState(outState);
|
||||||
for (int x = 0; x <= IDFavs.length - 1; x++) {
|
outState.putString("query", query);
|
||||||
listItem = new HashMap<>();
|
|
||||||
listItem.put("item", sentences[x]);
|
|
||||||
listItem.put("subitem", authorNames[x]);
|
|
||||||
items.add(listItem);
|
|
||||||
}
|
|
||||||
SimpleAdapter adapter = new SimpleAdapter(this, items, android.R.layout.simple_list_item_2, new String[]{"item", "subitem"}, new int[]{android.R.id.text1, android.R.id.text2});
|
|
||||||
listFavs.setAdapter(adapter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register context menu */
|
/** Carga todos los favoritos y refresca la lista */
|
||||||
registerForContextMenu(listFavs);
|
private void loadAll() {
|
||||||
|
allItems.clear();
|
||||||
|
Integer[] ids = db.getIDFavs();
|
||||||
|
for (Integer id : ids) {
|
||||||
|
allItems.add(new CardItem(id, db.getFraseFromID(id), db.getAutorFromID(id)));
|
||||||
|
}
|
||||||
|
applyFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Aplica la búsqueda sobre allItems */
|
||||||
|
private void applyFilters() {
|
||||||
|
List<CardItem> filtered = new ArrayList<>();
|
||||||
|
String q = query.toLowerCase(Locale.getDefault());
|
||||||
|
for (CardItem item : allItems) {
|
||||||
|
if (q.isEmpty()
|
||||||
|
|| item.sentence.toLowerCase(Locale.getDefault()).contains(q)
|
||||||
|
|| item.autor.toLowerCase(Locale.getDefault()).contains(q)) {
|
||||||
|
filtered.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
listIDFrases.clear();
|
||||||
|
for (CardItem item : filtered) {
|
||||||
|
listIDFrases.add(item.idf);
|
||||||
|
}
|
||||||
|
adapter.update(filtered);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Quitar de favoritos (estrella) y recargar */
|
||||||
|
private void onUnfav(CardItem item) {
|
||||||
|
db.delFav(item.idf);
|
||||||
|
loadAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
loadAll(); /* los favoritos pueden cambiar desde la main */
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateContextMenu(ContextMenu menu, View v,
|
public void onCreateContextMenu(ContextMenu menu, View v,
|
||||||
@@ -79,30 +198,31 @@ public class FavsActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextItemSelected(MenuItem item) {
|
public boolean onContextItemSelected(MenuItem item) {
|
||||||
|
android.widget.AdapterView.AdapterContextMenuInfo info =
|
||||||
ListView listFavs = (ListView) findViewById(R.id.listSentences);
|
(android.widget.AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
|
||||||
AdapterView.AdapterContextMenuInfo info =
|
int position = info.position;
|
||||||
(AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
|
if (position < 0 || position >= listIDFrases.size()) {
|
||||||
@SuppressWarnings("unchecked") /* Because next line has a type change without checking it */
|
return false;
|
||||||
HashMap<String, String> obj = (HashMap<String,String>) listFavs.getItemAtPosition(info.position);
|
}
|
||||||
|
int idf = listIDFrases.get(position);
|
||||||
|
String sentence = db.getFraseFromID(idf);
|
||||||
|
String autor = db.getAutorFromID(idf);
|
||||||
|
String shared = sentence + " (" + autor + ")\n" + getString(R.string.sharefrom);
|
||||||
|
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == R.id.copy) {
|
if (id == R.id.copy) {
|
||||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", obj.get("item")+this.getString(R.string.sharefrom)));
|
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", shared));
|
||||||
Toast.makeText(getApplicationContext(), R.string.copied, Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), R.string.copied, Toast.LENGTH_LONG).show();
|
||||||
return true;
|
return true;
|
||||||
} else if (id == R.id.delfav) {
|
} else if (id == R.id.delfav) {
|
||||||
Integer[] IDFavs = db.getIDFavs();
|
db.delFav(idf);
|
||||||
db.delFav(IDFavs[info.position]);
|
loadAll();
|
||||||
/* Restart activity for refresh favs */
|
|
||||||
finish();
|
|
||||||
startActivity(getIntent());
|
|
||||||
return true;
|
return true;
|
||||||
} else if (id == R.id.share) {
|
} else if (id == R.id.share) {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
intent.setType("text/plain");
|
intent.setType("text/plain");
|
||||||
intent.putExtra(Intent.EXTRA_TEXT,obj.get("item")+this.getString(R.string.sharefrom));
|
intent.putExtra(Intent.EXTRA_TEXT, shared);
|
||||||
startActivity(Intent.createChooser(intent, getString(R.string.share_with)));
|
startActivity(Intent.createChooser(intent, getString(R.string.share_with)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,31 +6,33 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.text.method.ScrollingMovementMethod;
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import com.marcohc.robotocalendar.RobotoCalendarView.RobotoCalendarListener;
|
|
||||||
import com.marcohc.robotocalendar.RobotoCalendarView;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import java.text.DateFormatSymbols;
|
import androidx.core.content.ContextCompat;
|
||||||
import java.util.Calendar;
|
|
||||||
|
|
||||||
import com.google.android.gms.ads.AdRequest;
|
import com.google.android.gms.ads.AdRequest;
|
||||||
import com.google.android.gms.ads.AdView;
|
import com.google.android.gms.ads.FullScreenContentCallback;
|
||||||
|
import com.google.android.gms.ads.LoadAdError;
|
||||||
import com.google.android.gms.ads.MobileAds;
|
import com.google.android.gms.ads.MobileAds;
|
||||||
|
import com.google.android.gms.ads.OnUserEarnedRewardListener;
|
||||||
|
import com.google.android.gms.ads.rewarded.RewardedAd;
|
||||||
|
import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback;
|
||||||
import com.google.android.ump.ConsentInformation;
|
import com.google.android.ump.ConsentInformation;
|
||||||
import com.google.android.ump.ConsentRequestParameters;
|
import com.google.android.ump.ConsentRequestParameters;
|
||||||
import com.google.android.ump.FormError;
|
import com.google.android.ump.FormError;
|
||||||
import com.google.android.ump.UserMessagingPlatform;
|
import com.google.android.ump.UserMessagingPlatform;
|
||||||
|
import com.marcohc.robotocalendar.RobotoCalendarView;
|
||||||
|
|
||||||
|
import java.text.DateFormatSymbols;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity implements RobotoCalendarView.RobotoCalendarListener {
|
||||||
public class MainActivity extends AppCompatActivity implements RobotoCalendarListener {
|
|
||||||
|
|
||||||
private RobotoCalendarView robotoCalendarView;
|
private RobotoCalendarView robotoCalendarView;
|
||||||
DatabaseHelper db;
|
DatabaseHelper db;
|
||||||
@@ -42,39 +44,16 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
Integer calMonth = cal.get(Calendar.MONTH) + 1; //From 1 to 12, and not from 0 to 11
|
Integer calMonth = cal.get(Calendar.MONTH) + 1; //From 1 to 12, and not from 0 to 11
|
||||||
Integer calYear = cal.get(Calendar.YEAR);
|
Integer calYear = cal.get(Calendar.YEAR);
|
||||||
|
|
||||||
/* Texts making all activity used, and valued in onCreate */
|
/* Views of the redesign */
|
||||||
TextView txtfraseTitle;
|
TextView txtDate;
|
||||||
TextView txtfraseText;
|
TextView txtSentence;
|
||||||
TextView txtfraseAutor;
|
TextView txtAutor;
|
||||||
/* More objects of view */
|
|
||||||
ImageButton btnFav;
|
ImageButton btnFav;
|
||||||
ImageButton btnShare;
|
ImageButton btnShare;
|
||||||
|
TextView btnChange;
|
||||||
|
|
||||||
|
/* Rewarded ad to change the sentence */
|
||||||
@Override
|
private RewardedAd rewardedAd;
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
MenuInflater inflater = getMenuInflater();
|
|
||||||
inflater.inflate(R.menu.main, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == R.id.favorites) {
|
|
||||||
startActivity(new Intent(MainActivity.this, FavsActivity.class));
|
|
||||||
return true;
|
|
||||||
} else if (id == R.id.options) {
|
|
||||||
startActivity(new Intent(MainActivity.this, OptsActivity.class));
|
|
||||||
return true;
|
|
||||||
} else if (id == R.id.about) {
|
|
||||||
startActivity(new Intent(MainActivity.this, AboutOfActivity.class));
|
|
||||||
return true;
|
|
||||||
} else if (id == R.id.exit) {
|
|
||||||
moveTaskToBack(true); /* Returns to "desktop" */
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -96,13 +75,22 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
UiUtils.applySystemBarsInsets(this);
|
|
||||||
|
/* Rediseño: header propio, sin ActionBar; insets con fondo bgCard */
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
}
|
||||||
|
UiUtils.applySystemBarsInsets(this, findViewById(R.id.main_root),
|
||||||
|
ContextCompat.getColor(this, R.color.bgCard), UiUtils.isDarkTheme(this));
|
||||||
|
UiUtils.setupBottomNav(this, UiUtils.NavTab.INICIO);
|
||||||
|
|
||||||
db = new DatabaseHelper(this);
|
db = new DatabaseHelper(this);
|
||||||
txtfraseTitle = findViewById(R.id.txt_frasetitle);
|
txtDate = findViewById(R.id.txt_date);
|
||||||
txtfraseText = findViewById(R.id.txt_frasetext);
|
txtSentence = findViewById(R.id.txt_sentence);
|
||||||
txtfraseAutor = findViewById(R.id.txt_fraseautor);
|
txtAutor = findViewById(R.id.txt_fraseautor);
|
||||||
btnFav = findViewById(R.id.btnFav);
|
btnFav = findViewById(R.id.btnFav);
|
||||||
btnShare = findViewById(R.id.btnShare);
|
btnShare = findViewById(R.id.btnShare);
|
||||||
|
btnChange = findViewById(R.id.btn_change);
|
||||||
|
|
||||||
/* Calendar basic settings */
|
/* Calendar basic settings */
|
||||||
robotoCalendarView = (RobotoCalendarView) findViewById(R.id.calendarPicker);
|
robotoCalendarView = (RobotoCalendarView) findViewById(R.id.calendarPicker);
|
||||||
@@ -110,15 +98,44 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
robotoCalendarView.setShortWeekDays(false);
|
robotoCalendarView.setShortWeekDays(false);
|
||||||
robotoCalendarView.showDateTitle(true);
|
robotoCalendarView.showDateTitle(true);
|
||||||
|
|
||||||
/* Admob ads: consentimiento UMP primero, luego init en background y banner */
|
/* Admob ads: consentimiento UMP primero, luego init en background y
|
||||||
|
banner + rewarded (patrón FrasesDeAnime) */
|
||||||
setUpConsentAndAds();
|
setUpConsentAndAds();
|
||||||
|
|
||||||
|
/* Make sentence text scrollable */
|
||||||
|
txtSentence.setMovementMethod(new ScrollingMovementMethod());
|
||||||
|
|
||||||
|
/* Copy sentence on tap (as before) */
|
||||||
|
txtSentence.setOnClickListener(viewIn -> {
|
||||||
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence",
|
||||||
|
txtSentence.getText() + getString(R.string.sharefrom)));
|
||||||
|
Toast.makeText(getApplicationContext(), R.string.copied, Toast.LENGTH_LONG).show();
|
||||||
|
});
|
||||||
|
|
||||||
/* Register context menu */
|
/* Fav toggle */
|
||||||
registerForContextMenu(txtfraseText);
|
btnFav.setOnClickListener(viewIn -> {
|
||||||
|
if (db.getFav(IDFrase) == 1) {
|
||||||
|
db.delFav(IDFrase);
|
||||||
|
} else {
|
||||||
|
db.addFav(IDFrase);
|
||||||
|
}
|
||||||
|
changeFavImage();
|
||||||
|
});
|
||||||
|
|
||||||
/* Close app on back button */
|
/* Share */
|
||||||
|
btnShare.setOnClickListener(viewIn -> {
|
||||||
|
String sentence = txtSentence.getText().toString();
|
||||||
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
|
intent.setType("text/plain");
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, sentence + getString(R.string.sharefrom));
|
||||||
|
startActivity(Intent.createChooser(intent, getString(R.string.share_with)));
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Change sentence: rewarded ad (like FrasesDeAnime) */
|
||||||
|
btnChange.setOnClickListener(viewIn -> onChangeSentenceClick());
|
||||||
|
|
||||||
|
/* Close app on back button: registrado con OnBackPressedDispatcher */
|
||||||
getOnBackPressedDispatcher().addCallback(this, new androidx.activity.OnBackPressedCallback(true) {
|
getOnBackPressedDispatcher().addCallback(this, new androidx.activity.OnBackPressedCallback(true) {
|
||||||
@Override
|
@Override
|
||||||
public void handleOnBackPressed() {
|
public void handleOnBackPressed() {
|
||||||
@@ -127,7 +144,11 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Consentimiento UMP (obligatorio EEA) y tras él, init de AdMob + banner */
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Ads: UMP consent → init background → banner adaptativo + rewarded */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** Consentimiento UMP (obligatorio EEA) y tras él, init + carga de anuncios */
|
||||||
private void setUpConsentAndAds() {
|
private void setUpConsentAndAds() {
|
||||||
ConsentRequestParameters params = new ConsentRequestParameters.Builder().build();
|
ConsentRequestParameters params = new ConsentRequestParameters.Builder().build();
|
||||||
ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(this);
|
ConsentInformation consentInfo = UserMessagingPlatform.getConsentInformation(this);
|
||||||
@@ -140,73 +161,100 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
formError -> initAdsAfterConsent());
|
formError -> initAdsAfterConsent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** MobileAds.initialize en background y, al completar, banner + rewarded */
|
||||||
private void initAdsAfterConsent() {
|
private void initAdsAfterConsent() {
|
||||||
/* MobileAds.initialize en background: no bloquee el arranque */
|
new Thread(() -> MobileAds.initialize(getApplicationContext(), initializationStatus ->
|
||||||
new Thread(() -> {
|
|
||||||
MobileAds.initialize(getApplicationContext());
|
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
AdView mAdView = findViewById(R.id.adView);
|
UiUtils.loadBannerAd(MainActivity.this,
|
||||||
|
(android.widget.FrameLayout) findViewById(R.id.adContainer));
|
||||||
|
loadRewardedAd();
|
||||||
|
}))).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Carga el anuncio recompensado con el ID de UNIDAD, no el de app */
|
||||||
|
private void loadRewardedAd() {
|
||||||
AdRequest adRequest = new AdRequest.Builder().build();
|
AdRequest adRequest = new AdRequest.Builder().build();
|
||||||
mAdView.loadAd(adRequest);
|
RewardedAd.load(this, getString(R.string.rewarded_ad_unit_id), adRequest,
|
||||||
});
|
new RewardedAdLoadCallback() {
|
||||||
}).start();
|
@Override
|
||||||
|
public void onAdFailedToLoad(LoadAdError adError) {
|
||||||
|
rewardedAd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume(){
|
public void onAdLoaded(RewardedAd ad) {
|
||||||
super.onResume();
|
rewardedAd = ad;
|
||||||
/* Refresh calendar */
|
}
|
||||||
cal = Calendar.getInstance();
|
});
|
||||||
calMonth = cal.get(Calendar.MONTH)+1; //From 1 to 12, and not from 0 to 11
|
}
|
||||||
calYear = cal.get(Calendar.YEAR);
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Cambiar frase con anuncio recompensado (patrón FrasesDeAnime) */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
//Load today's sentence and set texts
|
/**
|
||||||
IDFrase = db.getIDFraseHoy();
|
* Botón CAMBIAR FRASE: sólo tiene sentido para un día ya desbloqueado
|
||||||
|
* (hoy o un pasado accesible). Muestra el rewarded y, con la recompensa,
|
||||||
/* Refresh calendar, after load sentences for checks */
|
* diálogo para confirmar el cambio.
|
||||||
robotoCalendarView.updateView();
|
*/
|
||||||
|
private void onChangeSentenceClick() {
|
||||||
|
if (IDFrase == null || IDFrase <= 0) {
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setMessage(R.string.rewarded_no_sentence)
|
||||||
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
|
.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (rewardedAd == null) {
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setMessage(R.string.rewarded_not_ready)
|
||||||
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
|
.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RewardedAd ad = rewardedAd;
|
||||||
|
rewardedAd = null;
|
||||||
|
/* Recargar tras cerrar: los RewardedAd son de un solo uso */
|
||||||
|
ad.setFullScreenContentCallback(new FullScreenContentCallback() {
|
||||||
|
@Override
|
||||||
|
public void onAdDismissedFullScreenContent() {
|
||||||
|
loadRewardedAd();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ad.show(this, rewardItem -> {
|
||||||
|
/* ANUNCIO VISTO: ofrecer el cambio de frase */
|
||||||
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
|
.setTitle(R.string.rewarded_change_title)
|
||||||
|
.setMessage(R.string.rewarded_change_msg)
|
||||||
|
.setPositiveButton(R.string.rewarded_change_ok, (d, w) -> {
|
||||||
|
db.changeDaySentence(selYear, selMonth, selDay);
|
||||||
|
IDFrase = db.getIDFraseDay(selYear, selMonth, selDay);
|
||||||
|
updateSentenceViews();
|
||||||
markDates();
|
markDates();
|
||||||
|
})
|
||||||
txtfraseText.setText(db.getFraseFromID(IDFrase));
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
txtfraseAutor.setText(db.getAutorFromID(IDFrase));
|
.show();
|
||||||
|
|
||||||
|
|
||||||
// ListView Item Click Listener
|
|
||||||
txtfraseText.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View viewIn) {
|
|
||||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", txtfraseText.getText()+MainActivity.this.getString(R.string.sharefrom)));
|
|
||||||
Toast.makeText(getApplicationContext(), R.string.copied, Toast.LENGTH_LONG ).show();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
changeFavImage(); //Fav image button
|
}
|
||||||
|
|
||||||
// SetFavListener
|
/* ------------------------------------------------------------------ */
|
||||||
btnFav.setOnClickListener(new View.OnClickListener() {
|
/* Sentence views */
|
||||||
@Override
|
/* ------------------------------------------------------------------ */
|
||||||
public void onClick(View viewIn) {
|
|
||||||
if (db.getFav(IDFrase) == 1){
|
/** Updates the pill date, sentence and author for the selected day */
|
||||||
db.delFav(IDFrase);
|
private void updateSentenceViews() {
|
||||||
|
txtSentence.setText(db.getFraseFromID(IDFrase));
|
||||||
|
txtAutor.setText(db.getAutorFromID(IDFrase));
|
||||||
|
Calendar today = Calendar.getInstance();
|
||||||
|
if (selYear != today.get(Calendar.YEAR)
|
||||||
|
|| selMonth != today.get(Calendar.MONTH) + 1
|
||||||
|
|| selDay != today.get(Calendar.DAY_OF_MONTH)) {
|
||||||
|
txtDate.setText(getString(R.string.sentence_of_day, selDay, getMonth(selMonth)));
|
||||||
} else {
|
} else {
|
||||||
db.addFav(IDFrase);
|
txtDate.setText(R.string.txt_todaysentence);
|
||||||
}
|
}
|
||||||
changeFavImage();
|
changeFavImage();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
// ShareListener
|
|
||||||
btnShare.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View viewIn) {
|
|
||||||
String sentence = txtfraseText.getText().toString();
|
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
|
||||||
intent.setType("text/plain");
|
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, sentence+MainActivity.this.getString(R.string.sharefrom));
|
|
||||||
startActivity(Intent.createChooser(intent, getString(R.string.share_with)));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void changeFavImage() {
|
private void changeFavImage() {
|
||||||
if (db.getFav(IDFrase) == 1) {
|
if (db.getFav(IDFrase) == 1) {
|
||||||
@@ -216,35 +264,53 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
/* Refresh calendar */
|
||||||
|
cal = Calendar.getInstance();
|
||||||
|
calMonth = cal.get(Calendar.MONTH) + 1; //From 1 to 12, and not from 0 to 11
|
||||||
|
calYear = cal.get(Calendar.YEAR);
|
||||||
|
|
||||||
/* Close app on back button: registrado en onCreate con OnBackPressedDispatcher */
|
/* Selected day = today on resume */
|
||||||
|
selYear = cal.get(Calendar.YEAR);
|
||||||
|
selMonth = cal.get(Calendar.MONTH) + 1;
|
||||||
|
selDay = cal.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
/* Load today's sentence and set texts */
|
||||||
|
IDFrase = db.getIDFraseHoy();
|
||||||
|
updateSentenceViews();
|
||||||
|
|
||||||
|
/* Refresh calendar after load sentences for checks */
|
||||||
|
robotoCalendarView.updateView();
|
||||||
|
markDates();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Calendar listener */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDayClick(Calendar daySelectedCalendar) {
|
public void onDayClick(Calendar daySelectedCalendar) {
|
||||||
Integer month = daySelectedCalendar.get(Calendar.MONTH);
|
int year = daySelectedCalendar.get(Calendar.YEAR);
|
||||||
Integer day = daySelectedCalendar.get(Calendar.DAY_OF_MONTH);
|
int month = daySelectedCalendar.get(Calendar.MONTH) + 1;
|
||||||
Integer year = daySelectedCalendar.get(Calendar.YEAR);
|
int day = daySelectedCalendar.get(Calendar.DAY_OF_MONTH);
|
||||||
month=month+1; //Now months start with 1 and not 0
|
selYear = year;
|
||||||
/* Load sentence */
|
selMonth = month;
|
||||||
|
selDay = day;
|
||||||
IDFrase = db.getIDFraseDay(year, month, day);
|
IDFrase = db.getIDFraseDay(year, month, day);
|
||||||
String frase = db.getFraseFromID(IDFrase);
|
updateSentenceViews();
|
||||||
txtfraseText.setText(frase); //Change text
|
|
||||||
txtfraseAutor.setText(db.getAutorFromID(IDFrase));
|
|
||||||
/* Set Title before sentence */
|
|
||||||
if (year != cal.get(Calendar.YEAR) || month != (cal.get(Calendar.MONTH)+1) || day != cal.get(Calendar.DAY_OF_MONTH)) {
|
|
||||||
txtfraseTitle.setText(getString(R.string.sentence_of_day, day, getMonth(month))); //Change title
|
|
||||||
}else {
|
|
||||||
txtfraseTitle.setText(R.string.txt_todaysentence); //Change title (today)
|
|
||||||
}
|
|
||||||
changeFavImage(); //For checking fav image
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDayLongClick(Calendar daySelectedCalendar) {
|
public void onDayLongClick(Calendar daySelectedCalendar) {
|
||||||
onDayClick(daySelectedCalendar);
|
onDayClick(daySelectedCalendar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Selected day shown in the sentence card (today on resume) */
|
||||||
|
int selYear;
|
||||||
|
int selMonth;
|
||||||
|
int selDay;
|
||||||
|
|
||||||
/** It returns the month name */
|
/** It returns the month name */
|
||||||
public String getMonth(int month) {
|
public String getMonth(int month) {
|
||||||
@@ -258,10 +324,10 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
Calendar time = Calendar.getInstance();
|
Calendar time = Calendar.getInstance();
|
||||||
String[] IDDays = db.getAllDaysYet();
|
String[] IDDays = db.getAllDaysYet();
|
||||||
if (IDDays.length != 0) {
|
if (IDDays.length != 0) {
|
||||||
for (int x = 0; x <= IDDays.length - 1; x++) {
|
for (String idDay : IDDays) {
|
||||||
Integer year = Integer.parseInt(IDDays[x].substring(0, 4));
|
Integer year = Integer.parseInt(idDay.substring(0, 4));
|
||||||
Integer month = Integer.parseInt(IDDays[x].substring(4, 6));
|
Integer month = Integer.parseInt(idDay.substring(4, 6));
|
||||||
Integer day = Integer.parseInt(IDDays[x].substring(6, 8));
|
Integer day = Integer.parseInt(idDay.substring(6, 8));
|
||||||
if (year.equals(calYear) && month.equals(calMonth)) {
|
if (year.equals(calYear) && month.equals(calMonth)) {
|
||||||
time.set(Calendar.DAY_OF_MONTH, day);
|
time.set(Calendar.DAY_OF_MONTH, day);
|
||||||
time.set(Calendar.MONTH, month - 1);
|
time.set(Calendar.MONTH, month - 1);
|
||||||
@@ -271,7 +337,6 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Overrides for month plus and minus */
|
/* Overrides for month plus and minus */
|
||||||
@Override
|
@Override
|
||||||
public void onRightButtonClick() {
|
public void onRightButtonClick() {
|
||||||
@@ -292,5 +357,4 @@ public class MainActivity extends AppCompatActivity implements RobotoCalendarLis
|
|||||||
}
|
}
|
||||||
markDates();
|
markDates();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,109 +1,97 @@
|
|||||||
package com.jkanetwork.st.calendariodefrases;
|
package com.jkanetwork.st.calendariodefrases;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.TimePickerDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static java.lang.String.valueOf;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by kprkpr on 21/03/17.
|
* Created by kprkpr on 21/03/17.
|
||||||
|
* Rediseño 2026-10 (mockup SVG): cards de ajustes con título+descripción.
|
||||||
|
* La hora se elige con TimePicker (antes dos spinners); card Acerca de;
|
||||||
|
* banner + barra de navegación inferior. Guardado automático: cada cambio
|
||||||
|
* se aplica al momento, no hay botón Guardar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class OptsActivity extends AppCompatActivity {
|
public class OptsActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
Config conf;
|
||||||
|
CheckBox chkAlarm;
|
||||||
|
CheckBox chkPersistent;
|
||||||
|
TextView txtHora;
|
||||||
|
View cardHora;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_opts);
|
setContentView(R.layout.activity_opts);
|
||||||
UiUtils.applySystemBarsInsets(this);
|
|
||||||
final Config conf = new Config(this);
|
|
||||||
/* Do variables of objects */
|
|
||||||
final Spinner spinnerHour = (Spinner) findViewById(R.id.spinnerHour);
|
|
||||||
final Spinner spinnerMinute = (Spinner) findViewById(R.id.spinnerMinute);
|
|
||||||
final CheckBox chkalarm = (CheckBox) findViewById(R.id.chk_alarm);
|
|
||||||
final CheckBox chkpersistent = (CheckBox) findViewById(R.id.chk_persistent);
|
|
||||||
/* Set texts and checks from configs */
|
|
||||||
chkalarm.setChecked(conf.getNotifOn());
|
|
||||||
chkpersistent.setChecked(conf.getPersistNotifOn());
|
|
||||||
|
|
||||||
// Hour and minute elements create
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().hide();
|
||||||
// Spinner Drop down elements
|
|
||||||
List<Integer> Hours = new ArrayList<>();
|
|
||||||
for (int x = 0; x <= 23; x++) {
|
|
||||||
Hours.add(x);
|
|
||||||
}
|
}
|
||||||
List<Integer> Minutes = new ArrayList<>();
|
UiUtils.applySystemBarsInsets(this, findViewById(R.id.main_root),
|
||||||
for (int x = 0; x <= 59; x++) {
|
ContextCompat.getColor(this, R.color.bgCard), UiUtils.isDarkTheme(this));
|
||||||
Minutes.add(x);
|
UiUtils.setupBottomNav(this, UiUtils.NavTab.OPCIONES);
|
||||||
}
|
UiUtils.loadBannerAd(this, (android.widget.FrameLayout) findViewById(R.id.adContainer));
|
||||||
// Creating adapter for spinner
|
|
||||||
ArrayAdapter<Integer> hourAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Hours);
|
|
||||||
ArrayAdapter<Integer> minuteAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Minutes);
|
|
||||||
// Drop down layout style - list view with radio button
|
|
||||||
hourAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
minuteAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
// attaching data adapter to spinner
|
|
||||||
spinnerHour.setAdapter(hourAdapter);
|
|
||||||
spinnerMinute.setAdapter(minuteAdapter);
|
|
||||||
|
|
||||||
spinnerHour.setSelection(conf.getHour());
|
conf = new Config(this);
|
||||||
spinnerMinute.setSelection(conf.getMinute());
|
chkAlarm = findViewById(R.id.chk_alarm);
|
||||||
|
chkPersistent = findViewById(R.id.chk_persistent);
|
||||||
|
txtHora = findViewById(R.id.txt_hora);
|
||||||
|
cardHora = findViewById(R.id.card_hora);
|
||||||
|
|
||||||
|
chkAlarm.setChecked(conf.getNotifOn());
|
||||||
|
chkPersistent.setChecked(conf.getPersistNotifOn());
|
||||||
|
|
||||||
setEnabledParts();
|
setEnabledParts();
|
||||||
|
updateHoraTxt();
|
||||||
|
|
||||||
/* Disable options if notification is disabled */
|
/* Guardado automático en cada interacción */
|
||||||
chkalarm.setOnClickListener(new View.OnClickListener() {
|
chkAlarm.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
setEnabledParts();
|
setEnabledParts();
|
||||||
}
|
saveAndApply();
|
||||||
});
|
});
|
||||||
/* For not set date if persistent is enabled */
|
chkPersistent.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
chkpersistent.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
setEnabledParts();
|
setEnabledParts();
|
||||||
}
|
saveAndApply();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Hora: TimePicker sobre la card */
|
||||||
|
cardHora.setOnClickListener(v -> new TimePickerDialog(this, (view, hour, minute) -> {
|
||||||
|
conf.setHour(hour);
|
||||||
|
conf.setMinute(minute);
|
||||||
|
updateHoraTxt();
|
||||||
|
saveAndApply();
|
||||||
|
}, conf.getHour(), conf.getMinute(), true).show());
|
||||||
|
|
||||||
Button btnsave = (Button) findViewById(R.id.btnSaveNotif);
|
/* Acerca de desde Opciones */
|
||||||
btnsave.setOnClickListener(new View.OnClickListener() {
|
findViewById(R.id.card_about).setOnClickListener(
|
||||||
@Override
|
v -> startActivity(new Intent(this, AboutOfActivity.class)));
|
||||||
public void onClick(View view) {
|
}
|
||||||
Integer hourSave, minuteSave;
|
|
||||||
|
|
||||||
hourSave = Integer.decode(String.valueOf(spinnerHour.getSelectedItemPosition()));
|
/** Hora guardada en la card, en gris */
|
||||||
|
private void updateHoraTxt() {
|
||||||
|
txtHora.setText(String.format("%d:%02d", conf.getHour(), conf.getMinute()));
|
||||||
|
}
|
||||||
|
|
||||||
minuteSave = Integer.decode(String.valueOf(spinnerMinute.getSelectedItemPosition()));
|
/** Guarda prefs y reprograma el trabajo. Se llama tras cada cambio. */
|
||||||
|
private void saveAndApply() {
|
||||||
|
conf.setNotifOn(chkAlarm.isChecked());
|
||||||
|
conf.setPersistNotifOn(chkPersistent.isChecked());
|
||||||
|
|
||||||
conf.setHour(hourSave);
|
if (chkAlarm.isChecked() && !notificationsEnabled()) {
|
||||||
conf.setMinute(minuteSave);
|
|
||||||
//Log.d("EnabledNotif", String.valueOf(chkalarm.isChecked()));
|
|
||||||
/* Enable or disable notification and persistent */
|
|
||||||
conf.setNotifOn(chkalarm.isChecked());
|
|
||||||
conf.setPersistNotifOn(chkpersistent.isChecked());
|
|
||||||
|
|
||||||
if (chkalarm.isChecked() && !notificationsEnabled()) {
|
|
||||||
/* Android 13+: pedir permiso para poder mostrar la notificación */
|
/* Android 13+: pedir permiso para poder mostrar la notificación */
|
||||||
ActivityCompat.requestPermissions(OptsActivity.this,
|
ActivityCompat.requestPermissions(OptsActivity.this,
|
||||||
new String[]{Manifest.permission.POST_NOTIFICATIONS}, 1);
|
new String[]{Manifest.permission.POST_NOTIFICATIONS}, 1);
|
||||||
@@ -111,14 +99,26 @@ public class OptsActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
/* Cancel notif when save changes first */
|
/* Cancel notif when save changes first */
|
||||||
Notif.cancel(OptsActivity.this);
|
Notif.cancel(OptsActivity.this);
|
||||||
|
|
||||||
NotifScheduler.schedule(OptsActivity.this);
|
NotifScheduler.schedule(OptsActivity.this);
|
||||||
if (chkpersistent.isChecked() && chkalarm.isChecked()) {
|
if (chkPersistent.isChecked() && chkAlarm.isChecked()) {
|
||||||
Notif.show(OptsActivity.this, conf); /* Auto show notif for persistent mode */
|
Notif.show(OptsActivity.this, conf); /* Auto show notif for persistent mode */
|
||||||
}
|
}
|
||||||
}
|
Toast.makeText(this, R.string.guardado, Toast.LENGTH_SHORT).show();
|
||||||
});
|
|
||||||
|
|
||||||
|
/* Si la notificación queda activa sin permiso (Android 13+), el
|
||||||
|
diálogo del sistema ya no se mostrará tras 2 denegaciones */
|
||||||
|
if (chkAlarm.isChecked() && Build.VERSION.SDK_INT >= 33
|
||||||
|
&& ContextCompat.checkSelfPermission(OptsActivity.this,
|
||||||
|
Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.opts_notif_title)
|
||||||
|
.setMessage(R.string.opts_notif_perm_msg)
|
||||||
|
.setPositiveButton(R.string.opts_notif_perm_ok, (d, w) ->
|
||||||
|
startActivity(new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
||||||
|
.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName())))
|
||||||
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean notificationsEnabled() {
|
private boolean notificationsEnabled() {
|
||||||
@@ -128,27 +128,17 @@ public class OptsActivity extends AppCompatActivity {
|
|||||||
return ContextCompat.checkSelfPermission(OptsActivity.this,
|
return ContextCompat.checkSelfPermission(OptsActivity.this,
|
||||||
Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
|
Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
|
||||||
}
|
}
|
||||||
public void setEnabledParts(){
|
|
||||||
/* I have to set vars again because is out of onCreate */
|
|
||||||
Spinner notifHour = findViewById(R.id.spinnerHour);
|
|
||||||
Spinner notifMinute = findViewById(R.id.spinnerMinute);
|
|
||||||
CheckBox chkalarm = findViewById(R.id.chk_alarm);
|
|
||||||
CheckBox chkpersistent = findViewById(R.id.chk_persistent);
|
|
||||||
if (chkalarm.isChecked()){
|
|
||||||
chkpersistent.setEnabled(true);
|
|
||||||
/* This other checks is chkpersistent checked dependent */
|
|
||||||
if (chkpersistent.isChecked()){
|
|
||||||
notifHour.setEnabled(false);
|
|
||||||
notifMinute.setEnabled(false);
|
|
||||||
}else{
|
|
||||||
notifHour.setEnabled(true);
|
|
||||||
notifMinute.setEnabled(true);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
chkpersistent.setEnabled(false);
|
|
||||||
notifHour.setEnabled(false);
|
|
||||||
notifMinute.setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setEnabledParts() {
|
||||||
|
if (chkAlarm.isChecked()) {
|
||||||
|
chkPersistent.setEnabled(true);
|
||||||
|
/* La hora no aplica con notificación persistente */
|
||||||
|
cardHora.setEnabled(!chkPersistent.isChecked());
|
||||||
|
cardHora.setAlpha(chkPersistent.isChecked() ? 0.5f : 1f);
|
||||||
|
} else {
|
||||||
|
chkPersistent.setEnabled(false);
|
||||||
|
cardHora.setEnabled(false);
|
||||||
|
cardHora.setAlpha(0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,74 +1,186 @@
|
|||||||
package com.jkanetwork.st.calendariodefrases;
|
package com.jkanetwork.st.calendariodefrases;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.util.TypedValue;
|
import android.content.Intent;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.Insets;
|
import androidx.core.graphics.Insets;
|
||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowCompat;
|
import androidx.core.view.WindowCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
import androidx.core.view.WindowInsetsControllerCompat;
|
import androidx.core.view.WindowInsetsControllerCompat;
|
||||||
|
|
||||||
|
import com.google.android.gms.ads.AdRequest;
|
||||||
|
import com.google.android.gms.ads.AdSize;
|
||||||
|
import com.google.android.gms.ads.AdView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edge-to-edge helpers.
|
* Helpers compartidos del rediseño 2026-10 (mismo papel que App.kt en
|
||||||
|
* FrasesDeAnime, en Java):
|
||||||
*
|
*
|
||||||
* targetSdk 35+ forces edge-to-edge on Android 15+: the decor view spans the
|
* - Edge-to-edge insets (Android 15+ las fuerza con targetSdk 35+).
|
||||||
* whole screen and the classic theme ActionBar no longer pushes the content,
|
* - Barra de navegación inferior compartida.
|
||||||
* so without inset handling the UI draws behind the status bar and the
|
* - Banner AdMob adaptativo creado por código.
|
||||||
* ActionBar. Every activity must call {@link #applySystemBarsInsets(Activity)}
|
|
||||||
* right after setContentView.
|
|
||||||
*/
|
*/
|
||||||
public final class UiUtils {
|
public final class UiUtils {
|
||||||
|
|
||||||
private UiUtils() {
|
private UiUtils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Edge-to-edge */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lays the activity out edge-to-edge on every Android version (uniform
|
* Pinta la activity a pantalla completa y aplica los insets (status bar +
|
||||||
* geometry on old and new phones): the root view keeps painting its
|
* barra de navegación) como padding del root, con el fondo extendiéndose
|
||||||
* background under the system bars, while its content is padded below
|
* por debajo de las barras. Llamar en onCreate tras setContentView.
|
||||||
* them (status bar + ActionBar on top, gesture/nav bar on the bottom).
|
|
||||||
*
|
*
|
||||||
* Call once after setContentView, before any view lookup that depends
|
* El rediseño oculta el ActionBar en todas las pantallas: [navColor] fija
|
||||||
* on layout position.
|
* el color de la barra de navegación (bgCard) y [darkNavbar] ajusta el
|
||||||
|
* color de los iconos del sistema según el tema.
|
||||||
*/
|
*/
|
||||||
public static void applySystemBarsInsets(Activity activity) {
|
public static void applySystemBarsInsets(AppCompatActivity activity, View root,
|
||||||
|
int navColor, boolean darkNavbar) {
|
||||||
|
boolean lightStatusIcons = !isDarkTheme(activity);
|
||||||
WindowCompat.setDecorFitsSystemWindows(activity.getWindow(), false);
|
WindowCompat.setDecorFitsSystemWindows(activity.getWindow(), false);
|
||||||
|
|
||||||
// Apply the padding to the inflated layout root (child of content),
|
|
||||||
// so its background still covers the full screen under the bars.
|
|
||||||
ViewGroup content = activity.findViewById(android.R.id.content);
|
|
||||||
final View root = content.getChildCount() > 0 ? content.getChildAt(0) : content;
|
|
||||||
|
|
||||||
// The classic AppCompat ActionBar overlays the content in
|
|
||||||
// edge-to-edge: add its themed height to the top padding manually.
|
|
||||||
int actionBarSize = 0;
|
|
||||||
if (activity instanceof AppCompatActivity) {
|
|
||||||
ActionBar bar = ((AppCompatActivity) activity).getSupportActionBar();
|
|
||||||
if (bar != null) {
|
|
||||||
TypedValue tv = new TypedValue();
|
|
||||||
activity.getTheme().resolveAttribute(androidx.appcompat.R.attr.actionBarSize, tv, true);
|
|
||||||
actionBarSize = TypedValue.complexToDimensionPixelSize(tv.data,
|
|
||||||
activity.getResources().getDisplayMetrics());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Light app background under the bottom bar -> dark system icons.
|
|
||||||
// The status bar sits over the dark ActionBar -> keep default light icons.
|
|
||||||
WindowInsetsControllerCompat controller =
|
WindowInsetsControllerCompat controller =
|
||||||
WindowCompat.getInsetsController(activity.getWindow(), root);
|
WindowCompat.getInsetsController(activity.getWindow(), root);
|
||||||
controller.setAppearanceLightNavigationBars(true);
|
controller.setAppearanceLightStatusBars(lightStatusIcons);
|
||||||
|
controller.setAppearanceLightNavigationBars(!darkNavbar);
|
||||||
|
|
||||||
|
/* Barra de navegación: Android < 15 usa window.navigationBarColor; en
|
||||||
|
15+ la barra hereda el fondo de la ventana, pero aplica un scrim de
|
||||||
|
contraste en el modo 3 botones que lo quita (API 29+). */
|
||||||
|
activity.getWindow().setNavigationBarColor(navColor);
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= 29) {
|
||||||
|
activity.getWindow().setNavigationBarContrastEnforced(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Franja al fondo del decor con el color de la barra, para el modo
|
||||||
|
gestos en 15+ (la barra hereda el fondo de la ventana). */
|
||||||
|
final View navBackdrop = new View(activity);
|
||||||
|
navBackdrop.setBackgroundColor(navColor);
|
||||||
|
navBackdrop.setClickable(false);
|
||||||
|
((ViewGroup) activity.getWindow().getDecorView()).addView(navBackdrop,
|
||||||
|
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, Gravity.BOTTOM));
|
||||||
|
|
||||||
final int extraTop = actionBarSize;
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(root, (v, windowInsets) -> {
|
ViewCompat.setOnApplyWindowInsetsListener(root, (v, windowInsets) -> {
|
||||||
Insets bars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()
|
Insets bars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()
|
||||||
| WindowInsetsCompat.Type.displayCutout());
|
| WindowInsetsCompat.Type.displayCutout());
|
||||||
v.setPadding(bars.left, bars.top + extraTop, bars.right, bars.bottom);
|
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);
|
||||||
|
navBackdrop.setLayoutParams(new FrameLayout.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT, bars.bottom, Gravity.BOTTOM));
|
||||||
|
navBackdrop.bringToFront();
|
||||||
return WindowInsetsCompat.CONSUMED;
|
return WindowInsetsCompat.CONSUMED;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ¿Tema oscuro del sistema? (para el color de los iconos del sistema) */
|
||||||
|
public static boolean isDarkTheme(Activity activity) {
|
||||||
|
int mask = activity.getResources().getConfiguration().uiMode
|
||||||
|
& Configuration.UI_MODE_NIGHT_MASK;
|
||||||
|
return mask == Configuration.UI_MODE_NIGHT_YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Barra de navegación inferior */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/** Pestañas de la barra inferior */
|
||||||
|
public enum NavTab {INICIO, FAVORITOS, OPCIONES}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepara la barra inferior (view_bottom_nav.xml) incluida en el layout:
|
||||||
|
* marca [active] con color accent (icono+texto) y lanza las demás pestañas.
|
||||||
|
* REORDER_TO_FRONT reutiliza la instancia existente de cada pantalla (sin
|
||||||
|
* recrear, el banner NO se recarga); NO_ANIMATION + overridePendingTransition(0,0)
|
||||||
|
* quita la animación lateral. Las pestañas no se cierran al navegar; las
|
||||||
|
* secundarias (Acerca de) sí.
|
||||||
|
*/
|
||||||
|
public static void setupBottomNav(final AppCompatActivity activity, NavTab active) {
|
||||||
|
int accent = ContextCompat.getColor(activity, R.color.accent);
|
||||||
|
int muted = ContextCompat.getColor(activity, R.color.colorTextMuted);
|
||||||
|
|
||||||
|
styleTab(activity, R.id.nav_inicio, accent, muted, active == NavTab.INICIO);
|
||||||
|
styleTab(activity, R.id.nav_favoritos, accent, muted, active == NavTab.FAVORITOS);
|
||||||
|
styleTab(activity, R.id.nav_opciones, accent, muted, active == NavTab.OPCIONES);
|
||||||
|
|
||||||
|
activity.findViewById(R.id.nav_inicio).setOnClickListener(
|
||||||
|
v -> goTab(activity, active, NavTab.INICIO));
|
||||||
|
activity.findViewById(R.id.nav_favoritos).setOnClickListener(
|
||||||
|
v -> goTab(activity, active, NavTab.FAVORITOS));
|
||||||
|
activity.findViewById(R.id.nav_opciones).setOnClickListener(
|
||||||
|
v -> goTab(activity, active, NavTab.OPCIONES));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Tinta icono+texto de una pestaña (accent la activa, muted las demás) */
|
||||||
|
private static void styleTab(AppCompatActivity activity, int tabId,
|
||||||
|
int accent, int muted, boolean selected) {
|
||||||
|
ViewGroup tab = activity.findViewById(tabId);
|
||||||
|
ImageView icon = (ImageView) tab.getChildAt(0);
|
||||||
|
TextView label = (TextView) tab.getChildAt(1);
|
||||||
|
int color = selected ? accent : muted;
|
||||||
|
icon.setColorFilter(color);
|
||||||
|
label.setTextColor(color);
|
||||||
|
label.getPaint().setFakeBoldText(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Navega a otra pestaña; las pantallas secundarias se cierran al salir */
|
||||||
|
private static void goTab(AppCompatActivity activity, NavTab current, NavTab target) {
|
||||||
|
if (target == current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Class<?> cls;
|
||||||
|
if (target == NavTab.INICIO) {
|
||||||
|
cls = MainActivity.class;
|
||||||
|
} else if (target == NavTab.FAVORITOS) {
|
||||||
|
cls = FavsActivity.class;
|
||||||
|
} else {
|
||||||
|
cls = OptsActivity.class;
|
||||||
|
}
|
||||||
|
Intent intent = new Intent(activity, cls)
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
|
||||||
|
| Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
||||||
|
activity.startActivity(intent);
|
||||||
|
activity.overridePendingTransition(0, 0);
|
||||||
|
/* Solo las pestañas viven en la pila; Acerca de se cierra al salir */
|
||||||
|
if (!(activity instanceof MainActivity) && !(activity instanceof FavsActivity)
|
||||||
|
&& !(activity instanceof OptsActivity)) {
|
||||||
|
activity.finish();
|
||||||
|
activity.overridePendingTransition(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Banner AdMob compartido */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Carga un banner adaptativo anclado en [container] (FrameLayout sobre la
|
||||||
|
* barra inferior, presente en todas las pantallas del rediseño).
|
||||||
|
* El AdView se crea SIEMPRE por código con su adSize adaptativo: si
|
||||||
|
* viniera del XML sin ads:adSize, el SDK no regenera el WebView a la
|
||||||
|
* altura correcta. MobileAds.initialize lo hace MainActivity (tras el
|
||||||
|
* consent UMP); las demás pantallas sólo crean y cargan su AdView.
|
||||||
|
*/
|
||||||
|
public static void loadBannerAd(AppCompatActivity activity, FrameLayout container) {
|
||||||
|
AdView adView = new AdView(activity);
|
||||||
|
// AdSize trabaja en dp, no en píxeles físicos
|
||||||
|
int adWidthDp = (int) (activity.getResources().getDisplayMetrics().widthPixels
|
||||||
|
/ activity.getResources().getDisplayMetrics().density);
|
||||||
|
adView.setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(activity, adWidthDp));
|
||||||
|
adView.setAdUnitId(activity.getString(R.string.banner_ad_unit_id));
|
||||||
|
container.addView(adView, new FrameLayout.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
|
adView.loadAd(new AdRequest.Builder().build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Botón principal (CAMBIAR FRASE): fondo accent, esquinas 12dp (mockup SVG) -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/accent" />
|
||||||
|
<corners android:radius="12dp" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Tarjeta del rediseño: fondo bgCard, borde borderColor, esquinas 20dp (mockup SVG) -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/bgCard" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/borderColor" />
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Píldora de fecha: fondo secundario, esquinas 10dp (mockup SVG) -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/bgSecondary" />
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Día seleccionado del calendario (rediseño): cuadrado azul redondeado.
|
||||||
|
Sobreescribe el "circle" oval de robotocalendarview (resource merge). -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/roboto_calendar_selected_day_background" />
|
||||||
|
<corners android:radius="12dp" />
|
||||||
|
</shape>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 75 KiB |
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12,22a2,2 0 0,0 2,-2h-4a2,2 0 0,0 2,2zM18,16v-5c0,-3.07 -1.63,-5.64 -4.5,-6.32V4a1.5,1.5 0 0,0 -3,0v0.68C7.64,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M15,18l-6,-6 6,-6" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M9,18l6,-6 -6,-6" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd"
|
||||||
|
android:pathData="M12,2a10,10 0 1,0 0,20 10,10 0 0,0 0,-20zM11,6h2v5.586l3.207,3.207 -1.414,1.414L11,12.414V6z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12,2a10,10 0 1,0 0,20a10,10 0 0,0 0,-20zM11,17h2v-6h-2v6zM11,9h2V7h-2v2z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.12 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Día actual del calendario (rediseño): cuadrado con borde redondeado.
|
||||||
|
Sobreescribe el "ring" de robotocalendarview (resource merge). -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#00000000" />
|
||||||
|
<stroke android:width="2dp" android:color="@color/roboto_calendar_current_day_ring" />
|
||||||
|
<corners android:radius="12dp" />
|
||||||
|
</shape>
|
||||||
@@ -1,17 +1,88 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Acerca de rediseñado: header con volver + card de créditos -->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/main_root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/cerebro"
|
android:background="@color/bgMain"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Header con botón volver -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="20dp">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/btn_back"
|
||||||
|
android:layout_width="44dp"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/back"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
app:srcCompat="@drawable/ic_chevron_left"
|
||||||
|
app:tint="@color/textPrimary" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textStart"
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:text="@string/aboutOf"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/borderColor" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="20dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="8dp"
|
android:background="@drawable/bg_card"
|
||||||
android:text='Programado por JKA Network.\n\nLicencias\nRoboto Calendar View - Apache 2.0'
|
android:orientation="vertical"
|
||||||
android:textAlignment="center"
|
android:padding="20dp">
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:textSize="18sp" />
|
<ImageView
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/cerebro" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/about_text"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/about_licenses"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,10 +1,115 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Favoritos rediseñado (mockup SVG): header + búsqueda + cards.
|
||||||
|
Long-press en card: copiar/compartir/borrar. -->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_height="match_parent">
|
android:id="@+id/main_root"
|
||||||
|
|
||||||
<ListView
|
|
||||||
android:id="@+id/listSentences"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/bgMain"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/nav_favoritos"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/borderColor" />
|
||||||
|
|
||||||
|
<!-- Contenido -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingTop="15dp">
|
||||||
|
|
||||||
|
<!-- Búsqueda -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:background="@drawable/bg_pill"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingEnd="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_search"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/search_input"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="@string/buscar_favoritos"
|
||||||
|
android:imeOptions="actionSearch"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textColorHint="@color/colorTextMuted"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Lista de cards -->
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/view_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:divider="@null"
|
||||||
|
android:dividerHeight="12dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
|
<!-- Estado vacío -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/empty_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/lista_vacia"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Banner AdMob (AdView por código en loadBannerAd) -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/adContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<!-- Barra de navegación inferior -->
|
||||||
|
<include
|
||||||
|
android:id="@+id/bottom_nav"
|
||||||
|
layout="@layout/view_bottom_nav" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,100 +1,182 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<!-- Rediseño 2026-10 (mockup SVG): header + píldora de fecha + tarjeta de frase
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
+ botón CAMBIAR FRASE (rewarded) + tarjeta de calendario. Sin ActionBar
|
||||||
|
(ocultada en código). Banner adaptativo al final, sin solape. -->
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/main_root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:background="@color/bgMain"
|
||||||
xmlns:ads="http://schemas.android.com/apk/res-auto">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- ============ HEADER (título) ============ -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="12dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_frasetitle"
|
android:layout_width="0dp"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:text="@string/txt_todaysentence"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txt_frasetext"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_weight="1"
|
||||||
android:layout_alignParentStart="true"
|
android:text="@string/app_name"
|
||||||
android:layout_below="@+id/txt_frasetitle"
|
android:textColor="@color/textPrimary"
|
||||||
android:layout_marginLeft="6dp"
|
android:textSize="18sp"
|
||||||
android:layout_marginRight="6dp"
|
android:textStyle="bold" />
|
||||||
android:layout_marginTop="8dp"
|
</LinearLayout>
|
||||||
android:text="(Aqui la frase)"
|
|
||||||
android:textAlignment="center"
|
<View
|
||||||
android:textColor="@android:color/black"
|
android:layout_width="match_parent"
|
||||||
android:textSize="18sp" />
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/borderColor" />
|
||||||
|
|
||||||
|
<!-- ============ CONTENIDO ============ -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/buttonLayout"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingBottom="12dp">
|
||||||
|
|
||||||
|
<!-- Píldora de fecha -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_date"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:layout_below="@+id/txt_frasetext"
|
android:background="@drawable/bg_pill"
|
||||||
android:layout_marginLeft="48dp"
|
android:gravity="center"
|
||||||
android:layout_marginRight="42dp"
|
android:text="Fecha"
|
||||||
|
android:textColor="@color/colorTextSecondary"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<!-- Tarjeta principal: frase + divisor + favorito/compartir/autor -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:minHeight="230dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_sentence"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fadeScrollbars="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:minHeight="140dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:scrollbarStyle="insideOverlay"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
android:text="(Aquí la frase)"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:background="@color/borderColor" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btnFav"
|
android:id="@+id/btnFav"
|
||||||
android:layout_width="36dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="12dp"
|
android:background="@drawable/star_off"
|
||||||
android:background="@drawable/star_on"
|
android:contentDescription="@string/favorites"
|
||||||
android:contentDescription="Favorite button"
|
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btnShare"
|
android:id="@+id/btnShare"
|
||||||
android:layout_width="58dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginStart="12dp"
|
||||||
android:background="@null"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="Share button"
|
android:contentDescription="@string/compartir"
|
||||||
android:paddingTop="2dp"
|
android:scaleType="centerInside"
|
||||||
app:srcCompat="@android:drawable/ic_menu_share" />
|
app:srcCompat="@drawable/ic_share"
|
||||||
|
app:tint="@color/colorTextSecondary" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_fraseautor"
|
android:id="@+id/txt_fraseautor"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_gravity="top"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:text="(Aqui autor)"
|
android:paddingStart="12dp"
|
||||||
android:textColor="#222" />
|
android:text="(Aquí autor)"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Botón CAMBIAR FRASE (rewarded) -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_change"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/bg_accent"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/btn_change"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<!-- Tarjeta de calendario -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
<com.marcohc.robotocalendar.RobotoCalendarView
|
<com.marcohc.robotocalendar.RobotoCalendarView
|
||||||
android:id="@+id/calendarPicker"
|
android:id="@+id/calendarPicker"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="310dp"
|
android:layout_height="300dp" />
|
||||||
android:layout_alignParentLeft="true"
|
</LinearLayout>
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_below="@+id/buttonLayout"
|
|
||||||
android:layout_marginTop="13dp" />
|
|
||||||
|
|
||||||
<com.google.android.gms.ads.AdView
|
</LinearLayout>
|
||||||
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
</ScrollView>
|
||||||
android:id="@+id/adView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
ads:adSize="BANNER"
|
|
||||||
ads:adUnitId="@string/banner_ad_unit_id">
|
|
||||||
</com.google.android.gms.ads.AdView>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<!-- Banner AdMob (AdView por código en loadBannerAd) -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/adContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<!-- Barra de navegación inferior -->
|
||||||
|
<include
|
||||||
|
android:id="@+id/bottom_nav"
|
||||||
|
layout="@layout/view_bottom_nav" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,82 +1,248 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Opciones rediseñadas (mockup SVG): cards de ajustes con título+descripción
|
||||||
|
+ card Acerca de. Guardado automático (sin botón Guardar): TimePicker para
|
||||||
|
la hora. Banner + barra inferior al final. -->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/main_root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="4dp"
|
android:background="@color/bgMain"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:background="#EBEBEB">
|
|
||||||
|
<!-- Header -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/nav_opciones"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/borderColor" />
|
||||||
|
|
||||||
|
<!-- Contenido -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingTop="15dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Notificación diaria -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_bell"
|
||||||
|
app:tint="@color/accent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/opts_notif_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:text="@string/opts_notif_desc"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/chk_alarm"
|
android:id="@+id/chk_alarm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Notificación persistente -->
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="57dp"
|
android:layout_height="wrap_content"
|
||||||
android:text="¿Notificar frase diaria?"
|
android:layout_marginTop="12dp"
|
||||||
android:textAlignment="textStart" />
|
android:background="@drawable/bg_card"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_bell"
|
||||||
|
app:tint="@color/accent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/opts_pers_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:text="@string/opts_pers_desc"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/chk_persistent"
|
android:id="@+id/chk_persistent"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="57dp"
|
|
||||||
android:text="¿Quieres que sea persistente?"
|
|
||||||
android:textAlignment="textStart" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layoutWhen"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content" />
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:text="Cuando mostrar:"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/spinnerHour"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:dropDownWidth="80dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtseptime"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="4dp"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:layout_weight="0.02"
|
|
||||||
android:text=":"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/spinnerMinute"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:dropDownWidth="80dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<!-- Hora de la notificación: TimePicker al pulsar, hora en gris -->
|
||||||
android:id="@+id/btnSaveNotif"
|
<LinearLayout
|
||||||
|
android:id="@+id/card_hora"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content"
|
||||||
android:text="Guardar cambios" />
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_clock"
|
||||||
|
app:tint="@color/accent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/opts_hora_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_hora"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="8:00"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_chevron_right"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Acerca de -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/card_about"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:srcCompat="@drawable/fondo_opts" />
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_info"
|
||||||
|
app:tint="@color/accent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/opts_about_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_chevron_right"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<!-- Banner AdMob (AdView por código en loadBannerAd) -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/adContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<!-- Barra de navegación inferior -->
|
||||||
|
<include
|
||||||
|
android:id="@+id/bottom_nav"
|
||||||
|
layout="@layout/view_bottom_nav" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Card de frase para Favoritos (mockup SVG): autor en accent + estrella -->
|
||||||
|
<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="wrap_content"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/card_autor"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="Autor"
|
||||||
|
android:textColor="@color/accent"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/card_star"
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:contentDescription="@string/delfav"
|
||||||
|
android:src="@drawable/ic_nav_star"
|
||||||
|
app:tint="@color/star" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/card_sentence"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="3"
|
||||||
|
android:text="Frase"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Barra de navegación inferior compartida (Inicio/Favoritos/Opciones).
|
||||||
|
La pestaña activa se marca desde código (MainActivity.setupBottomNav)
|
||||||
|
tintando icono+texto en accent. -->
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/bottom_nav"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/nav_inicio"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_home"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:text="@string/nav_inicio"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/nav_favoritos"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_nav_star"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:text="@string/nav_favoritos"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/nav_opciones"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_settings"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:text="@string/nav_opciones"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item
|
|
||||||
android:id="@+id/favorites"
|
|
||||||
android:title="@string/favorites"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/options"
|
|
||||||
android:title="@string/options"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/about"
|
|
||||||
android:title="@string/aboutOf"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/exit"
|
|
||||||
android:title="@string/exit"/>
|
|
||||||
</menu>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<item android:id="@+id/copy"
|
|
||||||
android:title="Copiar" />
|
|
||||||
|
|
||||||
<item android:id="@+id/addfav"
|
|
||||||
android:title="Añadir a favoritos" />
|
|
||||||
|
|
||||||
<item android:id="@+id/share"
|
|
||||||
android:title="Compartir" />
|
|
||||||
</menu>
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<item android:id="@+id/copy"
|
<item android:id="@+id/copy"
|
||||||
android:title="Copiar" />
|
android:title="@string/copiar" />
|
||||||
|
|
||||||
<item android:id="@+id/delfav"
|
<item android:id="@+id/delfav"
|
||||||
android:title="Borrar de los favoritos" />
|
android:title="@string/delfav" />
|
||||||
|
|
||||||
<item android:id="@+id/share"
|
<item android:id="@+id/share"
|
||||||
android:title="Compartir" />
|
android:title="@string/compartir" />
|
||||||
</menu>
|
</menu>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Dark mode of the redesign (slate palette) -->
|
||||||
|
<color name="bgMain">#0F172A</color>
|
||||||
|
<color name="bgCard">#1E293B</color>
|
||||||
|
<color name="bgSecondary">#334155</color>
|
||||||
|
<color name="borderColor">#334155</color>
|
||||||
|
<color name="borderStrong">#475569</color>
|
||||||
|
<color name="textPrimary">#F1F5F9</color>
|
||||||
|
<color name="colorTextSecondary">#CBD5E1</color>
|
||||||
|
<color name="colorTextMuted">#94A3B8</color>
|
||||||
|
<color name="accent">#60A5FA</color>
|
||||||
|
<color name="accentDark">#93C5FD</color>
|
||||||
|
<color name="star">#FFD43B</color>
|
||||||
|
|
||||||
|
<color name="roboto_calendar_background">#00000000</color>
|
||||||
|
<color name="roboto_calendar_day_of_the_week_font">#64748B</color>
|
||||||
|
<color name="roboto_calendar_selected_day_font">#FFFFFF</color>
|
||||||
|
<color name="roboto_calendar_selected_day_background">#3B82F6</color>
|
||||||
|
<color name="roboto_calendar_current_day_ring">#60A5FA</color>
|
||||||
|
<color name="roboto_calendar_day_of_the_month_font">#E2E8F0</color>
|
||||||
|
<color name="roboto_calendar_circle_1">#F87171</color>
|
||||||
|
<color name="roboto_calendar_circle_2">#64748B</color>
|
||||||
|
<color name="roboto_calendar_month_font">#93C5FD</color>
|
||||||
|
<color name="roboto_calendar_month_arrow">#60A5FA</color>
|
||||||
|
</resources>
|
||||||
@@ -1,18 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#3F51B5</color>
|
<!-- Theme colors (ActionBar hidden everywhere after the redesign) -->
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
<color name="colorPrimary">#1E3A8A</color>
|
||||||
<color name="colorAccent">#f46283</color>
|
<color name="colorPrimaryDark">#1E3A8A</color>
|
||||||
|
<color name="colorAccent">#3B82F6</color>
|
||||||
|
|
||||||
<!-- Calendar colors -->
|
<!-- Redesign palette (SVG mockup): slate + blue -->
|
||||||
<color name="roboto_calendar_background">#340079c4</color> <!-- Transparent -->
|
<color name="bgMain">#F8FAFC</color>
|
||||||
<color name="roboto_calendar_day_of_the_week_font">#161d20</color>
|
<color name="bgCard">#FFFFFF</color>
|
||||||
|
<color name="bgSecondary">#F1F5F9</color>
|
||||||
|
<color name="borderColor">#E2E8F0</color>
|
||||||
|
<color name="borderStrong">#CBD5E1</color>
|
||||||
|
<color name="textPrimary">#0F172A</color>
|
||||||
|
<color name="colorTextSecondary">#475569</color>
|
||||||
|
<color name="colorTextMuted">#94A3B8</color>
|
||||||
|
<color name="accent">#3B82F6</color>
|
||||||
|
<color name="accentDark">#1E3A8A</color>
|
||||||
|
<color name="star">#FCC419</color>
|
||||||
|
|
||||||
|
<!-- Calendar (robotocalendarview overrides, SVG mockup):
|
||||||
|
selected day = blue rounded square + white dot, today = blue outline,
|
||||||
|
days with a phrase get a red dot, month title in dark blue -->
|
||||||
|
<color name="roboto_calendar_background">#00000000</color>
|
||||||
|
<color name="roboto_calendar_day_of_the_week_font">#94A3B8</color>
|
||||||
<color name="roboto_calendar_selected_day_font">#FFFFFF</color>
|
<color name="roboto_calendar_selected_day_font">#FFFFFF</color>
|
||||||
<color name="roboto_calendar_selected_day_background">#f46283</color>
|
<color name="roboto_calendar_selected_day_background">#3B82F6</color>
|
||||||
<color name="roboto_calendar_current_day_ring">#393939</color>
|
<color name="roboto_calendar_current_day_ring">#3B82F6</color>
|
||||||
<color name="roboto_calendar_day_of_the_month_font">#000000</color>
|
<color name="roboto_calendar_day_of_the_month_font">#334155</color>
|
||||||
<color name="roboto_calendar_circle_1">#e2015b</color>
|
<color name="roboto_calendar_circle_1">#EF4444</color>
|
||||||
<color name="roboto_calendar_circle_2">#404040</color>
|
<color name="roboto_calendar_circle_2">#94A3B8</color>
|
||||||
<color name="roboto_calendar_month_font">#3F51B5</color>
|
<color name="roboto_calendar_month_font">#1E3A8A</color>
|
||||||
<color name="roboto_calendar_month_arrow">#3F51B5</color>
|
<color name="roboto_calendar_month_arrow">#3B82F6</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,16 +1,13 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<!-- Calendar dimens (rediseño SVG: fuente del día algo menor para el
|
||||||
|
cuadrado redondeado, resto igual que antes) -->
|
||||||
<!-- Calendar dimens -->
|
|
||||||
<dimen name="roboto_calendar_padding">8dp</dimen>
|
<dimen name="roboto_calendar_padding">8dp</dimen>
|
||||||
<dimen name="roboto_calendar_month_margin_bottom">8dp</dimen>
|
<dimen name="roboto_calendar_month_margin_bottom">8dp</dimen>
|
||||||
<dimen name="roboto_calendar_week_margin_bottom">5dp</dimen>
|
<dimen name="roboto_calendar_week_margin_bottom">5dp</dimen>
|
||||||
<dimen name="roboto_calendar_day_of_the_month_background_size">40dp</dimen>
|
<dimen name="roboto_calendar_day_of_the_month_background_size">40dp</dimen>
|
||||||
<dimen name="roboto_calendar_circle_size">4dp</dimen>
|
<dimen name="roboto_calendar_circle_size">4dp</dimen>
|
||||||
<dimen name="roboto_calendar_ring_size">18dp</dimen>
|
<dimen name="roboto_calendar_ring_size">18dp</dimen>
|
||||||
<dimen name="roboto_calendar_month_font">18sp</dimen>
|
<dimen name="roboto_calendar_month_font">15sp</dimen>
|
||||||
<dimen name="roboto_calendar_day_of_week_font">16sp</dimen>
|
<dimen name="roboto_calendar_day_of_week_font">13sp</dimen>
|
||||||
<dimen name="roboto_calendar_day_of_the_month_font">16sp</dimen>
|
<dimen name="roboto_calendar_day_of_the_month_font">14sp</dimen>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,19 +1,48 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Calendario de frases</string>
|
<string name="app_name">Calendario de frases</string>
|
||||||
<string name="txt_todaysentence">Frase del día</string>
|
<string name="txt_todaysentence">Frase del día</string>
|
||||||
<string name="exit">Salir</string>
|
|
||||||
<string name="favorites">Favoritos</string>
|
<string name="favorites">Favoritos</string>
|
||||||
<string name="options">Opciones</string>
|
|
||||||
<string name="aboutOf">Acerca de</string>
|
<string name="aboutOf">Acerca de</string>
|
||||||
<string name="sharefrom"> -A través de Calendario de Frases, consíguela aquí https://play.google.com/store/apps/details?id=com.jkanetwork.st.calendariodefrases -</string>
|
<string name="sharefrom"> -A través de Calendario de Frases, consíguela aquí https://play.google.com/store/apps/details?id=com.jkanetwork.st.calendariodefrases -</string>
|
||||||
<string name="channel_name">Frase del día</string>
|
<string name="channel_name">Frase del día</string>
|
||||||
<string name="channel_desc">Notificación diaria con la frase del día</string>
|
<string name="channel_desc">Notificación diaria con la frase del día</string>
|
||||||
<string name="notif_title">Frase de hoy:</string>
|
<string name="notif_title">Frase de hoy:</string>
|
||||||
<string name="welcome_title">Bienvenido</string>
|
<string name="welcome_title">Bienvenido</string>
|
||||||
<string name="welcome_text">Bienvenidos a Calendario de Frases, donde cada día disfrutarás de una nueva cita celebre o de un nuevo refrán que podrás guardar o compartir con tus amigos.\nAdemás, podrás poner una notificación para que te avise de la frase del día a la hora que quieras, por ejemplo, al desperarte.\nRecuerda que no puedes ver frases de los días que no hayan pasado aún con la aplicación.\nEsperamos que la disfrutes.</string>
|
<string name="welcome_text">Bienvenidos a Calendario de Frases, donde cada día disfrutarás de una nueva cita celebre o de un nuevo refrán que podrás guardar o compartir con tus amigos.\nAdemás, podrás poner una notificación para que te avise de la frase del día a la hora que quieras, por ejemplo, al despertarte.\nRecuerda que no puedes ver frases de los días que no hayan pasado aún con la aplicación.\nEsperamos que la disfrutes.</string>
|
||||||
<string name="welcome_button">Empecemos</string>
|
<string name="welcome_button">Empecemos</string>
|
||||||
<string name="copied">Copiado al portapapeles</string>
|
<string name="copied">Copiado al portapapeles</string>
|
||||||
<string name="share_with">Compartir con</string>
|
<string name="share_with">Compartir con</string>
|
||||||
<string name="sentence_of_day">Frase del %1$d de %2$s</string>
|
<string name="sentence_of_day">Frase del %1$d de %2$s</string>
|
||||||
|
|
||||||
|
<!-- Rediseño 2026-10 (mockup SVG) -->
|
||||||
|
<string name="btn_change">CAMBIAR FRASE</string>
|
||||||
|
<string name="back">Volver</string>
|
||||||
|
<string name="about_text">Programado por JKA Network.</string>
|
||||||
|
<string name="about_licenses">Licencias\nRoboto Calendar View - Apache 2.0</string>
|
||||||
|
<string name="guardado">Guardado</string>
|
||||||
|
<!-- Bottom nav -->
|
||||||
|
<string name="nav_inicio">Inicio</string>
|
||||||
|
<string name="nav_favoritos">Favoritos</string>
|
||||||
|
<string name="nav_opciones">Opciones</string>
|
||||||
|
<!-- Favoritos -->
|
||||||
|
<string name="buscar_favoritos">Buscar en favoritos…</string>
|
||||||
|
<string name="lista_vacia">Todavía no hay nada por aquí</string>
|
||||||
|
<string name="copiar">Copiar</string>
|
||||||
|
<string name="delfav">Borrar de los favoritos</string>
|
||||||
|
<string name="compartir">Compartir</string>
|
||||||
|
<!-- Opciones -->
|
||||||
|
<string name="opts_notif_title">Notificación diaria</string>
|
||||||
|
<string name="opts_notif_desc">Recibir cada día la frase como notificación</string>
|
||||||
|
<string name="opts_pers_title">Notificación persistente</string>
|
||||||
|
<string name="opts_pers_desc">Mantener la frase fijada hasta que la veas</string>
|
||||||
|
<string name="opts_hora_title">Hora de la notificación</string>
|
||||||
|
<string name="opts_notif_perm_msg">Sin el permiso de notificaciones no podrás recibir la frase diaria.\n¿Quieres activarlas en los ajustes del sistema?</string>
|
||||||
|
<string name="opts_notif_perm_ok">Abrir ajustes</string>
|
||||||
|
<string name="opts_about_title">Acerca de</string>
|
||||||
|
<!-- Rewarded -->
|
||||||
|
<string name="rewarded_change_title">¡Recompensa conseguida!</string>
|
||||||
|
<string name="rewarded_change_msg">Ver el anuncio nos ayuda a mantener la app. ¿Quieres cambiar la frase de hoy?</string>
|
||||||
|
<string name="rewarded_change_ok">Cambiar la frase</string>
|
||||||
|
<string name="rewarded_not_ready">Aún no hay un anuncio disponible, espera un momento</string>
|
||||||
|
<string name="rewarded_no_sentence">Aquí no puedes cambiar la frase: este día aún no ha llegado</string>
|
||||||
</resources>
|
</resources>
|
||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
#Wed Oct 21 00:08:36 CEST 2026
|
#Wed Oct 21 13:13:25 UTC 2026
|
||||||
VERSION_CODE=382
|
VERSION_CODE=386
|
||||||
Reference in new issue
Block a user