UI: AnimesSel rediseñada con checks, TimePicker en Opciones, nav sin animación
AnimesSel: estilo Opciones (header con atrás, buscador, cards con check visible tintado accent). Hora: card con TimePicker y hora en gris en vez de spinners. Iconos reloj/globo de los SVG de Kevin. Navegación por tabs sin animación lateral y sin recrear pantallas (el banner no se recarga).
This commit is contained in:
1 parent
f2b99def2f
commit
43f59774ed
10 files changed
+320
-191
No files matched your search
@@ -0,0 +1,52 @@
|
|||||||
|
package com.jkanetwork.st.frasesdeanime
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.BaseAdapter
|
||||||
|
import android.widget.CheckBox
|
||||||
|
import android.widget.TextView
|
||||||
|
|
||||||
|
/** Fila de la lista de selección de animes (item_anime_check.xml).
|
||||||
|
* data class AnimeRow [id] = IDAnime, [name], [sel] = seleccionado. */
|
||||||
|
data class AnimeRow(val id: Int, val name: String, var sel: Boolean)
|
||||||
|
|
||||||
|
/** Adapter para la selección de animes con filtro de búsqueda.
|
||||||
|
* El toggle (check) se notifica por [onToggle] para persistirlo en BD. */
|
||||||
|
class AnimeSelAdapter(
|
||||||
|
private var rows: List<AnimeRow>,
|
||||||
|
private val onToggle: (AnimeRow) -> Unit
|
||||||
|
) : BaseAdapter() {
|
||||||
|
|
||||||
|
private var query: String = ""
|
||||||
|
|
||||||
|
fun update(newRows: List<AnimeRow>) {
|
||||||
|
rows = newRows
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun filter(text: String) {
|
||||||
|
query = text.trim()
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
private val visible: List<AnimeRow>
|
||||||
|
get() = if (query.isEmpty()) rows else rows.filter { it.name.contains(query, ignoreCase = true) }
|
||||||
|
|
||||||
|
override fun getCount(): Int = visible.size
|
||||||
|
override fun getItem(position: Int): Any = visible[position]
|
||||||
|
override fun getItemId(position: Int): Long = visible[position].id.toLong()
|
||||||
|
|
||||||
|
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||||
|
val v = convertView ?: android.view.LayoutInflater.from(parent.context)
|
||||||
|
.inflate(R.layout.item_anime_check, parent, false)
|
||||||
|
val row = visible[position]
|
||||||
|
v.findViewById<TextView>(R.id.txt_name).text = row.name
|
||||||
|
v.findViewById<CheckBox>(R.id.chk_anime).isChecked = row.sel
|
||||||
|
v.setOnClickListener {
|
||||||
|
row.sel = !row.sel
|
||||||
|
v.findViewById<CheckBox>(R.id.chk_anime).isChecked = row.sel
|
||||||
|
onToggle(row)
|
||||||
|
}
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,67 +3,38 @@ package com.jkanetwork.st.frasesdeanime
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.ViewGroup
|
import android.content.res.Configuration
|
||||||
import android.widget.CheckBox
|
|
||||||
import android.widget.ListView
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import com.jkanetwork.st.frasesdeanime.databinding.ActivityAnimesSelBinding
|
import com.jkanetwork.st.frasesdeanime.databinding.ActivityAnimesSelBinding
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 (estilo Opciones): header con atrás + buscador + lista de
|
||||||
* Layout DSL de Anko migrado a XML + ViewBinding. Buscador superior (2026-10).
|
* cards con check a la izquierda. Guardado directo en BD al togglear.
|
||||||
*/
|
*/
|
||||||
class AnimesSelActivity : AppCompatActivity(){
|
class AnimesSelActivity : AppCompatActivity() {
|
||||||
private lateinit var binding: ActivityAnimesSelBinding
|
private lateinit var binding: ActivityAnimesSelBinding
|
||||||
|
private lateinit var adapter: AnimeSelAdapter
|
||||||
|
private val db by lazy { SQLiteHelper(applicationContext) }
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityAnimesSelBinding.inflate(layoutInflater)
|
binding = ActivityAnimesSelBinding.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)
|
||||||
|
|
||||||
val db = SQLiteHelper(applicationContext) //Database connection
|
binding.btnBack.setOnClickListener { finish() }
|
||||||
|
|
||||||
if (db.getAllAnimeSel()){ //If all selected
|
adapter = AnimeSelAdapter(loadRows()) { row ->
|
||||||
binding.btnSel.text = "Deseleccionar todos"
|
db.setAnimeSel(row.id)
|
||||||
}else{
|
|
||||||
binding.btnSel.text = "Seleccionar todos"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Load ids, names and selection state
|
|
||||||
val arrayIDs = db.getAllAnimeIDs()
|
|
||||||
val arrayNames = db.getAllAnimeNames()
|
|
||||||
val length = arrayIDs.size
|
|
||||||
|
|
||||||
val listSel = ArrayList<Boolean>()
|
|
||||||
val listNames = ArrayList<String>()
|
|
||||||
for (i in 0..length -1){
|
|
||||||
listSel.add(db.getAnimeSel(arrayIDs[i]))
|
|
||||||
listNames.add(arrayNames[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adapter with search filter. CustomListAdapter class is in "CustomListAdapter.kt"
|
|
||||||
val adapter = CustomListAdapter<String>(
|
|
||||||
{ listNames },
|
|
||||||
{ index, names, view ->
|
|
||||||
val checkBox = CheckBox(this)
|
|
||||||
checkBox.layoutParams = android.widget.AbsListView.LayoutParams(
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(56))
|
|
||||||
checkBox.text = names[index]
|
|
||||||
checkBox.isChecked = listSel[index]
|
|
||||||
checkBox.textSize = 18f
|
|
||||||
checkBox.setPadding(dpToPx(16), 0, dpToPx(16), 0)
|
|
||||||
checkBox.setOnClickListener {
|
|
||||||
db.setAnimeSel(db.getIDAnimeFromName(names[index]))
|
|
||||||
listSel[index] = !listSel[index]
|
|
||||||
checkBox.isChecked = listSel[index]
|
|
||||||
}
|
|
||||||
checkBox
|
|
||||||
})
|
|
||||||
|
|
||||||
binding.viewList.adapter = adapter
|
binding.viewList.adapter = adapter
|
||||||
|
|
||||||
binding.txtSearch.addTextChangedListener(object : TextWatcher {
|
binding.txtSearch.addTextChangedListener(object : TextWatcher {
|
||||||
@@ -72,19 +43,26 @@ class AnimesSelActivity : AppCompatActivity(){
|
|||||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
refreshSelButton()
|
||||||
binding.btnSel.setOnClickListener {
|
binding.btnSel.setOnClickListener {
|
||||||
db.setAllAnimeSel()
|
db.setAllAnimeSel()
|
||||||
restartActivity(this)
|
adapter.update(loadRows())
|
||||||
|
refreshSelButton()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun dpToPx(dp: Int): Int =
|
/** Recarga IDs, nombres y estado de selección de la BD */
|
||||||
(dp * resources.displayMetrics.density).toInt()
|
private fun loadRows(): List<AnimeRow> {
|
||||||
|
val ids = db.getAllAnimeIDs()
|
||||||
/** Flecha Atrás del ActionBar */
|
val names = db.getAllAnimeNames()
|
||||||
override fun onSupportNavigateUp(): Boolean {
|
return ids.indices.map { i -> AnimeRow(ids[i], names[i], db.getAnimeSel(ids[i])) }
|
||||||
finish()
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun refreshSelButton() {
|
||||||
|
binding.btnSel.text = if (db.getAllAnimeSel()) {
|
||||||
|
getString(R.string.deseleccionar_todos)
|
||||||
|
} else {
|
||||||
|
getString(R.string.seleccionar_todos)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -112,13 +112,20 @@ enum class NavTab { INICIO, FAVORITOS, DIARIO, AJUSTES }
|
|||||||
/**
|
/**
|
||||||
* Prepara la barra de navegación inferior (view_bottom_nav.xml) en una activity:
|
* 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.
|
* 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;
|
* 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).
|
* (sin recrear → el banner NO se recarga) y NO_ANIMATION + overridePendingTransition(0,0)
|
||||||
|
* quita la animación lateral del cambio de activity. Las pantallas tab no se
|
||||||
|
* cierran nunca al navegar (la pila queda acotada a las 4 tabs + pantallas hijas);
|
||||||
|
* las secundarias (AnimesSel) sí se cierran al irse por una tab.
|
||||||
*/
|
*/
|
||||||
fun AppCompatActivity.setupBottomNav(nav: ViewBottomNavBinding, active: NavTab) {
|
fun AppCompatActivity.setupBottomNav(nav: ViewBottomNavBinding, active: NavTab) {
|
||||||
val accent = androidx.core.content.ContextCompat.getColor(this, R.color.accent)
|
val accent = androidx.core.content.ContextCompat.getColor(this, R.color.accent)
|
||||||
val muted = androidx.core.content.ContextCompat.getColor(this, R.color.colorTextMuted)
|
val muted = androidx.core.content.ContextCompat.getColor(this, R.color.colorTextMuted)
|
||||||
|
|
||||||
|
/* Pantallas que corresponden a una tab: no se cierran al navegar */
|
||||||
|
val tabScreens = setOf(MainActivity::class.java, FavsActivity::class.java,
|
||||||
|
DiaryActivity::class.java, OptsActivity::class.java)
|
||||||
|
|
||||||
fun styleTab(tab: android.view.ViewGroup, selected: Boolean) {
|
fun styleTab(tab: android.view.ViewGroup, selected: Boolean) {
|
||||||
val icon = tab.getChildAt(0) as android.widget.ImageView
|
val icon = tab.getChildAt(0) as android.widget.ImageView
|
||||||
val label = tab.getChildAt(1) as android.widget.TextView
|
val label = tab.getChildAt(1) as android.widget.TextView
|
||||||
@@ -137,8 +144,13 @@ fun AppCompatActivity.setupBottomNav(nav: ViewBottomNavBinding, active: NavTab)
|
|||||||
NavTab.AJUSTES -> OptsActivity::class.java
|
NavTab.AJUSTES -> OptsActivity::class.java
|
||||||
}
|
}
|
||||||
startActivity(android.content.Intent(this, cls)
|
startActivity(android.content.Intent(this, cls)
|
||||||
.addFlags(android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT))
|
.addFlags(android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or
|
||||||
if (this !is MainActivity) finish()
|
android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION))
|
||||||
|
overridePendingTransition(0, 0)
|
||||||
|
if (javaClass !in tabScreens) {
|
||||||
|
finish()
|
||||||
|
overridePendingTransition(0, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nav.navInicio.setOnClickListener { go(NavTab.INICIO) }
|
nav.navInicio.setOnClickListener { go(NavTab.INICIO) }
|
||||||
|
|||||||
@@ -5,20 +5,19 @@ 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.content.res.Configuration
|
||||||
import android.widget.ArrayAdapter
|
import android.app.NotificationManager
|
||||||
import android.widget.AdapterView
|
import android.app.TimePickerDialog
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.app.NotificationManager
|
|
||||||
import androidx.core.content.ContextCompat
|
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
|
* Rediseño 2026-10 (mockup SVG): cards de ajustes con título+descripción. La hora
|
||||||
* para jkanetwork.com y política de privacidad, banner + barra inferior.
|
* se elige con un TimePicker (antes dos spinners); acciones para jkanetwork.com
|
||||||
* Guardado automático: cada cambio (checks, hora, minuto) se aplica al momento —
|
* y política de privacidad; banner + barra de navegación inferior.
|
||||||
* no hay botón "Guardar cambios".
|
* Guardado automático: cada cambio se aplica al momento — no hay botón "Guardar".
|
||||||
*/
|
*/
|
||||||
class OptsActivity : AppCompatActivity() {
|
class OptsActivity : AppCompatActivity() {
|
||||||
|
|
||||||
@@ -39,32 +38,11 @@ class OptsActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
P = Prefs(applicationContext)
|
P = Prefs(applicationContext)
|
||||||
|
|
||||||
val hours = ArrayList<Int>()
|
|
||||||
val minutes = ArrayList<Int>()
|
|
||||||
|
|
||||||
for (i in 0..23){
|
|
||||||
hours.add(i)
|
|
||||||
}
|
|
||||||
for (i in 0..59){
|
|
||||||
minutes.add(i)
|
|
||||||
}
|
|
||||||
|
|
||||||
val hoursAdapter = ArrayAdapter(this, R.layout.spinner_value, hours)
|
|
||||||
val minutesAdapter = ArrayAdapter(this, R.layout.spinner_value, minutes)
|
|
||||||
|
|
||||||
hoursAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
|
||||||
minutesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
|
||||||
|
|
||||||
binding.spinnerHour.adapter = hoursAdapter
|
|
||||||
binding.spinnerMinute.adapter = minutesAdapter
|
|
||||||
|
|
||||||
binding.spinnerHour.setSelection(P.getHour())
|
|
||||||
binding.spinnerMinute.setSelection(P.getMinute())
|
|
||||||
|
|
||||||
binding.chkAlarm.isChecked = P.getNotifOn()
|
binding.chkAlarm.isChecked = P.getNotifOn()
|
||||||
binding.chkPersistent.isChecked = P.getPersNotifOn()
|
binding.chkPersistent.isChecked = P.getPersNotifOn()
|
||||||
|
|
||||||
setEnabledParts()
|
setEnabledParts()
|
||||||
|
updateHoraTxt()
|
||||||
|
|
||||||
/* Guardado automático en cada interacción */
|
/* Guardado automático en cada interacción */
|
||||||
binding.chkAlarm.setOnCheckedChangeListener { _, _ ->
|
binding.chkAlarm.setOnCheckedChangeListener { _, _ ->
|
||||||
@@ -76,18 +54,14 @@ class OptsActivity : AppCompatActivity() {
|
|||||||
saveAndApply()
|
saveAndApply()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.spinnerHour.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
/* Hora: TimePicker sobre la card */
|
||||||
override fun onItemSelected(parent: AdapterView<*>?, view: android.view.View?, position: Int, id: Long) {
|
binding.cardHora.setOnClickListener {
|
||||||
// onItemSelected también salta al fijar la selección inicial; solo guardar cambios reales
|
TimePickerDialog(this, { _, hour, minute ->
|
||||||
if (position != P.getHour()) saveAndApply()
|
P.setHour(hour)
|
||||||
}
|
P.setMinute(minute)
|
||||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
updateHoraTxt()
|
||||||
}
|
saveAndApply()
|
||||||
binding.spinnerMinute.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
}, P.getHour(), P.getMinute(), true).show()
|
||||||
override fun onItemSelected(parent: AdapterView<*>?, view: android.view.View?, position: Int, id: Long) {
|
|
||||||
if (position != P.getMinute()) saveAndApply()
|
|
||||||
}
|
|
||||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Acciones del rediseño */
|
/* Acciones del rediseño */
|
||||||
@@ -97,10 +71,13 @@ class OptsActivity : AppCompatActivity() {
|
|||||||
binding.cardAbout.setOnClickListener { startActivity<AboutActivity>() }
|
binding.cardAbout.setOnClickListener { startActivity<AboutActivity>() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Hora guardada en la card, en gris */
|
||||||
|
private fun updateHoraTxt() {
|
||||||
|
binding.txtHora.text = String.format("%d:%02d", P.getHour(), P.getMinute())
|
||||||
|
}
|
||||||
|
|
||||||
/** Guarda prefs y reprograma la alarma. Se llama tras cada cambio. */
|
/** Guarda prefs y reprograma la alarma. Se llama tras cada cambio. */
|
||||||
private fun saveAndApply() {
|
private fun saveAndApply() {
|
||||||
P.setHour(binding.spinnerHour.selectedItem.toString().toInt())
|
|
||||||
P.setMinute(binding.spinnerMinute.selectedItem.toString().toInt())
|
|
||||||
P.setNotifOn(binding.chkAlarm.isChecked)
|
P.setNotifOn(binding.chkAlarm.isChecked)
|
||||||
P.setPersNotifOn(binding.chkPersistent.isChecked)
|
P.setPersNotifOn(binding.chkPersistent.isChecked)
|
||||||
|
|
||||||
@@ -133,18 +110,13 @@ class OptsActivity : AppCompatActivity() {
|
|||||||
fun setEnabledParts() {
|
fun setEnabledParts() {
|
||||||
if (binding.chkAlarm.isChecked) {
|
if (binding.chkAlarm.isChecked) {
|
||||||
binding.chkPersistent.isEnabled = true
|
binding.chkPersistent.isEnabled = true
|
||||||
/* This other checks is chk_persistent checked dependent */
|
/* La hora no aplica con notificación persistente */
|
||||||
if (binding.chkPersistent.isChecked) {
|
binding.cardHora.isEnabled = !binding.chkPersistent.isChecked
|
||||||
binding.spinnerHour.isEnabled = false
|
binding.cardHora.alpha = if (binding.chkPersistent.isChecked) 0.5f else 1f
|
||||||
binding.spinnerMinute.isEnabled = false
|
|
||||||
} else {
|
|
||||||
binding.spinnerHour.isEnabled = true
|
|
||||||
binding.spinnerMinute.isEnabled = true
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
binding.chkPersistent.isEnabled = false
|
binding.chkPersistent.isEnabled = false
|
||||||
binding.spinnerHour.isEnabled = false
|
binding.cardHora.isEnabled = false
|
||||||
binding.spinnerMinute.isEnabled = false
|
binding.cardHora.alpha = 0.5f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp" android:height="24dp"
|
android:width="24dp" android:height="24dp"
|
||||||
android:viewportWidth="24" android:viewportHeight="24">
|
android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<!-- Reloj (SVG de Kevin, even-odd) -->
|
||||||
<path android:fillColor="#FFFFFFFF"
|
<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" />
|
android:fillType="evenOdd"
|
||||||
|
android:pathData="M12,2a10,10 0 1,0 0,20 10,10 0 0,0 0,-20zM11,6h2v5.586l3.207,3.207 -1.414,1.414L11,12.414V6z" />
|
||||||
</vector>
|
</vector>
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp" android:height="24dp"
|
android:width="24dp" android:height="24dp"
|
||||||
android:viewportWidth="24" android:viewportHeight="24">
|
android:viewportWidth="32" android:viewportHeight="32">
|
||||||
|
<!-- Globo (SVG de Kevin): círculo oscuro + meridianos blancos -->
|
||||||
|
<path android:fillColor="#FF252A35"
|
||||||
|
android:pathData="M16,2a14,14 0 1,0 0,28 14,14 0 1,0 0,-28z" />
|
||||||
<path android:fillColor="#FFFFFFFF"
|
<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" />
|
android:fillType="evenOdd"
|
||||||
|
android:pathData="M14.879,6.059C9.89,6.618 6,10.858 6,15.997 6,21.514 10.484,26 15.999,26S26,21.514 26,15.997c0,-5.065 -3.783,-9.251 -8.669,-9.906 0,0 -1.365,-0.181 -2.452,-0.032m0.455,1.352v3.367a18,18 0 0,1 -2.712,-0.295c0.127,-0.297 0.26,-0.583 0.405,-0.844 0.668,-1.203 1.474,-1.953 2.307,-2.228m1.428,0.056c0.075,0.012 0.151,0.02 0.226,0.034 0.752,0.33 1.475,1.044 2.082,2.138 0.143,0.256 0.273,0.537 0.398,0.828 -0.84,0.163 -1.752,0.27 -2.706,0.308zM11.37,12.027c-0.21,0.286 -0.411,0.585 -0.591,0.91 -0.208,0.373 -0.393,0.778 -0.564,1.2q-0.691,-0.203 -1.279,-0.457a8.7,8.7 0 0,1 2.434,-1.653m7.596,0.335c0.843,0.262 1.488,0.796 2.097,1.318q-0.549,0.238 -1.191,0.432c-0.168,-0.413 -0.35,-0.81 -0.552,-1.175a9,9 0 0,0 -0.353,-0.575zM9.031,10.714c0.015,0.054 -0.025,-0.072 -0.006,-0.017 0.515,0.24 1.128,0.624 1.732,0.805a16,16 0 0,0 -0.558,3.64H7.293a8.7,8.7 0 0,1 1.739,-4.428m13.946,0.012a8.7,8.7 0 0,1 1.728,4.416H21.9a16,16 0 0,0 -0.565,-3.665c0.57,-0.175 1.139,-0.508 1.629,-0.737 0.021,-0.05 -0.003,0.035 0.014,-0.014zM19.947,11.83c0.285,1 0.469,2.12 0.522,3.312h-3.707v-2.938a19,19 0 0,0 3.186,-0.374m-7.803,0.02c0.993,0.201 2.067,0.32 3.19,0.356v2.936h-3.706c0.053,-1.183 0.235,-2.296 0.516,-3.291M7.28,16.572h2.919c0.053,1.333 0.255,2.593 0.583,3.734 -0.642,0.084 -1.747,0.733 -1.804,0.765 -1.123,-1.37 -1.576,-2.617 -1.698,-4.5m4.349,0h3.706v3.037a19.3,19.3 0 0,0 -3.165,0.35 14.6,14.6 0 0,1 -0.541,-3.387m5.134,0h3.707a14.5,14.5 0 0,1 -0.547,3.408 19,19 0 0,0 -3.16,-0.369zM21.9,16.572h2.82c-0.112,1.73 -0.623,3.22 -1.593,4.53 -0.454,-0.287 -1.282,-0.586 -1.817,-0.77a16,16 0 0,0 0.59,-3.76m-6.565,4.465v3.266c-0.832,-0.276 -1.64,-1.023 -2.307,-2.226a9,9 0 0,1 -0.365,-0.752 18,18 0 0,1 2.672,-0.288m1.428,0.003c0.94,0.038 1.838,0.14 2.668,0.3a9,9 0 0,1 -0.36,0.737c-0.668,1.203 -1.475,1.95 -2.308,2.226zM11.25,21.658c0.161,0.39 0.334,0.766 0.526,1.112 0.273,0.492 0.584,0.937 0.924,1.334a8.7,8.7 0 0,1 -2.9,-1.92 11,11 0 0,1 1.45,-0.526m9.583,0.025c0.493,0.147 0.95,0.315 1.361,0.5a8.8,8.8 0 0,1 -2.744,1.86q0.479,-0.573 0.867,-1.273c0.188,-0.34 0.357,-0.707 0.516,-1.087" />
|
||||||
</vector>
|
</vector>
|
||||||
@@ -1,35 +1,127 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Selección de animes rediseñada (estilo Opciones): header con atrás + buscador +
|
||||||
|
lista de cards con check a la izquierda + botón todos/ninguno. -->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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">
|
||||||
|
|
||||||
<EditText
|
<!-- Header -->
|
||||||
android:id="@+id/txt_search"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="60dp"
|
||||||
android:layout_marginStart="12dp"
|
android:background="@color/bgCard"
|
||||||
android:layout_marginEnd="12dp"
|
android:gravity="center_vertical"
|
||||||
android:layout_marginTop="8dp"
|
android:orientation="horizontal"
|
||||||
android:layout_marginBottom="8dp"
|
android:paddingStart="8dp">
|
||||||
android:hint="Buscar anime..."
|
|
||||||
android:imeOptions="actionSearch"
|
|
||||||
android:inputType="text"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<Button
|
<ImageButton
|
||||||
android:id="@+id/btn_sel"
|
android:id="@+id/btn_back"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="48dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:layout_marginStart="12dp"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:layout_marginEnd="12dp"
|
android:contentDescription="@string/nav_inicio"
|
||||||
android:text="Seleccionar todos" />
|
app:srcCompat="@drawable/ic_chevron_left"
|
||||||
|
app:tint="@color/textPrimary" />
|
||||||
|
|
||||||
<ListView
|
<TextView
|
||||||
android:id="@+id/view_list"
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@string/opts_animes_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="1dp"
|
||||||
android:dividerHeight="8dp"
|
android:background="@color/borderColor" />
|
||||||
android:divider="#00000000" />
|
|
||||||
|
<!-- Contenido -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingTop="15dp">
|
||||||
|
|
||||||
|
<!-- Búsqueda -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:background="@drawable/bg_search"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingEnd="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_search"
|
||||||
|
app:tint="@color/colorTextMuted" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/txt_search"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="@string/buscar_animes"
|
||||||
|
android:imeOptions="actionSearch"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textColorHint="@color/colorTextMuted"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Lista de cards con check -->
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/view_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:divider="@null"
|
||||||
|
android:dividerHeight="8dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
|
<!-- Botón seleccionar/deseleccionar todos -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_sel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:background="@drawable/bg_accent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/seleccionar_todos"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Banner AdMob (AdView por código en loadBannerAd) sobre la barra inferior -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/adContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<!-- Barra de navegación inferior -->
|
||||||
|
<include
|
||||||
|
android:id="@+id/bottom_nav"
|
||||||
|
layout="@layout/view_bottom_nav" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -141,70 +141,52 @@
|
|||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Hora de la notificación -->
|
<!-- Hora de la notificación: TimePicker al pulsar, hora en gris -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/card_hora"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:background="@drawable/bg_card"
|
android:background="@drawable/bg_card"
|
||||||
android:orientation="vertical"
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:padding="16dp">
|
android:padding="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_clock"
|
||||||
|
app:tint="@color/accent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:layout_marginStart="14dp"
|
||||||
android:orientation="horizontal">
|
android:layout_weight="1"
|
||||||
|
android:text="@string/opts_hora_title"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:layout_width="24dp"
|
android:id="@+id/txt_hora"
|
||||||
android:layout_height="24dp"
|
android:layout_width="wrap_content"
|
||||||
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_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:text="8:00"
|
||||||
android:gravity="center_vertical"
|
android:textColor="@color/colorTextMuted"
|
||||||
android:orientation="horizontal">
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<Spinner
|
<ImageView
|
||||||
android:id="@+id/spinner_hour"
|
android:layout_width="18dp"
|
||||||
android:layout_width="0dp"
|
android:layout_height="18dp"
|
||||||
android:layout_height="48dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_weight="1"
|
android:contentDescription="@null"
|
||||||
android:background="@drawable/bg_card_strong"
|
android:src="@drawable/ic_chevron_right"
|
||||||
android:dropDownWidth="80dp" />
|
app:tint="@color/colorTextMuted" />
|
||||||
|
|
||||||
<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>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Animes seleccionados -->
|
<!-- Animes seleccionados -->
|
||||||
@@ -278,8 +260,7 @@
|
|||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:src="@drawable/ic_web"
|
android:src="@drawable/ic_web" />
|
||||||
app:tint="@color/accent" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Item de la selección de animes: card con checkbox a la izquierda -->
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/chk_anime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:buttonTint="@color/accent"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:minHeight="0dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="Anime"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
@@ -27,6 +27,9 @@
|
|||||||
<string name="opts_hora_title">Hora de la notificación</string>
|
<string name="opts_hora_title">Hora de la notificación</string>
|
||||||
<string name="opts_animes_title">Animes seleccionados</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_animes_desc">Elige de qué animes salen las frases</string>
|
||||||
|
<string name="buscar_animes">Buscar anime…</string>
|
||||||
|
<string name="seleccionar_todos">SELECCIONAR TODOS</string>
|
||||||
|
<string name="deseleccionar_todos">DESELECCIONAR TODOS</string>
|
||||||
<string name="opts_web_title">Visita jkanetwork.com</string>
|
<string name="opts_web_title">Visita jkanetwork.com</string>
|
||||||
<string name="opts_web_desc">Más apps y proyectos</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_title">Política de privacidad</string>
|
||||||
|
|||||||
Reference in new issue
Block a user