Main: rediseño con header propio, tarjeta de frase, stats y sin fondo
Layout nuevo segun mockup SVG: header (titulo + menu popup de 3 puntos), piladora de fecha, tarjeta de frase con fav/compartir/anime, tarjetas de estadisticas EN ESTE ANIME y TOTAL VISTAS, controles prev/hoy/next y boton CAMBIAR FRASE accent. Sin ActionBar ni imagen de fondo; modo oscuro via values-night. applySystemBarsInsets parametrizado con color de navbar e iconos.
This commit is contained in:
1 parent
9b2a527cdb
commit
08070f203a
3 files changed
+274
-133
No files matched your search
@@ -49,30 +49,32 @@ fun restartActivity(act: AppCompatActivity){
|
|||||||
* Aplica insets de sistema como padding de [root] dejando el fondo a pantalla completa.
|
* Aplica insets de sistema como padding de [root] dejando el fondo a pantalla completa.
|
||||||
* Debe llamarse en onCreate tras setContentView; reemplaza al comportamiento pre-Android 15.
|
* Debe llamarse en onCreate tras setContentView; reemplaza al comportamiento pre-Android 15.
|
||||||
* Si la activity tiene ActionBar clásico (theme DarkActionBar) se suma su altura arriba.
|
* Si la activity tiene ActionBar clásico (theme DarkActionBar) se suma su altura arriba.
|
||||||
|
*
|
||||||
|
* Rediseño 2026-10: [navColor] fija el color de la barra de navegación (por defecto
|
||||||
|
* colorPrimary, para pantallas con ActionBar); [darkNavbar]/[lightStatusIcons] ajustan
|
||||||
|
* el color de los iconos del sistema (la main usa fondos claros y modo oscuro real).
|
||||||
*/
|
*/
|
||||||
fun AppCompatActivity.applySystemBarsInsets(root: View) {
|
fun AppCompatActivity.applySystemBarsInsets(root: View, navColor: Int? = null, darkNavbar: Boolean = true, lightStatusIcons: Boolean = true) {
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
/* Iconos del sistema: oscuros arriba (fondo claro de la app bajo la status bar),
|
/* Iconos del sistema según el fondo que quede bajo cada barra. */
|
||||||
claros abajo (la franja que pintamos es colorPrimary). */
|
|
||||||
WindowInsetsControllerCompat(window, root).apply {
|
WindowInsetsControllerCompat(window, root).apply {
|
||||||
isAppearanceLightStatusBars = true
|
isAppearanceLightStatusBars = lightStatusIcons
|
||||||
isAppearanceLightNavigationBars = false
|
isAppearanceLightNavigationBars = !darkNavbar
|
||||||
}
|
}
|
||||||
/* Barra de navegación del mismo color que el top bar (colorPrimary):
|
/* Barra de navegación: Android < 15 usa window.navigationBarColor; Android 15+
|
||||||
- Android < 15: se fija por window.navigationBarColor.
|
la ignora (hereda el fondo de la ventana), pero en la navbar de 3 botones aplica
|
||||||
- Android 15+ lo ignora (la barra hereda el fondo de la ventana), pero en la
|
un scrim de contraste ~60% que oscurece el color: isNavigationBarContrastEnforced
|
||||||
navbar de 3 botones aplica un scrim de contraste ~60% que oscurece el color
|
(API 29+) lo quita. La franja del decor cubre el modo gestos en 15+. */
|
||||||
(colorPrimary #28343a se ve como #10151a): isNavigationBarContrastEnforced
|
val nav = navColor ?: colorPrimary(this)
|
||||||
(API 29+) lo quita y deja el color exacto también en modo 3 botones. */
|
window.navigationBarColor = nav
|
||||||
window.navigationBarColor = colorPrimary(this)
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
window.isNavigationBarContrastEnforced = false
|
window.isNavigationBarContrastEnforced = false
|
||||||
}
|
}
|
||||||
/* Android 15+ ignora navigationBarColor y la barra de gestos hereda el fondo de la
|
/* Android 15+ ignora navigationBarColor y la barra de gestos hereda el fondo de la
|
||||||
ventana: pintamos una franja colorPrimary al fondo del decor, bajo la barra.
|
ventana: pintamos una franja del color al fondo del decor, bajo la barra.
|
||||||
Su altura se fija con el inset real en el listener de abajo. */
|
Su altura se fija con el inset real en el listener de abajo. */
|
||||||
val navBackdrop = View(this).apply {
|
val navBackdrop = View(this).apply {
|
||||||
setBackgroundColor(colorPrimary(this@applySystemBarsInsets))
|
setBackgroundColor(nav)
|
||||||
isClickable = false
|
isClickable = false
|
||||||
}
|
}
|
||||||
(window.decorView as ViewGroup).addView(navBackdrop,
|
(window.decorView as ViewGroup).addView(navBackdrop,
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ 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.Menu
|
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import java.util.Calendar
|
|
||||||
import java.text.DateFormatSymbols
|
|
||||||
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.content.res.Configuration
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.text.DateFormatSymbols
|
||||||
|
|
||||||
/* Permisos runtime (POST_NOTIFICATIONS en Android 13+) */
|
/* Permisos runtime (POST_NOTIFICATIONS en Android 13+) */
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
@@ -67,7 +69,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
applySystemBarsInsets(binding.root)
|
|
||||||
|
/* Rediseño 2026-10: header propio (título + menú), sin ActionBar. El color
|
||||||
|
de la status bar / navbar acompaña al header (bgCard resuelve tema claro/oscuro). */
|
||||||
|
supportActionBar?.hide()
|
||||||
|
val isDark = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES
|
||||||
|
applySystemBarsInsets(binding.root, navColor = ContextCompat.getColor(this, R.color.bgCard),
|
||||||
|
darkNavbar = isDark, lightStatusIcons = !isDark)
|
||||||
|
|
||||||
/* "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. */
|
||||||
@@ -123,6 +131,14 @@ 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)
|
||||||
@@ -329,6 +345,16 @@ class MainActivity : AppCompatActivity() {
|
|||||||
binding.txtAnime.setText(db.getAnimeFromIDF(IDFraseS))
|
binding.txtAnime.setText(db.getAnimeFromIDF(IDFraseS))
|
||||||
//txt_date.setText("Frase de hoy")
|
//txt_date.setText("Frase de hoy")
|
||||||
binding.txtDate.setText("Frase del $dayS de ${getMonth(monthS)}")
|
binding.txtDate.setText("Frase del $dayS de ${getMonth(monthS)}")
|
||||||
|
/* Estadísticas (rediseño): progreso del anime actual y total de los seleccionados */
|
||||||
|
val idAnime = db.getIDAnimeFromIDF(IDFraseS)
|
||||||
|
if (idAnime > 0) {
|
||||||
|
val (seenA, totalA) = db.getAnimeFrasesStats(idAnime)
|
||||||
|
binding.statAnimeValue.text = "$seenA / $totalA ${getString(R.string.stat_frases)}"
|
||||||
|
} else {
|
||||||
|
binding.statAnimeValue.text = "—"
|
||||||
|
}
|
||||||
|
val (seenT, totalT) = db.getSeenStatsSelected()
|
||||||
|
binding.statTotalValue.text = "$seenT / $totalT ${getString(R.string.stat_frases)}"
|
||||||
/* Set fav icon */
|
/* Set fav icon */
|
||||||
if (db.getFav(IDFraseS)) {
|
if (db.getFav(IDFraseS)) {
|
||||||
binding.btnFav.setBackgroundResource(R.drawable.star_on);
|
binding.btnFav.setBackgroundResource(R.drawable.star_on);
|
||||||
@@ -339,17 +365,17 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
/** Maneja las opciones del menú del header (Animes/Diario/Favoritos/...) */
|
||||||
menuInflater.inflate(R.menu.main, menu)
|
private fun onMenuItem(item: MenuItem): Boolean{
|
||||||
return super.onCreateOptionsMenu(menu)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean{
|
|
||||||
when (item.getItemId()) {
|
when (item.getItemId()) {
|
||||||
R.id.favs -> {
|
R.id.favs -> {
|
||||||
startActivity<FavsActivity>()
|
startActivity<FavsActivity>()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
R.id.diario -> {
|
||||||
|
startActivity<DiaryActivity>()
|
||||||
|
return true
|
||||||
|
}
|
||||||
R.id.anime -> {
|
R.id.anime -> {
|
||||||
startActivity<AnimesSelActivity>()
|
startActivity<AnimesSelActivity>()
|
||||||
return true
|
return true
|
||||||
@@ -364,10 +390,10 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
R.id.exit -> {
|
R.id.exit -> {
|
||||||
moveTaskToBack(true) /* Returns to "desktop" */
|
moveTaskToBack(true) /* Returns to "desktop" */
|
||||||
return super.onOptionsItemSelected(item)
|
return true
|
||||||
}
|
}
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,168 +1,281 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Rediseño 2026-10 (mockup SVG): header propio con menú + píldora de fecha +
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
tarjeta de frase + estadísticas + controles de navegación. Sin ActionBar
|
||||||
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
(ocultada en código) y sin imagen de fondo. Banner al final, sin solape. -->
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/principal">
|
android:background="@color/bgMain"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- ============ HEADER (título + menú) ============ -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/bgCard"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/borderColor" />
|
||||||
|
|
||||||
|
<!-- ============ CONTENIDO ============ -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingTop="20dp">
|
||||||
|
|
||||||
|
<!-- Píldora de fecha -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_date"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:background="@drawable/bg_pill"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Fecha"
|
||||||
|
android:textColor="@color/colorTextSecondary"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<!-- Tarjeta principal: frase + divisor + favorito/compartir/anime -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="12dp"
|
android:layout_marginTop="14dp"
|
||||||
android:orientation="vertical">
|
android:background="@drawable/bg_card"
|
||||||
|
android:minHeight="230dp"
|
||||||
<LinearLayout
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:padding="16dp">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txt_date"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="44dp"
|
|
||||||
android:layout_marginLeft="4dp"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/colorPrimaryLight"
|
|
||||||
android:paddingTop="6dp"
|
|
||||||
android:text="Fecha"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="22sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="#aaffffff"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/Sep_1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="2dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@android:color/black"
|
|
||||||
android:scaleType="fitXY" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_sentence"
|
android:id="@+id/txt_sentence"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="110dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="18dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fadeScrollbars="true"
|
android:fadeScrollbars="true"
|
||||||
android:padding="2dp"
|
android:gravity="center"
|
||||||
|
android:minHeight="140dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
android:scrollbarStyle="insideOverlay"
|
android:scrollbarStyle="insideOverlay"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
android:text="Aquí la frase, no?"
|
android:text="Aquí la frase"
|
||||||
android:textAlignment="center"
|
android:textColor="@color/textPrimary"
|
||||||
android:textColor="@android:color/black"
|
android:textSize="16sp"
|
||||||
android:textSize="20sp"
|
|
||||||
tools:text="Si la frase es muy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, saldrá una scrollbar." />
|
tools:text="Si la frase es muy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, muy larga, muuuy larga, saldrá una scrollbar." />
|
||||||
|
|
||||||
<ImageView
|
<View
|
||||||
android:id="@+id/Sep_2"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="1dp"
|
||||||
android:layout_height="2dp"
|
android:layout_marginTop="14dp"
|
||||||
android:layout_marginTop="18dp"
|
android:background="@color/borderColor" />
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@android:color/black"
|
|
||||||
android:scaleType="fitXY" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="58dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="26dp"
|
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btn_fav"
|
android:id="@+id/btn_fav"
|
||||||
android:layout_width="36dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="12dp"
|
android:background="@drawable/star_off"
|
||||||
android:layout_marginTop="12dp"
|
android:contentDescription="Favorito"
|
||||||
android:background="@drawable/star_on"
|
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btn_share"
|
android:id="@+id/btn_share"
|
||||||
android:layout_width="58dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="58dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="12dp"
|
||||||
android:background="@null"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:paddingTop="2dp"
|
android:contentDescription="Compartir"
|
||||||
app:srcCompat="@android:drawable/ic_menu_share" />
|
android:scaleType="centerInside"
|
||||||
|
app:srcCompat="@android:drawable/ic_menu_share"
|
||||||
|
app:tint="@color/colorTextSecondary" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_anime"
|
android:id="@+id/txt_anime"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="12dp"
|
android:layout_weight="1"
|
||||||
android:paddingTop="20dp"
|
android:gravity="end"
|
||||||
|
android:paddingStart="12dp"
|
||||||
android:text="Texto Anime"
|
android:text="Texto Anime"
|
||||||
android:textAlignment="center"
|
android:textColor="@color/textPrimary"
|
||||||
android:textColor="@android:color/black"
|
android:textSize="16sp"
|
||||||
android:textSize="18sp" />
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Estadísticas: EN ESTE ANIME / TOTAL VISTAS -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/stat_this_anime"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/stat_anime_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="—"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="14dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/stat_total"
|
||||||
|
android:textColor="@color/colorTextMuted"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/stat_total_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="—"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Controles: anterior / hoy / siguiente -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btn_prev"
|
android:id="@+id/btn_prev"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_card_strong"
|
||||||
|
android:contentDescription="Día anterior"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
app:srcCompat="@drawable/ic_chevron_left" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btn_today"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_weight="1.2"
|
||||||
|
android:background="@drawable/bg_card_strong"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_calendar"
|
||||||
|
app:tint="@color/textPrimary" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_marginStart="6dp"
|
||||||
app:srcCompat="@android:drawable/ic_media_previous" />
|
android:text="@string/btn_today"
|
||||||
|
android:textColor="@color/textPrimary"
|
||||||
<ImageButton
|
android:textSize="13sp"
|
||||||
android:id="@+id/btn_today"
|
android:textStyle="bold" />
|
||||||
android:layout_width="28dp"
|
</LinearLayout>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
app:srcCompat="@android:drawable/ic_dialog_dialer" />
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btn_next"
|
android:id="@+id/btn_next"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:srcCompat="@android:drawable/ic_media_next" />
|
android:background="@drawable/bg_card_strong"
|
||||||
|
android:contentDescription="Día siguiente"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
app:srcCompat="@drawable/ic_chevron_right" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<!-- Botón principal -->
|
||||||
|
<TextView
|
||||||
android:id="@+id/btn_change"
|
android:id="@+id/btn_change"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:layout_weight="1"
|
android:layout_marginTop="10dp"
|
||||||
android:text="Cambiar Frase" />
|
android:background="@drawable/bg_accent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/btn_change"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Contenedor del banner: el AdView se crea por código (loadBannerAd) con tamaño
|
<!-- Banner (AdView por código en loadBannerAd) -->
|
||||||
adaptativo; si fuera un <AdView> del XML sin ads:adSize, el SDK loguea
|
|
||||||
"Required XML attribute adSize was missing" y fija el suyo propio. -->
|
|
||||||
<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" />
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_centerHorizontal="true" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</LinearLayout>
|
||||||
Reference in new issue
Block a user