Compare commits
26
Commits
985ff76d21
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
703e31203f | ||
|
|
0809209610 | ||
|
|
1c29bc7d73 | ||
|
|
43f59774ed | ||
|
|
f2b99def2f | ||
|
|
0755667a31 | ||
|
|
08070f203a | ||
|
|
9b2a527cdb | ||
|
|
fbd7b6f1c6 | ||
|
|
ea9795403d | ||
|
|
13aac8f959 | ||
|
|
b36bbd46f2 | ||
|
|
45acdb666f | ||
|
|
8e005b36db | ||
|
|
5bc2ae7c5c | ||
|
|
9a39cf3a75 | ||
|
|
b9edb522fb | ||
|
|
034a63bcee | ||
|
|
8683dec8da | ||
|
|
6ca5a0d0ea | ||
|
|
d45dd1da07 | ||
|
|
f222e3ab31 | ||
|
|
4cd76ae030 | ||
|
|
78f0b0575c | ||
|
|
af2c940a50 | ||
|
|
4e6319ba05 |
No files matched your search
@@ -2,28 +2,25 @@
|
||||
|
||||
App Android (Kotlin) de frase diaria de anime con notificación. Publicada en Google Play como `com.jkanetwork.st.frasesdeanime` (keystore de release: NO tocar `adb uninstall` en el dispositivo de pruebas, rompe cuentas/keys).
|
||||
|
||||
## Toolchain (tras migración 2026-10)
|
||||
## Toolchain
|
||||
|
||||
- Gradle 8.11.1 · AGP 8.10.0 · Kotlin 2.2.10 · JDK 17
|
||||
- compileSdk/targetSdk 36 · minSdk 24 (exigido por play-services-ads 25.5.0, no bajar sin bajar ads)
|
||||
- ViewBinding activado; NO hay kotlin-android-extensions ni synthetics (eliminados)
|
||||
- Gradle 9.6.0 · AGP 9.4.1 (Kotlin built-in, sin plugin kotlin-android) · JDK 17
|
||||
- compileSdk/targetSdk 36 · minSdk 26
|
||||
- Release con R8 (`minifyEnabled` + `shrinkResources`); reglas keep en `proguard-rules.pro`
|
||||
- ViewBinding activado; NO hay kotlin-android-extensions ni synthetics
|
||||
- `versionCode` se autoincrementa en cada build leyendo `app/versioncode.count` — cada `assemble*` modifica ese fichero, es ruido esperado en `git status`
|
||||
|
||||
## Decisiones de diseño (lecciones de la migración)
|
||||
## Decisiones de diseño
|
||||
|
||||
- **Anko eliminado por completo (2026)**. Estaba abandonado desde 2019 y solo se resolvía por el espejo de jcenter de Aliyun (jcenter está muerto). Sustituciones:
|
||||
- `anko-sqlite` → `SQLiteOpenHelper` nativo (`SQLiteHelper.kt`): `db.select(...).parseList(IntParser)` → `rawQuery` + bucle `moveToNext()`, `db.insert("col" to v)` → `ContentValues`.
|
||||
- `anko-commons` (`toast`/`share`/`browse`/`startActivity<T>`) → helpers propios top-level en `App.kt` (misma firma, cero dependencias).
|
||||
- Layouts DSL (`verticalLayout {}`, `alert { customView {} }`) → XML (`activity_list.xml`, `activity_about.xml`, `activity_animes_sel.xml`) + ViewBinding; los `alert{}` → `AlertDialog.Builder` de appcompat.
|
||||
- Si se añade una pantalla nueva: layout XML + ViewBinding, nunca DSL.
|
||||
- **Arquitectura de datos (rediseño 2026-10)**: dos BDs separadas.
|
||||
- `assets/catalogo.sqlite` — catálogo (FRASES, ANIMES), read-only, editado directamente con herramientas SQL. Versión de contenido en `PRAGMA user_version` (cabecera offset 60); la app recopia el asset cuando trae versión mayor. Regla editorial: IDs nunca se renumeran, solo se añaden.
|
||||
- **Sin Anko**: helpers propios top-level en `App.kt` (`toast`/`share`/`browse`/`startActivity<T>`) y acceso a BD con `SQLiteOpenHelper` nativo (`SQLiteHelper.kt`).
|
||||
- **Pantallas nuevas**: layout XML + ViewBinding, nunca DSL.
|
||||
- **Arquitectura de datos**: dos BDs separadas.
|
||||
- `assets/catalogo.sqlite` — catálogo (FRASES, ANIMES), read-only, editado directamente con herramientas SQL. Versión de contenido en `PRAGMA user_version` (cabecera offset 60); la app recopia el asset cuando cambia el versionCode del APK. Regla editorial: IDs nunca se renumeran, solo se añaden; los de ANIMES además contiguos (hoy 1..85).
|
||||
- `app.sqlite` — estado del usuario (FRASESVI, FRASESFAV, ANIMESON), creada por código, versionada normal. Nunca se toca al actualizar el catálogo.
|
||||
- Migración única desde `otaku.sqlite` legacy (todo mezclado) al primer arranque: copia las 3 tablas de estado y borra la vieja.
|
||||
- Migración única desde `otaku.sqlite` legacy al primer arranque: copia las 3 tablas de estado y borra la vieja.
|
||||
- La query cruzada catálogo+estado ("frase del día": frases de animes seleccionados, no vistas) se resuelve con las listas pequeñas de estado en memoria + `IN (...)` al catálogo — sin ATTACH.
|
||||
- `res/raw/loadsqlfile` fue eliminado; el parser `split(";\n")` tenía un bug real: el fichero pasó a CRLF en 2024 y el split devolvía 1 sola query gigante → instalación limpia rota.
|
||||
- **Bug conservado a propósito**: `SQLiteHelper.setAllAnimeSel()` itera `for (pos in animeIDs)` usando `animeIDs[pos-1]` (índice posicional raro, funciona porque los IDs coinciden con la posición). No "arreglar" sin testear el flujo seleccionar/deseleccionar todos.
|
||||
- **IDs de AdMob**: `admob_id` = ID de *aplicación* (manifest meta-data); `admob_videoid` = ID de *unidad* (para `RewardedAd.load`). Confundirlos hace que ningún anuncio cargue (bug real corregido en la migración 2026; la versión de 2024 usaba `admob_id` en `RewardedAd.load`).
|
||||
- **Edge-to-edge (Android 15+)**: con targetSdk 36 el sistema fuerza dibujar bajo las barras. Todas las activities llaman a `applySystemBarsInsets(binding.root)` (helper en `App.kt`) tras `setContentView`: uniformiza `setDecorFitsSystemWindows(false)`, pone iconos de sistema oscuros (fondos claros de la app) y aplica status bar + ActionBar + barra de gestos como padding del root, con el fondo extendiéndose por debajo. Una pantalla nueva debe llamarlo igual.
|
||||
- **IDs de AdMob**: `admob_id` = ID de *aplicación* (manifest meta-data); `admob_videoid` = ID de *unidad* (para `RewardedAd.load`). Confundirlos hace que ningún anuncio cargue.
|
||||
- **Notificaciones**:
|
||||
- Canal "STN" se crea en `AlarmNotif.onReceive` (idempotente).
|
||||
- `POST_NOTIFICATIONS`: se pide en runtime una sola vez (guardado en pref `ASKEDNOTIF`) — en el "Empezemos" del diálogo de bienvenida la primera vez, o al cargar en arranques posteriores. Si el usuario guarda la config con la alarma activa y sigue sin permiso (Android 13+), `OptsActivity` le ofrece abrir los ajustes del sistema. Nunca repetir el dialog del sistema en cada arranque: Android lo silencia tras 2 denegaciones y molesta.
|
||||
@@ -48,10 +45,7 @@ App Android (Kotlin) de frase diaria de anime con notificación. Publicada en Go
|
||||
|
||||
- [ ] `AlarmNotif`: la alarma repetida pierde precisión con Doze; valorar `setExactAndAllowWhileIdle` + `WorkManager` si algún día no llega la notificación
|
||||
- [ ] Probar en dispositivo real antes de subir a Play (notificación, alarma, rewarded, migración otaku.sqlite→app.sqlite en una instalación vieja)
|
||||
- [x] Request runtime de `POST_NOTIFICATIONS` (2026-10)
|
||||
- [x] Rediseño BD: catalogo.sqlite (asset) + app.sqlite (estado) con migración legacy (2026-10)
|
||||
- [x] Migración de Anko (2026-10) — build debug y release verificados
|
||||
- [x] Toolchain moderna: AGP 8.10 / Gradle 8.11.1 / Kotlin 2.2.10 / SDK 36
|
||||
- [x] Catálogo 2026-10-19: 87 frases y 14 animes nuevos, user_version 10
|
||||
|
||||
## Reglas del repo
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ El APK release sale sin firmar (`app-release-unsigned.apk`); fírmalo con tu key
|
||||
| `OptsActivity.kt` | Configuración (hora de notificación, notificación persistente) |
|
||||
| `FavsActivity.kt` / `AnimesSelActivity.kt` / `AboutActivity.kt` | Favoritos, selección de animes, acerca de |
|
||||
|
||||
Sin Anko desde la migración de 2026: los helpers que lo sustituyen (`toast`, `share`, `browse`, `startActivity<T>`, `putAlarm`) viven en `App.kt`; la BD usa `SQLiteOpenHelper` nativo; los layouts DSL pasaron a XML + ViewBinding.
|
||||
|
||||
## Licencia
|
||||
|
||||
|
||||
+12
-12
@@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
}
|
||||
|
||||
// Credenciales de firma de release: viven en keystore.properties (ignorado por git).
|
||||
@@ -17,7 +16,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.jkanetwork.st.frasesdeanime"
|
||||
minSdk 24
|
||||
minSdk 26
|
||||
targetSdk 36
|
||||
// Sube automáticamente la build en cada compilacion
|
||||
def versionPropsFile = file('versioncode.count')
|
||||
@@ -43,9 +42,9 @@ android {
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
if (keystorePropsFile.exists()) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
@@ -55,20 +54,21 @@ android {
|
||||
viewBinding true
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
// AGP 9: DSL kotlinOptions -> kotlin.compilerOptions (built-in Kotlin)
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
|
||||
implementation 'com.google.android.gms:play-services-ads:25.5.0'
|
||||
implementation 'com.google.android.ump:user-messaging-platform:4.0.0'
|
||||
}
|
||||
Vendored
+6
-23
@@ -1,25 +1,8 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /home/kprkpr/AndroidStudio/sdkLinux/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
# WorkManager llega vía play-services-ads e instancia su BD Room
|
||||
# (androidx.work.impl.WorkDatabase_Impl) por reflexión; el R8 optimizador
|
||||
# rompe ese constructor si no se conserva.
|
||||
-keep class androidx.work.** { *; }
|
||||
-keep class * extends androidx.room.RoomDatabase { <init>(...); }
|
||||
-dontwarn androidx.work.**
|
||||
@@ -25,6 +25,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".FavsActivity" android:exported="false"/>
|
||||
<activity android:name=".DiaryActivity" android:exported="false"/>
|
||||
<activity android:name=".AnimesSelActivity" android:exported="false"/>
|
||||
<activity android:name=".OptsActivity" android:exported="false"/>
|
||||
<activity android:name=".AboutActivity" android:exported="false"/>
|
||||
|
||||
Binary file not shown.
@@ -16,6 +16,7 @@ class AboutActivity : AppCompatActivity(){
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityAboutBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
applySystemBarsInsets(binding.root)
|
||||
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.jkanetwork.st.frasesdeanime
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.BaseAdapter
|
||||
import android.widget.CheckBox
|
||||
import android.widget.TextView
|
||||
|
||||
/** Fila de la lista de selección de animes (item_anime_check.xml).
|
||||
* data class AnimeRow [id] = IDAnime, [name], [sel] = seleccionado. */
|
||||
data class AnimeRow(val id: Int, val name: String, var sel: Boolean)
|
||||
|
||||
/** Adapter para la selección de animes con filtro de búsqueda.
|
||||
* El toggle (check) se notifica por [onToggle] para persistirlo en BD. */
|
||||
class AnimeSelAdapter(
|
||||
private var rows: List<AnimeRow>,
|
||||
private val onToggle: (AnimeRow) -> Unit
|
||||
) : BaseAdapter() {
|
||||
|
||||
private var query: String = ""
|
||||
|
||||
fun update(newRows: List<AnimeRow>) {
|
||||
rows = newRows
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun filter(text: String) {
|
||||
query = text.trim()
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
private val visible: List<AnimeRow>
|
||||
get() = if (query.isEmpty()) rows else rows.filter { it.name.contains(query, ignoreCase = true) }
|
||||
|
||||
override fun getCount(): Int = visible.size
|
||||
override fun getItem(position: Int): Any = visible[position]
|
||||
override fun getItemId(position: Int): Long = visible[position].id.toLong()
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
val v = convertView ?: android.view.LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_anime_check, parent, false)
|
||||
val row = visible[position]
|
||||
v.findViewById<TextView>(R.id.txt_name).text = row.name
|
||||
v.findViewById<CheckBox>(R.id.chk_anime).isChecked = row.sel
|
||||
v.setOnClickListener {
|
||||
row.sel = !row.sel
|
||||
v.findViewById<CheckBox>(R.id.chk_anime).isChecked = row.sel
|
||||
onToggle(row)
|
||||
}
|
||||
return v
|
||||
}
|
||||
}
|
||||
@@ -3,66 +3,38 @@ package com.jkanetwork.st.frasesdeanime
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import android.widget.ListView
|
||||
import android.content.res.Configuration
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityAnimesSelBinding
|
||||
|
||||
/**
|
||||
* Created by kprkpr on 25/07/17.
|
||||
* Help: https://www.youtube.com/watch?v=x-M1L6tcsLo
|
||||
* Layout DSL de Anko migrado a XML + ViewBinding. Buscador superior (2026-10).
|
||||
* Rediseño 2026-10 (estilo Opciones): header con atrás + buscador + lista de
|
||||
* cards con check a la izquierda. Guardado directo en BD al togglear.
|
||||
*/
|
||||
class AnimesSelActivity : AppCompatActivity(){
|
||||
class AnimesSelActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityAnimesSelBinding
|
||||
private lateinit var adapter: AnimeSelAdapter
|
||||
private val db by lazy { SQLiteHelper(applicationContext) }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityAnimesSelBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.hide()
|
||||
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
||||
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||
setupBottomNav(binding.bottomNav, NavTab.AJUSTES)
|
||||
loadBannerAd(binding.adContainer)
|
||||
|
||||
val db = SQLiteHelper(applicationContext) //Database connection
|
||||
binding.btnBack.setOnClickListener { finish() }
|
||||
|
||||
if (db.getAllAnimeSel()){ //If all selected
|
||||
binding.btnSel.text = "Deseleccionar todos"
|
||||
}else{
|
||||
binding.btnSel.text = "Seleccionar todos"
|
||||
adapter = AnimeSelAdapter(loadRows()) { row ->
|
||||
db.setAnimeSel(row.id)
|
||||
}
|
||||
|
||||
//Load ids, names and selection state
|
||||
val arrayIDs = db.getAllAnimeIDs()
|
||||
val arrayNames = db.getAllAnimeNames()
|
||||
val length = arrayIDs.size
|
||||
|
||||
val listSel = ArrayList<Boolean>()
|
||||
val listNames = ArrayList<String>()
|
||||
for (i in 0..length -1){
|
||||
listSel.add(db.getAnimeSel(arrayIDs[i]))
|
||||
listNames.add(arrayNames[i])
|
||||
}
|
||||
|
||||
// Adapter with search filter. CustomListAdapter class is in "CustomListAdapter.kt"
|
||||
val adapter = CustomListAdapter<String>(
|
||||
{ listNames },
|
||||
{ index, names, view ->
|
||||
val checkBox = CheckBox(this)
|
||||
checkBox.layoutParams = android.widget.AbsListView.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(56))
|
||||
checkBox.text = names[index]
|
||||
checkBox.isChecked = listSel[index]
|
||||
checkBox.textSize = 18f
|
||||
checkBox.setPadding(dpToPx(16), 0, dpToPx(16), 0)
|
||||
checkBox.setOnClickListener {
|
||||
db.setAnimeSel(db.getIDAnimeFromName(names[index]))
|
||||
listSel[index] = !listSel[index]
|
||||
checkBox.isChecked = listSel[index]
|
||||
}
|
||||
checkBox
|
||||
})
|
||||
|
||||
binding.viewList.adapter = adapter
|
||||
|
||||
binding.txtSearch.addTextChangedListener(object : TextWatcher {
|
||||
@@ -71,19 +43,26 @@ class AnimesSelActivity : AppCompatActivity(){
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||
})
|
||||
|
||||
refreshSelButton()
|
||||
binding.btnSel.setOnClickListener {
|
||||
db.setAllAnimeSel()
|
||||
restartActivity(this)
|
||||
adapter.update(loadRows())
|
||||
refreshSelButton()
|
||||
}
|
||||
}
|
||||
|
||||
private fun dpToPx(dp: Int): Int =
|
||||
(dp * resources.displayMetrics.density).toInt()
|
||||
|
||||
/** Flecha Atrás del ActionBar */
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
finish()
|
||||
return true
|
||||
/** Recarga IDs, nombres y estado de selección de la BD */
|
||||
private fun loadRows(): List<AnimeRow> {
|
||||
val ids = db.getAllAnimeIDs()
|
||||
val names = db.getAllAnimeNames()
|
||||
return ids.indices.map { i -> AnimeRow(ids[i], names[i], db.getAnimeSel(ids[i])) }
|
||||
}
|
||||
|
||||
private fun refreshSelButton() {
|
||||
binding.btnSel.text = if (db.getAllAnimeSel()) {
|
||||
getString(R.string.deseleccionar_todos)
|
||||
} else {
|
||||
getString(R.string.seleccionar_todos)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,26 @@ import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.app.PendingIntent
|
||||
import java.util.Calendar
|
||||
import android.app.AlarmManager
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import com.jkanetwork.st.frasesdeanime.databinding.ViewBottomNavBinding
|
||||
import com.google.android.gms.ads.AdRequest
|
||||
import com.google.android.gms.ads.AdSize
|
||||
import com.google.android.gms.ads.AdView
|
||||
|
||||
/**
|
||||
* Created by kprkpr on 18/07/17.
|
||||
@@ -29,7 +43,148 @@ fun restartActivity(act: AppCompatActivity){
|
||||
act.startActivity(intent)
|
||||
}
|
||||
|
||||
/* Helpers que sustituyen a org.jetbrains.anko:anko-commons */
|
||||
/* Edge-to-edge (Android 15+ lo fuerza con targetSdk 35+): el contenido dibuja bajo
|
||||
las barras del sistema. Este helper pinta a pantalla completa y aplica los insets
|
||||
(status bar + ActionBar + barra de navegación) como padding del root del layout,
|
||||
con el fondo extendiéndose por debajo (onApplyWindowInsets se dispara tras el
|
||||
primer layout, sin parpadeo). */
|
||||
|
||||
/**
|
||||
* Aplica insets de sistema como padding de [root] dejando el fondo a pantalla completa.
|
||||
* Debe llamarse en onCreate tras setContentView; reemplaza al comportamiento pre-Android 15.
|
||||
* Si la activity tiene ActionBar clásico (theme DarkActionBar) se suma su altura arriba.
|
||||
*
|
||||
* Rediseño 2026-10: [navColor] fija el color de la barra de navegación (por defecto
|
||||
* colorPrimary, para pantallas con ActionBar); [darkNavbar]/[lightStatusIcons] ajustan
|
||||
* el color de los iconos del sistema (la main usa fondos claros y modo oscuro real).
|
||||
*/
|
||||
fun AppCompatActivity.applySystemBarsInsets(root: View, navColor: Int? = null, darkNavbar: Boolean = true, lightStatusIcons: Boolean = true) {
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
/* Iconos del sistema según el fondo que quede bajo cada barra. */
|
||||
WindowInsetsControllerCompat(window, root).apply {
|
||||
isAppearanceLightStatusBars = lightStatusIcons
|
||||
isAppearanceLightNavigationBars = !darkNavbar
|
||||
}
|
||||
/* Barra de navegación: Android < 15 usa window.navigationBarColor; Android 15+
|
||||
la ignora (hereda el fondo de la ventana), pero en la navbar de 3 botones aplica
|
||||
un scrim de contraste ~60% que oscurece el color: isNavigationBarContrastEnforced
|
||||
(API 29+) lo quita. La franja del decor cubre el modo gestos en 15+. */
|
||||
val nav = navColor ?: colorPrimary(this)
|
||||
window.navigationBarColor = nav
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
window.isNavigationBarContrastEnforced = false
|
||||
}
|
||||
/* Android 15+ ignora navigationBarColor y la barra de gestos hereda el fondo de la
|
||||
ventana: pintamos una franja del color al fondo del decor, bajo la barra.
|
||||
Su altura se fija con el inset real en el listener de abajo. */
|
||||
val navBackdrop = View(this).apply {
|
||||
setBackgroundColor(nav)
|
||||
isClickable = false
|
||||
}
|
||||
(window.decorView as ViewGroup).addView(navBackdrop,
|
||||
FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, Gravity.BOTTOM))
|
||||
ViewCompat.setOnApplyWindowInsetsListener(root) { v, windowInsets ->
|
||||
val bars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or
|
||||
WindowInsetsCompat.Type.displayCutout())
|
||||
/* Sin sumar la ActionBar: con setDecorFitsSystemWindows(false), el
|
||||
ActionBarOverlayLayout de appcompat ya recoloca ActionBar y contenido. */
|
||||
v.setPadding(bars.left, bars.top, bars.right, bars.bottom)
|
||||
navBackdrop.layoutParams.height = bars.bottom
|
||||
navBackdrop.layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
navBackdrop.requestLayout()
|
||||
navBackdrop.bringToFront()
|
||||
WindowInsetsCompat.CONSUMED
|
||||
}
|
||||
}
|
||||
|
||||
/** colorPrimary del theme (para la franja de la barra de navegación) */
|
||||
private fun colorPrimary(act: AppCompatActivity): Int {
|
||||
val tv = TypedValue()
|
||||
act.theme.resolveAttribute(androidx.appcompat.R.attr.colorPrimary, tv, true)
|
||||
return tv.data
|
||||
}
|
||||
|
||||
/* ---------------- Bottom nav (rediseño 2026-10) ---------------- */
|
||||
|
||||
/** Pestañas de la barra de navegación inferior */
|
||||
enum class NavTab { INICIO, FAVORITOS, DIARIO, AJUSTES }
|
||||
|
||||
/**
|
||||
* Prepara la barra de navegación inferior (view_bottom_nav.xml) en una activity:
|
||||
* marca [active] con color accent (icono+texto) y lanza las demás pestañas.
|
||||
* Navegación: REORDER_TO_FRONT reutiliza la instancia existente de cada pantalla
|
||||
* (sin recrear → el banner NO se recarga) y NO_ANIMATION + overridePendingTransition(0,0)
|
||||
* quita la animación lateral del cambio de activity. Las pantallas tab no se
|
||||
* cierran nunca al navegar (la pila queda acotada a las 4 tabs + pantallas hijas);
|
||||
* las secundarias (AnimesSel) sí se cierran al irse por una tab.
|
||||
*/
|
||||
fun AppCompatActivity.setupBottomNav(nav: ViewBottomNavBinding, active: NavTab) {
|
||||
val accent = androidx.core.content.ContextCompat.getColor(this, R.color.accent)
|
||||
val muted = androidx.core.content.ContextCompat.getColor(this, R.color.colorTextMuted)
|
||||
|
||||
/* Pantallas que corresponden a una tab: no se cierran al navegar */
|
||||
val tabScreens = setOf(MainActivity::class.java, FavsActivity::class.java,
|
||||
DiaryActivity::class.java, OptsActivity::class.java)
|
||||
|
||||
fun styleTab(tab: android.view.ViewGroup, selected: Boolean) {
|
||||
val icon = tab.getChildAt(0) as android.widget.ImageView
|
||||
val label = tab.getChildAt(1) as android.widget.TextView
|
||||
val color = if (selected) accent else muted
|
||||
icon.setColorFilter(color)
|
||||
label.setTextColor(color)
|
||||
label.paint.isFakeBoldText = selected
|
||||
}
|
||||
|
||||
fun go(target: NavTab) {
|
||||
if (target == active) return
|
||||
val cls = when (target) {
|
||||
NavTab.INICIO -> MainActivity::class.java
|
||||
NavTab.FAVORITOS -> FavsActivity::class.java
|
||||
NavTab.DIARIO -> DiaryActivity::class.java
|
||||
NavTab.AJUSTES -> OptsActivity::class.java
|
||||
}
|
||||
startActivity(android.content.Intent(this, cls)
|
||||
.addFlags(android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or
|
||||
android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION))
|
||||
overridePendingTransition(0, 0)
|
||||
if (javaClass !in tabScreens) {
|
||||
finish()
|
||||
overridePendingTransition(0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
nav.navInicio.setOnClickListener { go(NavTab.INICIO) }
|
||||
nav.navFavoritos.setOnClickListener { go(NavTab.FAVORITOS) }
|
||||
nav.navDiario.setOnClickListener { go(NavTab.DIARIO) }
|
||||
nav.navAjustes.setOnClickListener { go(NavTab.AJUSTES) }
|
||||
styleTab(nav.navInicio, active == NavTab.INICIO)
|
||||
styleTab(nav.navFavoritos, active == NavTab.FAVORITOS)
|
||||
styleTab(nav.navDiario, active == NavTab.DIARIO)
|
||||
styleTab(nav.navAjustes, active == NavTab.AJUSTES)
|
||||
}
|
||||
|
||||
/* ---------------- Banner AdMob compartido (rediseño 2026-10) ---------------- */
|
||||
|
||||
/**
|
||||
* 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 loguea "Required XML attribute adSize was missing"
|
||||
* y setAdSize posterior no regenera el WebView a la altura correcta.
|
||||
* MobileAds.initialize lo hace MainActivity al arrancar (tras el consent UMP);
|
||||
* las demás pantallas sólo crean y cargan su AdView.
|
||||
*/
|
||||
fun AppCompatActivity.loadBannerAd(container: FrameLayout) {
|
||||
val adView = AdView(this).apply {
|
||||
// AdSize trabaja en dp, no en píxeles físicos
|
||||
val adWidthDp = (resources.displayMetrics.widthPixels / resources.displayMetrics.density).toInt()
|
||||
setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(this@loadBannerAd, adWidthDp))
|
||||
adUnitId = getString(R.string.admob_bannerid)
|
||||
}
|
||||
container.addView(adView,
|
||||
FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT))
|
||||
adView.loadAd(AdRequest.Builder().build())
|
||||
}
|
||||
|
||||
/** Toast corto, equivalente al toast() de Anko */
|
||||
fun Context.toast(message: String) {
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.jkanetwork.st.frasesdeanime
|
||||
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.ContextMenu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityDiaryBinding
|
||||
|
||||
/**
|
||||
* Diario (rediseño 2026-10, mockup SVG): frases vistas en cards con la fecha en
|
||||
* que salieron, búsqueda + filtro por anime y barra de navegación inferior.
|
||||
* Long-press en card: copiar/compartir.
|
||||
*/
|
||||
class DiaryActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityDiaryBinding
|
||||
|
||||
/* Items completos (sin filtro) e IDs de la vista filtrada, para el menú contextual */
|
||||
private var allItems: List<CardItem> = emptyList()
|
||||
private var listIDFrases: List<Int> = emptyList()
|
||||
|
||||
private var filterAnime: Int? = null /* null = todos */
|
||||
private var query: String = ""
|
||||
|
||||
private lateinit var adapter: QuoteCardAdapter
|
||||
private val db by lazy { SQLiteHelper(applicationContext) }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityDiaryBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
supportActionBar?.hide()
|
||||
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
||||
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||
setupBottomNav(binding.bottomNav, NavTab.DIARIO)
|
||||
loadBannerAd(binding.adContainer)
|
||||
|
||||
/* Búsqueda: refiltra al teclear */
|
||||
binding.searchInput.addTextChangedListener(object : TextWatcher {
|
||||
override fun afterTextChanged(s: Editable?) { query = s?.toString()?.trim() ?: ""; applyFilters() }
|
||||
override fun beforeTextChanged(s: CharSequence?, a: Int, b: Int, c: Int) {}
|
||||
override fun onTextChanged(s: CharSequence?, a: Int, b: Int, c: Int) {}
|
||||
})
|
||||
|
||||
adapter = QuoteCardAdapter(this, emptyList(), showStar = false)
|
||||
binding.viewList.adapter = adapter
|
||||
binding.viewList.emptyView = binding.emptyList
|
||||
|
||||
setupFilterSpinner()
|
||||
|
||||
registerForContextMenu(binding.viewList)
|
||||
|
||||
/* Restaurar filtro/búsqueda tras recrear la activity (giro, etc.) */
|
||||
savedInstanceState?.let {
|
||||
query = it.getString("query", "")
|
||||
filterAnime = if (it.containsKey("anime")) it.getInt("anime") else null
|
||||
if (query.isNotEmpty()) binding.searchInput.setText(query)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
outState.putString("query", query)
|
||||
filterAnime?.let { outState.putInt("anime", it) }
|
||||
}
|
||||
|
||||
/** Carga las frases vistas (con su fecha) y refresca filtro y lista */
|
||||
private fun loadAll() {
|
||||
allItems = db.getSeenFrases().map { (tday, idf) ->
|
||||
CardItem(idf, db.getSentenceFromIDF(idf), db.getAnimeFromIDF(idf), date = formatDate(tday))
|
||||
}
|
||||
setupFilterSpinner()
|
||||
applyFilters()
|
||||
}
|
||||
|
||||
/** TDay "20261017" -> "17 oct" */
|
||||
private fun formatDate(tday: String): String {
|
||||
val day = tday.takeLast(2).toIntOrNull() ?: return ""
|
||||
val month = tday.substring(4, 6).toIntOrNull() ?: return ""
|
||||
val months = arrayOf("ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic")
|
||||
return "$day ${months.getOrElse(month - 1) { "" }}"
|
||||
}
|
||||
|
||||
/** Desplegable "Todos los animes" + los presentes en el diario */
|
||||
private fun setupFilterSpinner() {
|
||||
val animes = LinkedHashMap<Int, String>()
|
||||
allItems.forEach { item ->
|
||||
val ida = db.getIDAnimeFromIDF(item.idf)
|
||||
if (ida > 0 && !animes.containsKey(ida)) animes[ida] = item.anime
|
||||
}
|
||||
val names = mutableListOf(getString(R.string.diario_todos))
|
||||
val ids = mutableListOf<Int?>(null)
|
||||
animes.entries.sortedBy { it.value.lowercase() }.forEach { (ida, name) ->
|
||||
ids.add(ida); names.add(name)
|
||||
}
|
||||
|
||||
val spinnerAdapter = ArrayAdapter(this, R.layout.spinner_value, names)
|
||||
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
binding.spinnerAnime.adapter = spinnerAdapter
|
||||
|
||||
/* Mantener el filtro actual si sigue existiendo */
|
||||
val pos = if (filterAnime == null) 0 else ids.indexOf(filterAnime).let { if (it > 0) it else 0 }
|
||||
binding.spinnerAnime.setSelection(pos, false)
|
||||
|
||||
binding.spinnerAnime.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>?, v: View?, position: Int, id: Long) {
|
||||
filterAnime = ids.getOrNull(position)
|
||||
applyFilters()
|
||||
}
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
}
|
||||
}
|
||||
|
||||
/** Aplica filtro de anime + búsqueda sobre allItems */
|
||||
private fun applyFilters() {
|
||||
val filtered = allItems.filter { item ->
|
||||
val okAnime = filterAnime == null || db.getIDAnimeFromIDF(item.idf) == filterAnime
|
||||
val okQuery = query.isEmpty() ||
|
||||
item.sentence.contains(query, ignoreCase = true) ||
|
||||
item.anime.contains(query, ignoreCase = true)
|
||||
okAnime && okQuery
|
||||
}
|
||||
listIDFrases = filtered.map { it.idf }
|
||||
adapter.update(filtered)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
loadAll() /* las frases vistas pueden cambiar desde la main */
|
||||
}
|
||||
|
||||
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo) {
|
||||
super.onCreateContextMenu(menu, v, menuInfo)
|
||||
menuInflater.inflate(R.menu.menu_diarysentence, menu)
|
||||
}
|
||||
|
||||
override fun onContextItemSelected(item: MenuItem): Boolean {
|
||||
val info = item.menuInfo as AdapterView.AdapterContextMenuInfo
|
||||
if (info.position !in listIDFrases.indices) return false
|
||||
val idf = listIDFrases[info.position]
|
||||
val sentence = db.getSentenceFromIDF(idf)
|
||||
val anime = db.getAnimeFromIDF(idf)
|
||||
val shared = "$sentence ($anime) \n ${getString(R.string.sharefrom)}"
|
||||
|
||||
when (item.itemId) {
|
||||
R.id.copy -> {
|
||||
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", shared))
|
||||
toast("Copiado al portapapeles")
|
||||
return true
|
||||
}
|
||||
R.id.share -> {
|
||||
share(shared)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -1,89 +1,176 @@
|
||||
package com.jkanetwork.st.frasesdeanime
|
||||
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.ContextMenu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.AdapterView
|
||||
import android.content.ClipboardManager
|
||||
import android.content.ClipData
|
||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityListBinding
|
||||
import android.widget.ArrayAdapter
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityFavsBinding
|
||||
|
||||
/**
|
||||
* Created by kprkpr on 25/07/17.
|
||||
* Help: https://www.youtube.com/watch?v=x-M1L6tcsLo
|
||||
* Layout DSL de Anko migrado a XML (activity_list.xml) + ViewBinding
|
||||
* Rediseño 2026-10 (mockup SVG): header + búsqueda + filtro por anime + cards,
|
||||
* con barra de navegación inferior. Long-press en card: copiar/compartir/borrar.
|
||||
*/
|
||||
class FavsActivity : AppCompatActivity(){
|
||||
class FavsActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityListBinding
|
||||
private lateinit var binding: ActivityFavsBinding
|
||||
|
||||
/* Items completos (sin filtro) e IDs de la vista filtrada, para el menú contextual */
|
||||
private var allItems: List<CardItem> = emptyList()
|
||||
private var listIDFrases: List<Int> = emptyList()
|
||||
|
||||
private var filterAnime: Int? = null /* null = todos */
|
||||
private var query: String = ""
|
||||
|
||||
private lateinit var adapter: QuoteCardAdapter
|
||||
private val db by lazy { SQLiteHelper(applicationContext) }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityListBinding.inflate(layoutInflater)
|
||||
binding = ActivityFavsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.hide()
|
||||
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
||||
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||
setupBottomNav(binding.bottomNav, NavTab.FAVORITOS)
|
||||
loadBannerAd(binding.adContainer)
|
||||
|
||||
val data = ArrayList<HashMap<String,String>>()
|
||||
val db = SQLiteHelper(applicationContext)
|
||||
val listIDFrases = db.getAllIDFavs()
|
||||
val length = listIDFrases.size
|
||||
/* Búsqueda: refiltra al teclear */
|
||||
binding.searchInput.addTextChangedListener(object : TextWatcher {
|
||||
override fun afterTextChanged(s: Editable?) { query = s?.toString()?.trim() ?: ""; applyFilters() }
|
||||
override fun beforeTextChanged(s: CharSequence?, a: Int, b: Int, c: Int) {}
|
||||
override fun onTextChanged(s: CharSequence?, a: Int, b: Int, c: Int) {}
|
||||
})
|
||||
|
||||
for (i in 0..length -1){
|
||||
val item = HashMap<String, String>()
|
||||
item.put("sentence",db.getSentenceFromIDF(listIDFrases[i]))
|
||||
item.put("anime",db.getAnimeFromIDF(listIDFrases[i]))
|
||||
data.add(item)
|
||||
}
|
||||
/* Estrella de cada card: quitar de favoritos */
|
||||
adapter = QuoteCardAdapter(this, emptyList(), showStar = true) { onUnfav(it) }
|
||||
binding.viewList.adapter = adapter
|
||||
binding.viewList.emptyView = binding.emptyList
|
||||
|
||||
binding.viewList.adapter = android.widget.SimpleAdapter(this,data,android.R.layout.simple_list_item_2,
|
||||
arrayOf("sentence","anime"), intArrayOf(android.R.id.text1,android.R.id.text2))
|
||||
setupFilterSpinner()
|
||||
|
||||
registerForContextMenu(binding.viewList)
|
||||
|
||||
/* Restaurar filtro/búsqueda tras recrear la activity (giro, etc.) */
|
||||
savedInstanceState?.let {
|
||||
query = it.getString("query", "")
|
||||
filterAnime = if (it.containsKey("anime")) it.getInt("anime") else null
|
||||
if (query.isNotEmpty()) binding.searchInput.setText(query)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateContextMenu(menu: ContextMenu, v: android.view.View,
|
||||
menuInfo: ContextMenu.ContextMenuInfo) {
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
outState.putString("query", query)
|
||||
filterAnime?.let { outState.putInt("anime", it) }
|
||||
}
|
||||
|
||||
/** Carga todos los favoritos y refresca filtro y lista */
|
||||
private fun loadAll() {
|
||||
allItems = db.getAllIDFavs().map { idf ->
|
||||
CardItem(idf, db.getSentenceFromIDF(idf), db.getAnimeFromIDF(idf))
|
||||
}
|
||||
/* El filtro puede quedarse sin su anime: reconstruir */
|
||||
setupFilterSpinner()
|
||||
applyFilters()
|
||||
}
|
||||
|
||||
/** Desplegable "Todos los animes" + los presentes en favoritos */
|
||||
private fun setupFilterSpinner() {
|
||||
val animes = LinkedHashMap<Int, String>()
|
||||
allItems.forEach { item ->
|
||||
val ida = db.getIDAnimeFromIDF(item.idf)
|
||||
if (ida > 0 && !animes.containsKey(ida)) animes[ida] = item.anime
|
||||
}
|
||||
val names = mutableListOf(getString(R.string.diario_todos))
|
||||
val ids = mutableListOf<Int?>(null)
|
||||
animes.entries.sortedBy { it.value.lowercase() }.forEach { (ida, name) ->
|
||||
ids.add(ida); names.add(name)
|
||||
}
|
||||
|
||||
val spinnerAdapter = ArrayAdapter(this, R.layout.spinner_value, names)
|
||||
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
binding.spinnerAnime.adapter = spinnerAdapter
|
||||
|
||||
/* Mantener el filtro actual si sigue existiendo */
|
||||
val pos = if (filterAnime == null) 0 else ids.indexOf(filterAnime).let { if (it > 0) it else 0 }
|
||||
binding.spinnerAnime.setSelection(pos, false)
|
||||
|
||||
binding.spinnerAnime.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>?, v: View?, position: Int, id: Long) {
|
||||
filterAnime = ids.getOrNull(position)
|
||||
applyFilters()
|
||||
}
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
}
|
||||
}
|
||||
|
||||
/** Aplica filtro de anime + búsqueda sobre allItems */
|
||||
private fun applyFilters() {
|
||||
val filtered = allItems.filter { item ->
|
||||
val okAnime = filterAnime == null || db.getIDAnimeFromIDF(item.idf) == filterAnime
|
||||
val okQuery = query.isEmpty() ||
|
||||
item.sentence.contains(query, ignoreCase = true) ||
|
||||
item.anime.contains(query, ignoreCase = true)
|
||||
okAnime && okQuery
|
||||
}
|
||||
listIDFrases = filtered.map { it.idf }
|
||||
adapter.update(filtered)
|
||||
}
|
||||
|
||||
/** Quitar de favoritos (estrella) y recargar */
|
||||
private fun onUnfav(item: CardItem) {
|
||||
db.setFav(item.idf)
|
||||
loadAll()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
loadAll() /* los favoritos pueden cambiar desde la main */
|
||||
}
|
||||
|
||||
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo) {
|
||||
super.onCreateContextMenu(menu, v, menuInfo)
|
||||
val inflater = getMenuInflater()
|
||||
inflater.inflate(R.menu.menu_favsentence, menu)
|
||||
menuInflater.inflate(R.menu.menu_favsentence, menu)
|
||||
}
|
||||
|
||||
/** Flecha Atrás del ActionBar */
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
finish()
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
override fun onContextItemSelected(item: MenuItem): Boolean {
|
||||
val info = item.getMenuInfo() as AdapterView.AdapterContextMenuInfo
|
||||
val obj = binding.viewList.getItemAtPosition(info.position) as HashMap<String, String>
|
||||
val info = item.menuInfo as AdapterView.AdapterContextMenuInfo
|
||||
if (info.position !in listIDFrases.indices) return false
|
||||
val idf = listIDFrases[info.position]
|
||||
val sentence = db.getSentenceFromIDF(idf)
|
||||
val anime = db.getAnimeFromIDF(idf)
|
||||
val shared = "$sentence ($anime) \n ${getString(R.string.sharefrom)}"
|
||||
|
||||
when (item.getItemId()) {
|
||||
when (item.itemId) {
|
||||
R.id.copy -> {
|
||||
var clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", "${obj.get("sentence")} (${obj.get("anime")}) \n ${this.getString(R.string.sharefrom)}"))
|
||||
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", shared))
|
||||
toast("Copiado al portapapeles")
|
||||
return true
|
||||
}
|
||||
R.id.delfav -> {
|
||||
var db = SQLiteHelper(applicationContext)
|
||||
val IDFavs = db.getAllIDFavs()
|
||||
db.setFav(IDFavs[info.position])
|
||||
restartActivity(this)
|
||||
db.setFav(idf)
|
||||
loadAll()
|
||||
return true
|
||||
}
|
||||
R.id.share -> {
|
||||
share("${obj.get("sentence")} (${obj.get("anime")}) \n ${this.getString(R.string.sharefrom)}")
|
||||
share(shared)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,24 +4,28 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import java.util.Calendar
|
||||
import java.text.DateFormatSymbols
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Toast
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.content.res.Configuration
|
||||
import java.util.Calendar
|
||||
import java.text.DateFormatSymbols
|
||||
|
||||
/* Permisos runtime (POST_NOTIFICATIONS en Android 13+) */
|
||||
import android.Manifest
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
|
||||
/* Ads */
|
||||
import com.google.android.gms.ads.AdRequest
|
||||
import com.google.android.gms.ads.MobileAds
|
||||
import com.google.android.gms.ads.FullScreenContentCallback
|
||||
import com.google.android.gms.ads.rewarded.RewardedAd;
|
||||
import com.google.android.ump.ConsentRequestParameters
|
||||
import com.google.android.ump.UserMessagingPlatform
|
||||
|
||||
|
||||
import android.text.method.ScrollingMovementMethod
|
||||
@@ -58,25 +62,26 @@ class MainActivity : AppCompatActivity() {
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
/* Rediseño 2026-10: header propio (título + menú), sin ActionBar. El color
|
||||
de la status bar / navbar acompaña al header (bgCard resuelve tema claro/oscuro). */
|
||||
supportActionBar?.hide()
|
||||
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
||||
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||
setupBottomNav(binding.bottomNav, NavTab.INICIO)
|
||||
|
||||
/* "Close" app on back button: moveTaskToBack. Migrado a OnBackPressedDispatcher
|
||||
porque onBackPressed override ya no se invoca con el gesto back predictivo. */
|
||||
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() { moveTaskToBack(true) }
|
||||
})
|
||||
|
||||
P = Prefs(applicationContext)
|
||||
db = SQLiteHelper(applicationContext)
|
||||
|
||||
|
||||
/* Ads */
|
||||
// Initialize the Mobile Ads SDK.
|
||||
MobileAds.initialize(this) { }
|
||||
|
||||
// Cargar el anuncio recompensado con el ID de UNIDAD (videoid), no el de app
|
||||
val adRequest = AdRequest.Builder().build()
|
||||
RewardedAd.load(this, this.getString(R.string.admob_videoid), adRequest, object : RewardedAdLoadCallback() {
|
||||
override fun onAdFailedToLoad(adError: LoadAdError) {
|
||||
rewardedAd = null
|
||||
}
|
||||
|
||||
override fun onAdLoaded(ad: RewardedAd) {
|
||||
rewardedAd = ad
|
||||
}
|
||||
})
|
||||
/* Ads: UMP consent (obligatorio EEA) → init en background → banner + rewarded */
|
||||
setUpConsentAndAds()
|
||||
|
||||
|
||||
/* Check if first time or not, for welcoming user */
|
||||
@@ -137,6 +142,13 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
if (IDFraseS > 0) {
|
||||
rewardedAd?.let { ad ->
|
||||
/* Recargar tras cerrar: los RewardedAd son de un solo uso */
|
||||
ad.fullScreenContentCallback = object : FullScreenContentCallback() {
|
||||
override fun onAdDismissedFullScreenContent() {
|
||||
rewardedAd = null
|
||||
loadRewardedAd()
|
||||
}
|
||||
}
|
||||
ad.show(this, OnUserEarnedRewardListener { rewardItem ->
|
||||
// Handle the reward. ANUNCIO VISTO CORRECTAMENTE.
|
||||
val gato = ImageView(this@MainActivity)
|
||||
@@ -214,6 +226,51 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Ads: UMP consent → init background → banner adaptativo + rewarded */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/** Consentimiento UMP (obligatorio EEA para servir anuncios) y tras él, init + carga. */
|
||||
private fun setUpConsentAndAds() {
|
||||
val params = ConsentRequestParameters.Builder().build()
|
||||
val consentInfo = UserMessagingPlatform.getConsentInformation(this)
|
||||
consentInfo.requestConsentInfoUpdate(
|
||||
this,
|
||||
params,
|
||||
{
|
||||
UserMessagingPlatform.loadAndShowConsentFormIfRequired(this) { initAdsAfterConsent() }
|
||||
},
|
||||
{ initAdsAfterConsent() } // sin info de consent (offline, etc.): seguir igual
|
||||
)
|
||||
}
|
||||
|
||||
/** MobileAds.initialize en background y, al completar, banner + rewarded. */
|
||||
private fun initAdsAfterConsent() {
|
||||
Thread {
|
||||
MobileAds.initialize(applicationContext) {
|
||||
runOnUiThread {
|
||||
loadBannerAd(binding.adContainer)
|
||||
loadRewardedAd()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
/** Carga el anuncio recompensado con el ID de UNIDAD (videoid), no el de app. */
|
||||
private fun loadRewardedAd() {
|
||||
// ID de unidad correcto: admob_videoid (admob_id es el de aplicación)
|
||||
val adRequest = AdRequest.Builder().build()
|
||||
RewardedAd.load(this, this.getString(R.string.admob_videoid), adRequest, object : RewardedAdLoadCallback() {
|
||||
override fun onAdFailedToLoad(adError: LoadAdError) {
|
||||
rewardedAd = null
|
||||
}
|
||||
|
||||
override fun onAdLoaded(ad: RewardedAd) {
|
||||
rewardedAd = ad
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** At onResume, called after onCreate and in resume, load ad things and refresh calendar data */
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
@@ -228,12 +285,6 @@ class MainActivity : AppCompatActivity() {
|
||||
changeData()
|
||||
}
|
||||
|
||||
/** "Close" app on back button */
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onBackPressed() {
|
||||
moveTaskToBack(true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Pide POST_NOTIFICATIONS una sola vez (Android 13+ silencia las notificaciones sin él,
|
||||
* y el diálogo del sistema tras 2 denegaciones deja de mostrarse: no insistir).
|
||||
@@ -260,6 +311,16 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.txtAnime.setText(db.getAnimeFromIDF(IDFraseS))
|
||||
//txt_date.setText("Frase de hoy")
|
||||
binding.txtDate.setText("Frase del $dayS de ${getMonth(monthS)}")
|
||||
/* Estadísticas (rediseño): progreso del anime actual y total de los seleccionados */
|
||||
val idAnime = db.getIDAnimeFromIDF(IDFraseS)
|
||||
if (idAnime > 0) {
|
||||
val (seenA, totalA) = db.getAnimeFrasesStats(idAnime)
|
||||
binding.statAnimeValue.text = "$seenA / $totalA ${getString(R.string.stat_frases)}"
|
||||
} else {
|
||||
binding.statAnimeValue.text = "—"
|
||||
}
|
||||
val (seenT, totalT) = db.getSeenStatsSelected()
|
||||
binding.statTotalValue.text = "$seenT / $totalT ${getString(R.string.stat_frases)}"
|
||||
/* Set fav icon */
|
||||
if (db.getFav(IDFraseS)) {
|
||||
binding.btnFav.setBackgroundResource(R.drawable.star_on);
|
||||
@@ -267,39 +328,4 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.btnFav.setBackgroundResource(R.drawable.star_off);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
menuInflater.inflate(R.menu.main, menu)
|
||||
return super.onCreateOptionsMenu(menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean{
|
||||
when (item.getItemId()) {
|
||||
R.id.favs -> {
|
||||
startActivity<FavsActivity>()
|
||||
return true
|
||||
}
|
||||
R.id.anime -> {
|
||||
startActivity<AnimesSelActivity>()
|
||||
return true
|
||||
}
|
||||
R.id.options -> {
|
||||
startActivity<OptsActivity>()
|
||||
return true
|
||||
}
|
||||
R.id.about -> {
|
||||
startActivity<AboutActivity>()
|
||||
return true
|
||||
}
|
||||
R.id.exit -> {
|
||||
moveTaskToBack(true) /* Returns to "desktop" */
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,19 +4,22 @@ import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.AdapterView
|
||||
import android.content.res.Configuration
|
||||
import android.app.NotificationManager
|
||||
import android.app.TimePickerDialog
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import android.app.NotificationManager
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityOptsBinding
|
||||
|
||||
/**
|
||||
* Created by kprkpr on 30/08/17.
|
||||
* Guardado automático: cada cambio (checks, hora, minuto) se aplica al momento —
|
||||
* no hay botón "Guardar cambios".
|
||||
* Rediseño 2026-10 (mockup SVG): cards de ajustes con título+descripción. La hora
|
||||
* se elige con un TimePicker (antes dos spinners); acciones para jkanetwork.com
|
||||
* y política de privacidad; banner + barra de navegación inferior.
|
||||
* Guardado automático: cada cambio se aplica al momento — no hay botón "Guardar".
|
||||
*/
|
||||
class OptsActivity : AppCompatActivity(){
|
||||
class OptsActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityOptsBinding
|
||||
lateinit var P: Prefs
|
||||
@@ -26,36 +29,20 @@ class OptsActivity : AppCompatActivity(){
|
||||
binding = ActivityOptsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.hide()
|
||||
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
||||
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||
setupBottomNav(binding.bottomNav, NavTab.AJUSTES)
|
||||
loadBannerAd(binding.adContainer)
|
||||
|
||||
P = Prefs(applicationContext)
|
||||
|
||||
val hours = ArrayList<Int>()
|
||||
val minutes = ArrayList<Int>()
|
||||
|
||||
for (i in 0..23){
|
||||
hours.add(i)
|
||||
}
|
||||
for (i in 0..59){
|
||||
minutes.add(i)
|
||||
}
|
||||
|
||||
val hoursAdapter = ArrayAdapter(this,android.R.layout.simple_list_item_1,hours)
|
||||
val minutesAdapter = ArrayAdapter(this,android.R.layout.simple_list_item_1,minutes)
|
||||
|
||||
hoursAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
minutesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
|
||||
binding.spinnerHour.adapter = hoursAdapter
|
||||
binding.spinnerMinute.adapter = minutesAdapter
|
||||
|
||||
binding.spinnerHour.setSelection(P.getHour())
|
||||
binding.spinnerMinute.setSelection(P.getMinute())
|
||||
|
||||
binding.chkAlarm.isChecked = P.getNotifOn()
|
||||
binding.chkPersistent.isChecked = P.getPersNotifOn()
|
||||
|
||||
setEnabledParts()
|
||||
updateHoraTxt()
|
||||
|
||||
/* Guardado automático en cada interacción */
|
||||
binding.chkAlarm.setOnCheckedChangeListener { _, _ ->
|
||||
@@ -67,25 +54,30 @@ class OptsActivity : AppCompatActivity(){
|
||||
saveAndApply()
|
||||
}
|
||||
|
||||
binding.spinnerHour.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>?, view: android.view.View?, position: Int, id: Long) {
|
||||
// onItemSelected también salta al fijar la selección inicial; solo guardar cambios reales
|
||||
if (position != P.getHour()) saveAndApply()
|
||||
/* Hora: TimePicker sobre la card */
|
||||
binding.cardHora.setOnClickListener {
|
||||
TimePickerDialog(this, { _, hour, minute ->
|
||||
P.setHour(hour)
|
||||
P.setMinute(minute)
|
||||
updateHoraTxt()
|
||||
saveAndApply()
|
||||
}, P.getHour(), P.getMinute(), true).show()
|
||||
}
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
}
|
||||
binding.spinnerMinute.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>?, view: android.view.View?, position: Int, id: Long) {
|
||||
if (position != P.getMinute()) saveAndApply()
|
||||
}
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
|
||||
/* Acciones del rediseño */
|
||||
binding.cardAnimes.setOnClickListener { startActivity<AnimesSelActivity>() }
|
||||
binding.cardWeb.setOnClickListener { browse("https://jkanetwork.com") }
|
||||
binding.cardPriv.setOnClickListener { browse("https://jkanetwork.com/politica-privacidad") }
|
||||
binding.cardAbout.setOnClickListener { startActivity<AboutActivity>() }
|
||||
}
|
||||
|
||||
/** Hora guardada en la card, en gris */
|
||||
private fun updateHoraTxt() {
|
||||
binding.txtHora.text = String.format("%d:%02d", P.getHour(), P.getMinute())
|
||||
}
|
||||
|
||||
/** Guarda prefs y reprograma la alarma. Se llama tras cada cambio. */
|
||||
private fun saveAndApply() {
|
||||
P.setHour(binding.spinnerHour.selectedItem.toString().toInt())
|
||||
P.setMinute(binding.spinnerMinute.selectedItem.toString().toInt())
|
||||
P.setNotifOn(binding.chkAlarm.isChecked)
|
||||
P.setPersNotifOn(binding.chkPersistent.isChecked)
|
||||
|
||||
@@ -115,26 +107,16 @@ class OptsActivity : AppCompatActivity(){
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
finish()
|
||||
return true
|
||||
}
|
||||
|
||||
fun setEnabledParts() {
|
||||
if (binding.chkAlarm.isChecked) {
|
||||
binding.chkPersistent.isEnabled = true
|
||||
/* This other checks is chk_persistent checked dependent */
|
||||
if (binding.chkPersistent.isChecked) {
|
||||
binding.spinnerHour.isEnabled = false
|
||||
binding.spinnerMinute.isEnabled = false
|
||||
} else {
|
||||
binding.spinnerHour.isEnabled = true
|
||||
binding.spinnerMinute.isEnabled = true
|
||||
}
|
||||
/* La hora no aplica con notificación persistente */
|
||||
binding.cardHora.isEnabled = !binding.chkPersistent.isChecked
|
||||
binding.cardHora.alpha = if (binding.chkPersistent.isChecked) 0.5f else 1f
|
||||
} else {
|
||||
binding.chkPersistent.isEnabled = false
|
||||
binding.spinnerHour.isEnabled = false
|
||||
binding.spinnerMinute.isEnabled = false
|
||||
binding.cardHora.isEnabled = false
|
||||
binding.cardHora.alpha = 0.5f
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.jkanetwork.st.frasesdeanime
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.BaseAdapter
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
/** Fila de una card de frase (Favoritos/Diario).
|
||||
* [date] sólo en Diario: día en que se vio la frase. */
|
||||
data class CardItem(val idf: Int, val sentence: String, val anime: String, val date: String? = null)
|
||||
|
||||
/** Adapter de cards del rediseño (item_quote_card.xml).
|
||||
* [onStarClick] sólo se usa cuando showStar (Favoritos: quitar de favoritos). */
|
||||
class QuoteCardAdapter(
|
||||
private val act: AppCompatActivity,
|
||||
private var items: List<CardItem>,
|
||||
private val showStar: Boolean,
|
||||
private val onStarClick: (CardItem) -> Unit = {}
|
||||
) : BaseAdapter() {
|
||||
|
||||
override fun getCount(): Int = items.size
|
||||
override fun getItem(position: Int): Any = items[position]
|
||||
override fun getItemId(position: Int): Long = position.toLong()
|
||||
|
||||
fun update(newItems: List<CardItem>) {
|
||||
items = newItems
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
val v = convertView ?: act.layoutInflater.inflate(R.layout.item_quote_card, parent, false)
|
||||
val item = items[position]
|
||||
v.findViewById<TextView>(R.id.card_anime).text = item.anime
|
||||
v.findViewById<TextView>(R.id.card_sentence).text = item.sentence
|
||||
val date = v.findViewById<TextView>(R.id.card_date)
|
||||
if (item.date != null) {
|
||||
date.text = item.date
|
||||
date.visibility = View.VISIBLE
|
||||
} else {
|
||||
date.visibility = View.GONE
|
||||
}
|
||||
val star = v.findViewById<ImageView>(R.id.card_star)
|
||||
if (showStar) {
|
||||
star.visibility = View.VISIBLE
|
||||
star.setOnClickListener { onStarClick(item) }
|
||||
} else {
|
||||
star.visibility = View.GONE
|
||||
}
|
||||
return v
|
||||
}
|
||||
}
|
||||
@@ -263,6 +263,55 @@ class SQLiteHelper(ctx: Context) : SQLiteOpenHelper(ctx, "app.sqlite", null, 1)
|
||||
return intList(appDb, "SELECT IDFrase FROM FRASESFAV").toTypedArray()
|
||||
}
|
||||
|
||||
/* ---------------- Estadísticas y Diario (rediseño 2026-10) ---------------- */
|
||||
|
||||
/** IDAnime del catálogo al que pertenece [IDFrase] (-1 si la frase no es válida) */
|
||||
fun getIDAnimeFromIDF(IDFrase: Int): Int {
|
||||
if (IDFrase <= 0) return -1
|
||||
val c = catalog().rawQuery("SELECT IDAnime FROM FRASES WHERE IDFrase = '$IDFrase'", null)
|
||||
val ret = if (c.moveToFirst()) c.getInt(0) else -1
|
||||
c.close()
|
||||
return ret
|
||||
}
|
||||
|
||||
/** (vistas, total) de las frases de un anime: vistas = frases de ese anime que
|
||||
* ya salieron en algún día; total = frases existentes del anime en el catálogo */
|
||||
fun getAnimeFrasesStats(idAnime: Int): Pair<Int, Int> {
|
||||
val total = intList(catalog(), "SELECT IDFrase FROM FRASES WHERE IDAnime = '$idAnime'")
|
||||
val seen = if (total.isEmpty()) 0
|
||||
else appDb.rawQuery("SELECT COUNT(*) FROM FRASESVI WHERE IDFrase IN (${total.joinToString(",")})", null).use {
|
||||
it.moveToFirst(); it.getInt(0)
|
||||
}
|
||||
return Pair(seen, total.size)
|
||||
}
|
||||
|
||||
/** (vistas, total) entre los animes seleccionados: vistas = frases ya vistas de
|
||||
* los animes seleccionados; total = frases existentes de esos animes */
|
||||
fun getSeenStatsSelected(): Pair<Int, Int> {
|
||||
val animesOn = intList(appDb, "SELECT IDAnime FROM ANIMESON")
|
||||
if (animesOn.isEmpty()) return Pair(0, 0)
|
||||
val inAnimes = animesOn.joinToString(",")
|
||||
val ids = intList(catalog(), "SELECT IDFrase FROM FRASES WHERE IDAnime IN ($inAnimes)")
|
||||
val seen = if (ids.isEmpty()) 0
|
||||
else appDb.rawQuery("SELECT COUNT(*) FROM FRASESVI WHERE IDFrase IN (${ids.joinToString(",")})", null).use {
|
||||
it.moveToFirst(); it.getInt(0)
|
||||
}
|
||||
return Pair(seen, ids.size)
|
||||
}
|
||||
|
||||
/** Frases ya vistas en orden cronológico por día visto.
|
||||
* Devuelve pares (TDay, IDFrase) — el día sirve para la fecha de las cards del Diario.
|
||||
* @param idAnime: si no es null, sólo las de ese anime (Diario filtrado) */
|
||||
fun getSeenFrases(idAnime: Int? = null): List<Pair<String, Int>> {
|
||||
val seen = mutableListOf<Pair<String, Int>>()
|
||||
val c = appDb.rawQuery("SELECT TDay, IDFrase FROM FRASESVI WHERE IDFrase > 0 ORDER BY TDay ASC", null)
|
||||
while (c.moveToNext()) seen.add(Pair(c.getString(0), c.getInt(1)))
|
||||
c.close()
|
||||
if (idAnime == null) return seen
|
||||
val ofAnime = intList(catalog(), "SELECT IDFrase FROM FRASES WHERE IDAnime = '$idAnime'").toHashSet()
|
||||
return seen.filter { ofAnime.contains(it.second) }
|
||||
}
|
||||
|
||||
fun getAllAnimeIDs(): Array<Int>{
|
||||
return intList(catalog(), "SELECT IDAnime FROM ANIMES ORDER BY Name ASC").toTypedArray()
|
||||
}
|
||||
@@ -325,9 +374,9 @@ class SQLiteHelper(ctx: Context) : SQLiteOpenHelper(ctx, "app.sqlite", null, 1)
|
||||
if (selectAll == false){ //Set all
|
||||
val animeIDs = getAllAnimeIDs()
|
||||
|
||||
for (pos in animeIDs){
|
||||
for (id in animeIDs){
|
||||
val values = ContentValues()
|
||||
values.put("IDAnime", animeIDs[pos-1]) //Pos is a count, arrays start at 0
|
||||
values.put("IDAnime", id)
|
||||
appDb.insert("ANIMESON", null, values)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Botón principal (CAMBIAR FRASE): fondo accent, esquinas 8dp -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/accent" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Tarjeta del rediseño: fondo bgCard, borde borderColor, esquinas 10dp -->
|
||||
<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="10dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Tarjeta de botones de navegación: borde marcado borderStrong, esquinas 8dp -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/bgCard" />
|
||||
<stroke android:width="1dp" android:color="@color/borderStrong" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Píldora de fecha: fondo secundario, esquinas 6dp -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/bgSecondary" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Barra de búsqueda del rediseño: card radius 8 con borde suave -->
|
||||
<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="8dp" />
|
||||
</shape>
|
||||
@@ -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,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">
|
||||
<!-- Diario: libro -->
|
||||
<path android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zM20,2H8C6.9,2 6,2.9 6,4v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4C22,2.9 21.1,2 20,2zM20,16H8V4h12v12z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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">
|
||||
<!-- Calendario "Hoy" del mockup: caja + cabecera + anillas -->
|
||||
<path android:fillColor="#FF212529"
|
||||
android:pathData="M5,4h14a2,2 0 0,1 2,2v13a2,2 0 0,1 -2,2h-14a2,2 0 0,1 -2,-2v-13a2,2 0 0,1 2,-2zM5,9v10h14v-10z" />
|
||||
<path android:fillColor="#FF212529"
|
||||
android:pathData="M3,6h18v3h-18z" />
|
||||
<path android:fillColor="#FF212529"
|
||||
android:pathData="M8,1h2v4h-2z" />
|
||||
<path android:fillColor="#FF212529"
|
||||
android:pathData="M14,1h2v4h-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="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6 1.41,-1.41z" />
|
||||
</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="@color/textPrimary"
|
||||
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="@color/textPrimary"
|
||||
android:pathData="M9,18l6,-6 -6,-6" />
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?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">
|
||||
<!-- Reloj (SVG de Kevin, even-odd) -->
|
||||
<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,18h4v-2h-4v2zM3,6v2h18V6H3zM6,14h12v-2H6v2z" />
|
||||
</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="M12,1L3,5v6c0,5.55 3.84,10.74 9,12c5.16,-1.26 9,-6.45 9,-12V5l-9,-4zM12,11.99h7c-0.53,4.12 -3.28,7.79 -7,8.94V12H5V6.3l7,-3.11v8.8z" />
|
||||
</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.27c1.41,-1.94 2.3,-4.36 2.3,-6.93C16.71,4.38 13.32,1 9.16,1S1.61,4.38 1.61,8.8c0,4.42 3.39,7.8 7.55,7.8c2.57,0 4.99,-0.89 6.93,-2.3l0.27,0.28v0.79l5.86,5.85l1.75,-1.75L15.5,14zM9.16,13.75c-2.73,0 -4.95,-2.22 -4.95,-4.95s2.22,-4.95 4.95,-4.95s4.95,2.22 4.95,4.95S11.89,13.75 9.16,13.75z" />
|
||||
</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,11 @@
|
||||
<?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="32" android:viewportHeight="32">
|
||||
<!-- Globo (SVG de Kevin): círculo oscuro + meridianos blancos -->
|
||||
<path android:fillColor="#FF252A35"
|
||||
android:pathData="M16,2a14,14 0 1,0 0,28 14,14 0 1,0 0,-28z" />
|
||||
<path android:fillColor="#FFFFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M14.879,6.059C9.89,6.618 6,10.858 6,15.997 6,21.514 10.484,26 15.999,26S26,21.514 26,15.997c0,-5.065 -3.783,-9.251 -8.669,-9.906 0,0 -1.365,-0.181 -2.452,-0.032m0.455,1.352v3.367a18,18 0 0,1 -2.712,-0.295c0.127,-0.297 0.26,-0.583 0.405,-0.844 0.668,-1.203 1.474,-1.953 2.307,-2.228m1.428,0.056c0.075,0.012 0.151,0.02 0.226,0.034 0.752,0.33 1.475,1.044 2.082,2.138 0.143,0.256 0.273,0.537 0.398,0.828 -0.84,0.163 -1.752,0.27 -2.706,0.308zM11.37,12.027c-0.21,0.286 -0.411,0.585 -0.591,0.91 -0.208,0.373 -0.393,0.778 -0.564,1.2q-0.691,-0.203 -1.279,-0.457a8.7,8.7 0 0,1 2.434,-1.653m7.596,0.335c0.843,0.262 1.488,0.796 2.097,1.318q-0.549,0.238 -1.191,0.432c-0.168,-0.413 -0.35,-0.81 -0.552,-1.175a9,9 0 0,0 -0.353,-0.575zM9.031,10.714c0.015,0.054 -0.025,-0.072 -0.006,-0.017 0.515,0.24 1.128,0.624 1.732,0.805a16,16 0 0,0 -0.558,3.64H7.293a8.7,8.7 0 0,1 1.739,-4.428m13.946,0.012a8.7,8.7 0 0,1 1.728,4.416H21.9a16,16 0 0,0 -0.565,-3.665c0.57,-0.175 1.139,-0.508 1.629,-0.737 0.021,-0.05 -0.003,0.035 0.014,-0.014zM19.947,11.83c0.285,1 0.469,2.12 0.522,3.312h-3.707v-2.938a19,19 0 0,0 3.186,-0.374m-7.803,0.02c0.993,0.201 2.067,0.32 3.19,0.356v2.936h-3.706c0.053,-1.183 0.235,-2.296 0.516,-3.291M7.28,16.572h2.919c0.053,1.333 0.255,2.593 0.583,3.734 -0.642,0.084 -1.747,0.733 -1.804,0.765 -1.123,-1.37 -1.576,-2.617 -1.698,-4.5m4.349,0h3.706v3.037a19.3,19.3 0 0,0 -3.165,0.35 14.6,14.6 0 0,1 -0.541,-3.387m5.134,0h3.707a14.5,14.5 0 0,1 -0.547,3.408 19,19 0 0,0 -3.16,-0.369zM21.9,16.572h2.82c-0.112,1.73 -0.623,3.22 -1.593,4.53 -0.454,-0.287 -1.282,-0.586 -1.817,-0.77a16,16 0 0,0 0.59,-3.76m-6.565,4.465v3.266c-0.832,-0.276 -1.64,-1.023 -2.307,-2.226a9,9 0 0,1 -0.365,-0.752 18,18 0 0,1 2.672,-0.288m1.428,0.003c0.94,0.038 1.838,0.14 2.668,0.3a9,9 0 0,1 -0.36,0.737c-0.668,1.203 -1.475,1.95 -2.308,2.226zM11.25,21.658c0.161,0.39 0.334,0.766 0.526,1.112 0.273,0.492 0.584,0.937 0.924,1.334a8.7,8.7 0 0,1 -2.9,-1.92 11,11 0 0,1 1.45,-0.526m9.583,0.025c0.493,0.147 0.95,0.315 1.361,0.5a8.8,8.8 0 0,1 -2.744,1.86q0.479,-0.573 0.867,-1.273c0.188,-0.34 0.357,-0.707 0.516,-1.087" />
|
||||
</vector>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 121 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 215 KiB |
@@ -1,35 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Selección de animes rediseñada (estilo Opciones): header con atrás + buscador +
|
||||
lista de cards con check a la izquierda + botón todos/ninguno. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android: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="8dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/nav_inicio"
|
||||
app:srcCompat="@drawable/ic_chevron_left"
|
||||
app:tint="@color/textPrimary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/opts_animes_title"
|
||||
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_search"
|
||||
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/txt_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="Buscar anime..."
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="@string/buscar_animes"
|
||||
android:imeOptions="actionSearch"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:maxLines="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_sel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="Seleccionar todos" />
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textColorHint="@color/colorTextMuted"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Lista de cards con check -->
|
||||
<ListView
|
||||
android:id="@+id/view_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_weight="1"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="8dp"
|
||||
android:divider="#00000000" />
|
||||
android:paddingBottom="4dp"
|
||||
android:scrollbars="none" />
|
||||
|
||||
<!-- Botón seleccionar/deseleccionar todos -->
|
||||
<TextView
|
||||
android:id="@+id/btn_sel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/bg_accent"
|
||||
android:gravity="center"
|
||||
android:text="@string/seleccionar_todos"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Banner AdMob (AdView por código en loadBannerAd) sobre la barra inferior -->
|
||||
<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>
|
||||
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Diario rediseñado (mockup SVG): header + búsqueda + filtro anime + cards con fecha -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android: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_diario"
|
||||
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_search"
|
||||
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_diario"
|
||||
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>
|
||||
|
||||
<!-- Filtro desplegable por anime -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_card_strong"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_filter"
|
||||
app:tint="@color/colorTextSecondary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/filtrar_por_anime"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_anime"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@null" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_chevron_down"
|
||||
app:tint="@color/colorTextSecondary" />
|
||||
</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) sobre la barra inferior -->
|
||||
<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>
|
||||
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Favoritos rediseñado (mockup SVG): header + búsqueda + filtro anime + cards -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android: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_search"
|
||||
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>
|
||||
|
||||
<!-- Filtro desplegable por anime -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_card_strong"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_filter"
|
||||
app:tint="@color/colorTextSecondary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/filtrar_por_anime"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_anime"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@null" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_chevron_down"
|
||||
app:tint="@color/colorTextSecondary" />
|
||||
</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) sobre la barra inferior -->
|
||||
<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,169 +1,278 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||
<!-- Rediseño 2026-10 (mockup SVG): header propio con menú + píldora de fecha +
|
||||
tarjeta de frase + estadísticas + controles de navegación. Sin ActionBar
|
||||
(ocultada en código) y sin imagen de fondo. Banner al final, sin solape. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/principal">
|
||||
android:background="@color/bgMain"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- ============ HEADER (título + menú) ============ -->
|
||||
<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">
|
||||
|
||||
<!-- Rediseño: el menú pasa a la barra de navegación inferior -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/app_name"
|
||||
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="20dp">
|
||||
|
||||
<!-- Píldora de fecha -->
|
||||
<TextView
|
||||
android:id="@+id/txt_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/bg_pill"
|
||||
android:gravity="center"
|
||||
android:text="Fecha"
|
||||
android:textColor="@color/colorTextSecondary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- Tarjeta principal: frase + divisor + favorito/compartir/anime -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/colorPrimaryLight"
|
||||
android:paddingTop="6dp"
|
||||
android:text="Fecha"
|
||||
android:textAlignment="center"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="22sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="#aaffffff"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/Sep_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/black"
|
||||
android:scaleType="fitXY" />
|
||||
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="110dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fadeScrollbars="true"
|
||||
android:padding="2dp"
|
||||
android:gravity="center"
|
||||
android:minHeight="140dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:scrollbarStyle="insideOverlay"
|
||||
android:scrollbars="vertical"
|
||||
android:text="Aquí la frase, no?"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
android:text="Aquí la frase"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="16sp"
|
||||
tools:text="Si la frase es muy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, saldrá una scrollbar." />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/Sep_2"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/black"
|
||||
android:scaleType="fitXY" />
|
||||
</LinearLayout>
|
||||
<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="58dp"
|
||||
android:layout_marginLeft="26dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_fav"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/star_on"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/star_off"
|
||||
android:contentDescription="Favorito"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_share"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@null"
|
||||
android:paddingTop="2dp"
|
||||
app:srcCompat="@android:drawable/ic_menu_share" />
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="Compartir"
|
||||
android:scaleType="centerInside"
|
||||
app:srcCompat="@android:drawable/ic_menu_share"
|
||||
app:tint="@color/colorTextSecondary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_anime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingTop="20dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:paddingStart="12dp"
|
||||
android:text="Texto Anime"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Estadísticas: EN ESTE ANIME / TOTAL VISTAS -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/stat_this_anime"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stat_anime_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="—"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/stat_total"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stat_total_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="—"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Controles: anterior / hoy / siguiente -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_prev"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_card_strong"
|
||||
android:contentDescription="Día anterior"
|
||||
android:scaleType="centerInside"
|
||||
app:srcCompat="@drawable/ic_chevron_left" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_today"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1.2"
|
||||
android:background="@drawable/bg_card_strong"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_calendar"
|
||||
app:tint="@color/textPrimary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@android:drawable/ic_media_previous" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_today"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@android:drawable/ic_dialog_dialer" />
|
||||
android:layout_marginStart="6dp"
|
||||
android:text="@string/btn_today"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@android:drawable/ic_media_next" />
|
||||
|
||||
android:background="@drawable/bg_card_strong"
|
||||
android:contentDescription="Día siguiente"
|
||||
android:scaleType="centerInside"
|
||||
app:srcCompat="@drawable/ic_chevron_right" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
<!-- Botón principal -->
|
||||
<TextView
|
||||
android:id="@+id/btn_change"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Cambiar Frase" />
|
||||
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_accent"
|
||||
android:gravity="center"
|
||||
android:text="@string/btn_change"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/adView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="0dp"
|
||||
ads:adSize="SMART_BANNER"
|
||||
ads:adUnitId="@string/admob_bannerid" />
|
||||
<!-- Banner AdMob (AdView por código en loadBannerAd) sobre la barra inferior -->
|
||||
<FrameLayout
|
||||
android:id="@+id/adContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
<!-- Barra de navegación inferior -->
|
||||
<include
|
||||
android:id="@+id/bottom_nav"
|
||||
layout="@layout/view_bottom_nav" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,72 +1,408 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Opciones rediseñadas (mockup SVG): cards de ajustes con título+descripción
|
||||
+ acciones (web, privacidad, acerca de). Banner + barra inferior al final. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
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_ajustes"
|
||||
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
|
||||
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_height="57dp"
|
||||
android:text="¿Notificar frase diaria?"
|
||||
android:textAlignment="textStart" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
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
|
||||
android:id="@+id/chk_persistent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Hora de la notificación: TimePicker al pulsar, hora en gris -->
|
||||
<LinearLayout
|
||||
android:id="@+id/card_hora"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="57dp"
|
||||
android:text="¿Quieres que sea persistente?"
|
||||
android:textAlignment="textStart" />
|
||||
android:layout_height="wrap_content"
|
||||
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_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>
|
||||
|
||||
<!-- Animes seleccionados -->
|
||||
<LinearLayout
|
||||
android:id="@+id/card_animes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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_book"
|
||||
app:tint="@color/accent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutWhen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_when"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="Cuando mostrar:"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerHour"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:dropDownWidth="80dp" />
|
||||
android:text="@string/opts_animes_title"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_septime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:text=":"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerMinute"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:dropDownWidth="80dp" />
|
||||
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/opts_animes_desc"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgBackground"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_chevron_right"
|
||||
app:tint="@color/colorTextMuted" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Visita jkanetwork.com -->
|
||||
<LinearLayout
|
||||
android:id="@+id/card_web"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="background"
|
||||
app:srcCompat="@drawable/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_web" />
|
||||
|
||||
<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_web_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_web_desc"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_chevron_right"
|
||||
app:tint="@color/colorTextMuted" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Política de privacidad -->
|
||||
<LinearLayout
|
||||
android:id="@+id/card_priv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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_privacy"
|
||||
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_priv_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_priv_desc"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
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_height="wrap_content"
|
||||
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" />
|
||||
|
||||
<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_about_title"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_chevron_right"
|
||||
app:tint="@color/colorTextMuted" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<!-- Banner AdMob (AdView por código en loadBannerAd) sobre la barra inferior -->
|
||||
<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>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Item de la selección de animes: card con checkbox a la izquierda -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chk_anime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:buttonTint="@color/accent"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="Anime"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Card de frase para Favoritos y Diario (mockup SVG):
|
||||
anime en accent, fecha (solo Diario) y estrella (solo Favoritos) -->
|
||||
<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_anime"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="Anime"
|
||||
android:textColor="@color/accent"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/card_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="17 oct"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="11sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/card_star"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="Quitar de favoritos"
|
||||
android:src="@drawable/ic_nav_star"
|
||||
android:visibility="gone"
|
||||
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,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Vista cerrada del Spinner del filtro de anime (dentro de la card con chevron) -->
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/textPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Barra de navegación inferior compartida (Inicio/Favoritos/Diario/Ajustes).
|
||||
El activo se marca desde código (BottomNavHelper) tintando icono+texto 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_diario"
|
||||
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_book"
|
||||
app:tint="@color/colorTextMuted" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/nav_diario"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/nav_ajustes"
|
||||
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_ajustes"
|
||||
android:textColor="@color/colorTextMuted"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--<item
|
||||
android:id="@+id/calendar"
|
||||
android:title="Calendario"/>-->
|
||||
<item
|
||||
android:id="@+id/anime"
|
||||
android:title="Animes"/>
|
||||
<item
|
||||
android:id="@+id/favs"
|
||||
android:title="Favoritos"/>
|
||||
<item
|
||||
android:id="@+id/options"
|
||||
android:title="Opciones"/>
|
||||
<item
|
||||
android:id="@+id/about"
|
||||
android:title="Acerca de"/>
|
||||
<item
|
||||
android:id="@+id/exit"
|
||||
android:title="Salir" />
|
||||
</menu>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Menú contextual de una frase del Diario (como Favoritos sin "borrar fav") -->
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@+id/copy"
|
||||
android:title="Copiar" />
|
||||
|
||||
<item android:id="@+id/share"
|
||||
android:title="Compartir" />
|
||||
</menu>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Modo oscuro del rediseño (mockup SVG, prefers-color-scheme: dark) -->
|
||||
<color name="bgMain">#121212</color>
|
||||
<color name="bgCard">#1E1E1E</color>
|
||||
<color name="bgSecondary">#2C2C2C</color>
|
||||
<color name="borderColor">#2E2E2E</color>
|
||||
<color name="borderStrong">#444444</color>
|
||||
<color name="textPrimary">#E0E0E0</color>
|
||||
<color name="colorTextSecondary">#B0B0B0</color>
|
||||
<color name="colorTextMuted">#757575</color>
|
||||
<color name="accent">#4A76A8</color>
|
||||
<color name="star">#FFD43B</color>
|
||||
</resources>
|
||||
@@ -5,4 +5,16 @@
|
||||
<color name="colorPrimaryDark">#23292d</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
|
||||
<!-- Paleta del rediseño 2026-10 (mockup SVG, tema claro) -->
|
||||
<color name="bgMain">#F8F9FA</color>
|
||||
<color name="bgCard">#FFFFFF</color>
|
||||
<color name="bgSecondary">#F1F3F5</color>
|
||||
<color name="borderColor">#E9ECEF</color>
|
||||
<color name="borderStrong">#CED4DA</color>
|
||||
<color name="textPrimary">#212529</color>
|
||||
<color name="colorTextSecondary">#495057</color>
|
||||
<color name="colorTextMuted">#868E96</color>
|
||||
<color name="accent">#3B5998</color>
|
||||
<color name="star">#FCC419</color>
|
||||
|
||||
</resources>
|
||||
@@ -1,6 +1,40 @@
|
||||
<resources>
|
||||
<string name="app_name">Frases de Anime</string>
|
||||
<string name="sharefrom"> -A través de Frases de Anime, en la Play Store-</string>
|
||||
<!-- Rediseño 2026-10 (mockup SVG) -->
|
||||
<string name="btn_change">CAMBIAR FRASE</string>
|
||||
<string name="btn_today">Hoy</string>
|
||||
<string name="stat_this_anime">Frases del anime</string>
|
||||
<string name="stat_total">Frases totales sel.</string>
|
||||
<string name="stat_frases">frases</string>
|
||||
<string name="menu_diario">Diario</string>
|
||||
<string name="diario_todos">Todos los animes</string>
|
||||
<!-- Bottom nav -->
|
||||
<string name="nav_inicio">Inicio</string>
|
||||
<string name="nav_favoritos">Favoritos</string>
|
||||
<string name="nav_diario">Diario</string>
|
||||
<string name="nav_ajustes">Opciones</string>
|
||||
<!-- Listas rediseñadas -->
|
||||
<string name="buscar_favoritos">Buscar en favoritos…</string>
|
||||
<string name="buscar_diario">Buscar en el diario…</string>
|
||||
<string name="filtrar_por_anime">Filtrar por anime</string>
|
||||
<string name="lista_vacia">Todavía no hay nada por aquí</string>
|
||||
<!-- Opciones rediseñadas -->
|
||||
<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_animes_title">Animes seleccionados</string>
|
||||
<string name="opts_animes_desc">Elige de qué animes salen las frases</string>
|
||||
<string name="buscar_animes">Buscar anime…</string>
|
||||
<string name="seleccionar_todos">SELECCIONAR TODOS</string>
|
||||
<string name="deseleccionar_todos">DESELECCIONAR TODOS</string>
|
||||
<string name="opts_web_title">Visita jkanetwork.com</string>
|
||||
<string name="opts_web_desc">Más apps y proyectos</string>
|
||||
<string name="opts_priv_title">Política de privacidad</string>
|
||||
<string name="opts_priv_desc">Cómo tratamos tus datos</string>
|
||||
<string name="opts_about_title">Acerca de</string>
|
||||
<!-- TEST IDS OF ADMOB, FOR GIT -->
|
||||
<!--<string name="admob_id">ca-app-pub-3940256099942544~3347511713</string>
|
||||
<string name="admob_videoid">ca-app-pub-3940256099942544/5224354917</string>-->
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#Mon Oct 12 12:13:50 CEST 2026
|
||||
VERSION_CODE=1372
|
||||
#Wed Oct 21 17:34:59 CEST 2026
|
||||
VERSION_CODE=1420
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.10.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.2.10' apply false
|
||||
id 'com.android.application' version '9.4.1' apply false
|
||||
}
|
||||
@@ -13,6 +13,5 @@
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
#Tue Nov 14 12:27:09 CET 2017
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
Reference in new issue
Block a user