UI: Diario y Favoritos rediseñados con cards, búsqueda y filtro
Menú inferior compartido (Inicio/Favoritos/Diario/Opciones) en las 4 pantallas. Banner AdMob encima de la barra inferior en toda la app (loadBannerAd en App.kt, AdView por código con adSize adaptativo). Opciones rediseñada con cards y acciones web/privacidad. Eliminado menú popup del header y main.xml.
This commit is contained in:
1 parent
0755667a31
commit
f2b99def2f
31 files changed
+1413
-297
No files matched your search
@@ -20,6 +20,10 @@ import androidx.core.view.WindowCompat
|
|||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.WindowInsetsControllerCompat
|
import androidx.core.view.WindowInsetsControllerCompat
|
||||||
import androidx.core.view.ViewCompat
|
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.
|
* Created by kprkpr on 18/07/17.
|
||||||
@@ -100,6 +104,76 @@ private fun colorPrimary(act: AppCompatActivity): Int {
|
|||||||
return tv.data
|
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;
|
||||||
|
* la activity actual se cierra (salvo Inicio, que es raíz y se queda debajo).
|
||||||
|
*/
|
||||||
|
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)
|
||||||
|
|
||||||
|
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))
|
||||||
|
if (this !is MainActivity) finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
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 */
|
/** Toast corto, equivalente al toast() de Anko */
|
||||||
fun Context.toast(message: String) {
|
fun Context.toast(message: String) {
|
||||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
|
||||||
|
|||||||
@@ -3,93 +3,142 @@ package com.jkanetwork.st.frasesdeanime
|
|||||||
import android.content.ClipData
|
import android.content.ClipData
|
||||||
import android.content.ClipboardManager
|
import android.content.ClipboardManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.text.Editable
|
||||||
|
import android.text.TextWatcher
|
||||||
import android.view.ContextMenu
|
import android.view.ContextMenu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import android.widget.SimpleAdapter
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityDiaryBinding
|
import com.jkanetwork.st.frasesdeanime.databinding.ActivityDiaryBinding
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Diario (rediseño 2026-10): todas las frases ya vistas, filtrables por anime
|
* Diario (rediseño 2026-10, mockup SVG): frases vistas en cards con la fecha en
|
||||||
* con un desplegable. Patrón de FavsActivity (lista simple_2 + menú contextual).
|
* que salieron, búsqueda + filtro por anime y barra de navegación inferior.
|
||||||
|
* Long-press en card: copiar/compartir.
|
||||||
*/
|
*/
|
||||||
class DiaryActivity : AppCompatActivity() {
|
class DiaryActivity : AppCompatActivity() {
|
||||||
|
|
||||||
private lateinit var binding: ActivityDiaryBinding
|
private lateinit var binding: ActivityDiaryBinding
|
||||||
|
|
||||||
/* IDs de frase que hay en la lista, en el mismo orden que el adapter */
|
/* 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 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?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityDiaryBinding.inflate(layoutInflater)
|
binding = ActivityDiaryBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
applySystemBarsInsets(binding.root)
|
|
||||||
|
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.hide()
|
||||||
supportActionBar?.setTitle(R.string.menu_diario)
|
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)
|
||||||
|
|
||||||
val db = SQLiteHelper(applicationContext)
|
/* 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) {}
|
||||||
|
})
|
||||||
|
|
||||||
/* Desplegable: "Todos los animes" + los que tienen frases vistas.
|
adapter = QuoteCardAdapter(this, emptyList(), showStar = false)
|
||||||
La posición 0 es "todos"; las demás llevan el IDAnime en tag. */
|
binding.viewList.adapter = adapter
|
||||||
val animesWithSeen = LinkedHashMap<Int, String>() // IDAnime -> Name (orden alfabético)
|
binding.viewList.emptyView = binding.emptyList
|
||||||
db.getSeenFrases().forEach { idf ->
|
|
||||||
val ida = db.getIDAnimeFromIDF(idf)
|
|
||||||
if (ida > 0 && !animesWithSeen.containsKey(ida)) {
|
|
||||||
val name = db.getAnimeFromIDF(idf)
|
|
||||||
if (name != "...") animesWithSeen[ida] = name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val spinnerNames = mutableListOf(getString(R.string.diario_todos))
|
|
||||||
val spinnerIds = mutableListOf<Int?>(null)
|
|
||||||
animesWithSeen.entries.sortedBy { it.value.lowercase() }.forEach { (ida, name) ->
|
|
||||||
spinnerIds.add(ida)
|
|
||||||
spinnerNames.add(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
val spinnerAdapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, spinnerNames)
|
setupFilterSpinner()
|
||||||
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
|
||||||
binding.spinnerAnime.adapter = spinnerAdapter
|
|
||||||
|
|
||||||
binding.spinnerAnime.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
|
||||||
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
|
|
||||||
loadList(db, spinnerIds[position])
|
|
||||||
}
|
|
||||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Estado del filtro restaurado tras recrear la activity (giro, etc.).
|
|
||||||
OJO: registrar el listener después del primer layout dispara onItemSelected
|
|
||||||
solo a veces; la carga inicial se hace aquí explícitamente. */
|
|
||||||
val savedSel = if (savedInstanceState?.containsKey("spinner") == true) savedInstanceState.getInt("spinner") else 0
|
|
||||||
if (savedSel in spinnerNames.indices) binding.spinnerAnime.setSelection(savedSel, false)
|
|
||||||
loadList(db, spinnerIds[if (savedSel in spinnerIds.indices) savedSel else 0])
|
|
||||||
|
|
||||||
registerForContextMenu(binding.viewList)
|
registerForContextMenu(binding.viewList)
|
||||||
}
|
|
||||||
|
|
||||||
/** Rellena la lista con las frases vistas del anime indicado (null = todos) */
|
/* Restaurar filtro/búsqueda tras recrear la activity (giro, etc.) */
|
||||||
private fun loadList(db: SQLiteHelper, idAnime: Int?) {
|
savedInstanceState?.let {
|
||||||
listIDFrases = db.getSeenFrases(idAnime)
|
query = it.getString("query", "")
|
||||||
val data = ArrayList<HashMap<String, String>>()
|
filterAnime = if (it.containsKey("anime")) it.getInt("anime") else null
|
||||||
for (idf in listIDFrases) {
|
if (query.isNotEmpty()) binding.searchInput.setText(query)
|
||||||
val item = HashMap<String, String>()
|
|
||||||
item["sentence"] = db.getSentenceFromIDF(idf)
|
|
||||||
item["anime"] = db.getAnimeFromIDF(idf)
|
|
||||||
data.add(item)
|
|
||||||
}
|
}
|
||||||
binding.viewList.adapter = SimpleAdapter(this, data, android.R.layout.simple_list_item_2,
|
|
||||||
arrayOf("sentence", "anime"), intArrayOf(android.R.id.text1, android.R.id.text2))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
super.onSaveInstanceState(outState)
|
super.onSaveInstanceState(outState)
|
||||||
outState.putInt("spinner", binding.spinnerAnime.selectedItemPosition)
|
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) {
|
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenu.ContextMenuInfo) {
|
||||||
@@ -97,16 +146,9 @@ class DiaryActivity : AppCompatActivity() {
|
|||||||
menuInflater.inflate(R.menu.menu_diarysentence, menu)
|
menuInflater.inflate(R.menu.menu_diarysentence, menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Flecha Atrás del ActionBar */
|
|
||||||
override fun onSupportNavigateUp(): Boolean {
|
|
||||||
finish()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onContextItemSelected(item: MenuItem): Boolean {
|
override fun onContextItemSelected(item: MenuItem): Boolean {
|
||||||
val info = item.menuInfo as AdapterView.AdapterContextMenuInfo
|
val info = item.menuInfo as AdapterView.AdapterContextMenuInfo
|
||||||
if (info.position !in listIDFrases.indices) return false
|
if (info.position !in listIDFrases.indices) return false
|
||||||
val db = SQLiteHelper(applicationContext)
|
|
||||||
val idf = listIDFrases[info.position]
|
val idf = listIDFrases[info.position]
|
||||||
val sentence = db.getSentenceFromIDF(idf)
|
val sentence = db.getSentenceFromIDF(idf)
|
||||||
val anime = db.getAnimeFromIDF(idf)
|
val anime = db.getAnimeFromIDF(idf)
|
||||||
|
|||||||
@@ -1,90 +1,176 @@
|
|||||||
package com.jkanetwork.st.frasesdeanime
|
package com.jkanetwork.st.frasesdeanime
|
||||||
|
|
||||||
|
import android.content.ClipData
|
||||||
|
import android.content.ClipboardManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import android.text.Editable
|
||||||
|
import android.text.TextWatcher
|
||||||
import android.view.ContextMenu
|
import android.view.ContextMenu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
import android.content.ClipboardManager
|
import android.widget.ArrayAdapter
|
||||||
import android.content.ClipData
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityListBinding
|
import androidx.core.content.ContextCompat
|
||||||
|
import com.jkanetwork.st.frasesdeanime.databinding.ActivityFavsBinding
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by kprkpr on 25/07/17.
|
* Created by kprkpr on 25/07/17.
|
||||||
* Help: https://www.youtube.com/watch?v=x-M1L6tcsLo
|
* Rediseño 2026-10 (mockup SVG): header + búsqueda + filtro por anime + cards,
|
||||||
* Layout DSL de Anko migrado a XML (activity_list.xml) + ViewBinding
|
* 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?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityListBinding.inflate(layoutInflater)
|
binding = ActivityFavsBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
applySystemBarsInsets(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>>()
|
/* Búsqueda: refiltra al teclear */
|
||||||
val db = SQLiteHelper(applicationContext)
|
binding.searchInput.addTextChangedListener(object : TextWatcher {
|
||||||
val listIDFrases = db.getAllIDFavs()
|
override fun afterTextChanged(s: Editable?) { query = s?.toString()?.trim() ?: ""; applyFilters() }
|
||||||
val length = listIDFrases.size
|
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){
|
/* Estrella de cada card: quitar de favoritos */
|
||||||
val item = HashMap<String, String>()
|
adapter = QuoteCardAdapter(this, emptyList(), showStar = true) { onUnfav(it) }
|
||||||
item.put("sentence",db.getSentenceFromIDF(listIDFrases[i]))
|
binding.viewList.adapter = adapter
|
||||||
item.put("anime",db.getAnimeFromIDF(listIDFrases[i]))
|
binding.viewList.emptyView = binding.emptyList
|
||||||
data.add(item)
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.viewList.adapter = android.widget.SimpleAdapter(this,data,android.R.layout.simple_list_item_2,
|
setupFilterSpinner()
|
||||||
arrayOf("sentence","anime"), intArrayOf(android.R.id.text1,android.R.id.text2))
|
|
||||||
|
|
||||||
registerForContextMenu(binding.viewList)
|
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,
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
menuInfo: ContextMenu.ContextMenuInfo) {
|
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)
|
super.onCreateContextMenu(menu, v, menuInfo)
|
||||||
val inflater = getMenuInflater()
|
menuInflater.inflate(R.menu.menu_favsentence, menu)
|
||||||
inflater.inflate(R.menu.menu_favsentence, menu)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Flecha Atrás del ActionBar */
|
|
||||||
override fun onSupportNavigateUp(): Boolean {
|
|
||||||
finish()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun onContextItemSelected(item: MenuItem): Boolean {
|
override fun onContextItemSelected(item: MenuItem): Boolean {
|
||||||
val info = item.getMenuInfo() as AdapterView.AdapterContextMenuInfo
|
val info = item.menuInfo as AdapterView.AdapterContextMenuInfo
|
||||||
val obj = binding.viewList.getItemAtPosition(info.position) as HashMap<String, String>
|
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 -> {
|
R.id.copy -> {
|
||||||
var clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", "${obj.get("sentence")} (${obj.get("anime")}) \n ${this.getString(R.string.sharefrom)}"))
|
clipboard.setPrimaryClip(ClipData.newPlainText("Sentence", shared))
|
||||||
toast("Copiado al portapapeles")
|
toast("Copiado al portapapeles")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
R.id.delfav -> {
|
R.id.delfav -> {
|
||||||
var db = SQLiteHelper(applicationContext)
|
db.setFav(idf)
|
||||||
val IDFavs = db.getAllIDFavs()
|
loadAll()
|
||||||
db.setFav(IDFavs[info.position])
|
|
||||||
restartActivity(this)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
R.id.share -> {
|
R.id.share -> {
|
||||||
share("${obj.get("sentence")} (${obj.get("anime")}) \n ${this.getString(R.string.sharefrom)}")
|
share(shared)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,8 @@ import androidx.appcompat.app.AppCompatActivity
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.MenuItem
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.PopupMenu
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
@@ -23,10 +21,7 @@ import androidx.activity.OnBackPressedCallback
|
|||||||
|
|
||||||
/* Ads */
|
/* Ads */
|
||||||
import com.google.android.gms.ads.AdRequest
|
import com.google.android.gms.ads.AdRequest
|
||||||
import com.google.android.gms.ads.AdSize
|
|
||||||
import com.google.android.gms.ads.AdView
|
|
||||||
import com.google.android.gms.ads.MobileAds
|
import com.google.android.gms.ads.MobileAds
|
||||||
import android.widget.FrameLayout
|
|
||||||
import com.google.android.gms.ads.FullScreenContentCallback
|
import com.google.android.gms.ads.FullScreenContentCallback
|
||||||
import com.google.android.gms.ads.rewarded.RewardedAd;
|
import com.google.android.gms.ads.rewarded.RewardedAd;
|
||||||
import com.google.android.ump.ConsentRequestParameters
|
import com.google.android.ump.ConsentRequestParameters
|
||||||
@@ -44,9 +39,6 @@ import com.jkanetwork.st.frasesdeanime.databinding.ActivityMainBinding
|
|||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
private var rewardedAd: RewardedAd? = null
|
private var rewardedAd: RewardedAd? = null
|
||||||
|
|
||||||
/* Banner creado por código en loadBannerAd (el XML sólo lleva su contenedor) */
|
|
||||||
private var bannerAdView: AdView? = null
|
|
||||||
|
|
||||||
private lateinit var binding: ActivityMainBinding
|
private lateinit var binding: ActivityMainBinding
|
||||||
|
|
||||||
|
|
||||||
@@ -76,6 +68,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
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),
|
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||||
darkNavbar = isDark, lightStatusIcons = !isDark)
|
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||||
|
setupBottomNav(binding.bottomNav, NavTab.INICIO)
|
||||||
|
|
||||||
/* "Close" app on back button: moveTaskToBack. Migrado a OnBackPressedDispatcher
|
/* "Close" app on back button: moveTaskToBack. Migrado a OnBackPressedDispatcher
|
||||||
porque onBackPressed override ya no se invoca con el gesto back predictivo. */
|
porque onBackPressed override ya no se invoca con el gesto back predictivo. */
|
||||||
@@ -131,14 +124,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Menú del header (rediseño): mismo menú main.xml, en PopupMenu sobre el botón */
|
|
||||||
binding.btnMenu.setOnClickListener { anchor ->
|
|
||||||
val popup = PopupMenu(this, anchor)
|
|
||||||
popup.menuInflater.inflate(R.menu.main, popup.menu)
|
|
||||||
popup.setOnMenuItemClickListener { item -> onMenuItem(item) }
|
|
||||||
popup.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Button listeners */
|
/* Button listeners */
|
||||||
binding.btnFav.setOnClickListener() {
|
binding.btnFav.setOnClickListener() {
|
||||||
db.setFav(IDFraseS)
|
db.setFav(IDFraseS)
|
||||||
@@ -264,32 +249,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Thread {
|
Thread {
|
||||||
MobileAds.initialize(applicationContext) {
|
MobileAds.initialize(applicationContext) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
loadBannerAd()
|
loadBannerAd(binding.adContainer)
|
||||||
loadRewardedAd()
|
loadRewardedAd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Banner adaptativo anclado abajo (sustituye al SMART_BANNER deprecated).
|
|
||||||
* El AdView se crea 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. */
|
|
||||||
private fun loadBannerAd() {
|
|
||||||
if (bannerAdView == null) {
|
|
||||||
bannerAdView = 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@MainActivity, adWidthDp))
|
|
||||||
adUnitId = getString(R.string.admob_bannerid)
|
|
||||||
}
|
|
||||||
binding.adContainer.addView(
|
|
||||||
bannerAdView,
|
|
||||||
FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT))
|
|
||||||
}
|
|
||||||
bannerAdView?.loadAd(AdRequest.Builder().build())
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Carga el anuncio recompensado con el ID de UNIDAD (videoid), no el de app. */
|
/** Carga el anuncio recompensado con el ID de UNIDAD (videoid), no el de app. */
|
||||||
private fun loadRewardedAd() {
|
private fun loadRewardedAd() {
|
||||||
// ID de unidad correcto: admob_videoid (admob_id es el de aplicación)
|
// ID de unidad correcto: admob_videoid (admob_id es el de aplicación)
|
||||||
@@ -362,39 +328,4 @@ class MainActivity : AppCompatActivity() {
|
|||||||
binding.btnFav.setBackgroundResource(R.drawable.star_off);
|
binding.btnFav.setBackgroundResource(R.drawable.star_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Maneja las opciones del menú del header (Animes/Diario/Favoritos/...) */
|
|
||||||
private fun onMenuItem(item: MenuItem): Boolean{
|
|
||||||
when (item.getItemId()) {
|
|
||||||
R.id.favs -> {
|
|
||||||
startActivity<FavsActivity>()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
R.id.diario -> {
|
|
||||||
startActivity<DiaryActivity>()
|
|
||||||
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 true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,19 +4,23 @@ import android.os.Bundle
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityOptsBinding
|
import com.jkanetwork.st.frasesdeanime.databinding.ActivityOptsBinding
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by kprkpr on 30/08/17.
|
* Created by kprkpr on 30/08/17.
|
||||||
|
* Rediseño 2026-10 (mockup SVG): cards de ajustes con título+descripción, acciones
|
||||||
|
* para jkanetwork.com y política de privacidad, banner + barra inferior.
|
||||||
* Guardado automático: cada cambio (checks, hora, minuto) se aplica al momento —
|
* Guardado automático: cada cambio (checks, hora, minuto) se aplica al momento —
|
||||||
* no hay botón "Guardar cambios".
|
* no hay botón "Guardar cambios".
|
||||||
*/
|
*/
|
||||||
class OptsActivity : AppCompatActivity(){
|
class OptsActivity : AppCompatActivity() {
|
||||||
|
|
||||||
private lateinit var binding: ActivityOptsBinding
|
private lateinit var binding: ActivityOptsBinding
|
||||||
lateinit var P: Prefs
|
lateinit var P: Prefs
|
||||||
@@ -25,9 +29,13 @@ class OptsActivity : AppCompatActivity(){
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityOptsBinding.inflate(layoutInflater)
|
binding = ActivityOptsBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
applySystemBarsInsets(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)
|
P = Prefs(applicationContext)
|
||||||
|
|
||||||
@@ -41,8 +49,8 @@ class OptsActivity : AppCompatActivity(){
|
|||||||
minutes.add(i)
|
minutes.add(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
val hoursAdapter = ArrayAdapter(this,android.R.layout.simple_list_item_1,hours)
|
val hoursAdapter = ArrayAdapter(this, R.layout.spinner_value, hours)
|
||||||
val minutesAdapter = ArrayAdapter(this,android.R.layout.simple_list_item_1,minutes)
|
val minutesAdapter = ArrayAdapter(this, R.layout.spinner_value, minutes)
|
||||||
|
|
||||||
hoursAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
hoursAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||||
minutesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
minutesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||||
@@ -81,6 +89,12 @@ class OptsActivity : AppCompatActivity(){
|
|||||||
}
|
}
|
||||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
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>() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Guarda prefs y reprograma la alarma. Se llama tras cada cambio. */
|
/** Guarda prefs y reprograma la alarma. Se llama tras cada cambio. */
|
||||||
@@ -116,11 +130,6 @@ class OptsActivity : AppCompatActivity(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSupportNavigateUp(): Boolean {
|
|
||||||
finish()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setEnabledParts() {
|
fun setEnabledParts() {
|
||||||
if (binding.chkAlarm.isChecked) {
|
if (binding.chkAlarm.isChecked) {
|
||||||
binding.chkPersistent.isEnabled = true
|
binding.chkPersistent.isEnabled = true
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -299,13 +299,17 @@ class SQLiteHelper(ctx: Context) : SQLiteOpenHelper(ctx, "app.sqlite", null, 1)
|
|||||||
return Pair(seen, ids.size)
|
return Pair(seen, ids.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Frases ya vistas (IDFrase) en orden cronológico por día visto.
|
/** 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) */
|
* @param idAnime: si no es null, sólo las de ese anime (Diario filtrado) */
|
||||||
fun getSeenFrases(idAnime: Int? = null): List<Int> {
|
fun getSeenFrases(idAnime: Int? = null): List<Pair<String, Int>> {
|
||||||
val seen = intList(appDb, "SELECT IDFrase FROM FRASESVI WHERE IDFrase > 0 ORDER BY TDay ASC")
|
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
|
if (idAnime == null) return seen
|
||||||
val ofAnime = intList(catalog(), "SELECT IDFrase FROM FRASES WHERE IDAnime = '$idAnime'").toHashSet()
|
val ofAnime = intList(catalog(), "SELECT IDFrase FROM FRASES WHERE IDAnime = '$idAnime'").toHashSet()
|
||||||
return seen.filter { ofAnime.contains(it) }
|
return seen.filter { ofAnime.contains(it.second) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAllAnimeIDs(): Array<Int>{
|
fun getAllAnimeIDs(): Array<Int>{
|
||||||
|
|||||||
@@ -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,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="#FFFFFFFF"
|
||||||
|
android:pathData="M12,2a10,10 0 1,0 0,20a10,10 0 0,0 0,-20zM12,4c1.93,0 3.68,0.69 5.05,1.83L13,10.71V4.06C12.67,4.02 12.34,4 12,4zM11,4.06v6.65L6.95,5.83C8.32,4.69 10.07,4 12,4h-1zM4.06,11h6.65L6.95,5.83A7.96,7.96 0 0,0 4,12c0,0.34 0.02,0.67 0.06,1V11zM4.06,13h6.65L6.95,18.17A7.96,7.96 0 0,1 4,12c0,0.34 0.02,0.67 0.06,1zM11,19.94v-6.65l-4.05,4.22C8.32,18.65 10.07,19.34 12,19.34L11,19.94zM12,20c-1.93,0 -3.68,-0.69 -5.05,-1.83L11,13.29v6.65c0.33,0.04 0.66,0.06 1,0.06h-1zM13,19.94v-6.65l4.05,4.22A7.96,7.96 0 0,1 13,19.94zM17.05,18.17L13,13.29v6.65c1.93,-0.05 3.68,-0.74 4.05,-1.77zM19.94,13h-6.65l4.05,4.17A7.96,7.96 0 0,0 20,12c0,0.34 -0.02,0.67 -0.06,1zM19.94,11a7.96,7.96 0 0,0 -1.89,-5.17L13,10.71h6.94c-0.04,-0.24 -0.08,-0.48 0,-0.71z" />
|
||||||
|
</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>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?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="#FF495057"
|
|
||||||
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />
|
|
||||||
</vector>
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp" android:height="24dp"
|
||||||
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="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,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,19.93A8,8 0 0,1 4,12c0,-0.62 0.07,-1.22 0.21,-1.79L9,15v1a2,2 0 0,0 2,2v1.93zM18.92,15.9A1.98,1.98 0 0,0 17,14h-1v-3a1,1 0 0,0 -1,-1H8V8h2a1,1 0 0,0 1,-1V5h2a2,2 0 0,1 2,2v1h2a1,1 0 0,1 1,1v6a1.97,1.97 0 0,1 -0.08,0.9z" />
|
||||||
|
</vector>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 121 KiB |
@@ -1,20 +1,155 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Diario: desplegable de filtro por anime + lista de frases vistas.
|
<!-- Diario rediseñado (mockup SVG): header + búsqueda + filtro anime + cards con fecha -->
|
||||||
Basado en activity_list.xml (Favoritos) con Spinner añadido arriba. -->
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/bgMain"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<Spinner
|
<!-- Header -->
|
||||||
android:id="@+id/spinner_anime"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="60dp"
|
||||||
android:layout_margin="12dp" />
|
android:background="@color/bgCard"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp">
|
||||||
|
|
||||||
<ListView
|
<TextView
|
||||||
android:id="@+id/view_list"
|
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_width="match_parent"
|
||||||
android:layout_height="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>
|
</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>
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
android:paddingStart="20dp"
|
android:paddingStart="20dp"
|
||||||
android:paddingEnd="12dp">
|
android:paddingEnd="12dp">
|
||||||
|
|
||||||
|
<!-- Rediseño: el menú pasa a la barra de navegación inferior -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -28,15 +29,6 @@
|
|||||||
android:textColor="@color/textPrimary"
|
android:textColor="@color/textPrimary"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/btn_menu"
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
android:contentDescription="@string/menu"
|
|
||||||
app:srcCompat="@drawable/ic_more_vert"
|
|
||||||
app:tint="@color/colorTextSecondary" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
@@ -272,10 +264,15 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Banner (AdView por código en loadBannerAd) -->
|
<!-- Banner AdMob (AdView por código en loadBannerAd) sobre la barra inferior -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/adContainer"
|
android:id="@+id/adContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<!-- Barra de navegación inferior -->
|
||||||
|
<include
|
||||||
|
android:id="@+id/bottom_nav"
|
||||||
|
layout="@layout/view_bottom_nav" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,72 +1,427 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Opciones rediseñadas (mockup SVG): cards de ajustes con título+descripción
|
||||||
|
+ acciones (web, privacidad, acerca de). Banner + barra inferior al final. -->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="4dp"
|
android:background="@color/bgMain"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<CheckBox
|
<!-- Header -->
|
||||||
android:id="@+id/chk_alarm"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="57dp"
|
|
||||||
android:text="¿Notificar frase diaria?"
|
|
||||||
android:textAlignment="textStart" />
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chk_persistent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="57dp"
|
|
||||||
android:text="¿Quieres que sea persistente?"
|
|
||||||
android:textAlignment="textStart" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layoutWhen"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_when"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:text="@string/nav_ajustes"
|
||||||
android:text="Cuando mostrar:"
|
android:textColor="@color/textPrimary"
|
||||||
android:textColor="@android:color/black"
|
android:textSize="18sp"
|
||||||
android:textSize="18sp" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/spinnerHour"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:dropDownWidth="80dp" />
|
|
||||||
|
|
||||||
<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" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<View
|
||||||
android:id="@+id/imgBackground"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="1dp"
|
||||||
android:contentDescription="background"
|
android:background="@color/borderColor" />
|
||||||
app:srcCompat="@drawable/opts" />
|
|
||||||
|
<!-- 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="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 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<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="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:text="@string/opts_hora_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinner_hour"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_card_strong"
|
||||||
|
android:dropDownWidth="80dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text=":"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinner_minute"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_card_strong"
|
||||||
|
android:dropDownWidth="80dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</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: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_animes_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_animes_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>
|
||||||
|
|
||||||
|
<!-- Visita jkanetwork.com -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/card_web"
|
||||||
|
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_web"
|
||||||
|
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_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>
|
</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,25 +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/diario"
|
|
||||||
android:title="Diario"/>
|
|
||||||
<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>
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
<string name="app_name">Frases de Anime</string>
|
<string name="app_name">Frases de Anime</string>
|
||||||
<string name="sharefrom"> -A través de Frases de Anime, en la Play Store-</string>
|
<string name="sharefrom"> -A través de Frases de Anime, en la Play Store-</string>
|
||||||
<!-- Rediseño 2026-10 (mockup SVG) -->
|
<!-- Rediseño 2026-10 (mockup SVG) -->
|
||||||
<string name="menu">Menú</string>
|
|
||||||
<string name="btn_change">CAMBIAR FRASE</string>
|
<string name="btn_change">CAMBIAR FRASE</string>
|
||||||
<string name="btn_today">Hoy</string>
|
<string name="btn_today">Hoy</string>
|
||||||
<string name="stat_this_anime">EN ESTE ANIME</string>
|
<string name="stat_this_anime">EN ESTE ANIME</string>
|
||||||
@@ -10,6 +9,29 @@
|
|||||||
<string name="stat_frases">frases</string>
|
<string name="stat_frases">frases</string>
|
||||||
<string name="menu_diario">Diario</string>
|
<string name="menu_diario">Diario</string>
|
||||||
<string name="diario_todos">Todos los animes</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="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 -->
|
<!-- TEST IDS OF ADMOB, FOR GIT -->
|
||||||
<!--<string name="admob_id">ca-app-pub-3940256099942544~3347511713</string>
|
<!--<string name="admob_id">ca-app-pub-3940256099942544~3347511713</string>
|
||||||
<string name="admob_videoid">ca-app-pub-3940256099942544/5224354917</string>-->
|
<string name="admob_videoid">ca-app-pub-3940256099942544/5224354917</string>-->
|
||||||
|
|||||||
Reference in new issue
Block a user