Embroidery patterns are the heart of the Bordado section. Each pattern defines a grid of colored cells that customers can fill in progressively. Admins upload new patterns, control which ones are visible to users, and remove outdated ones — all from the Admin tab in Cuenta. Patterns are stored in Firebase Realtime Database under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/La-casa-del-bordadito/llms.txt
Use this file to discover all available pages before exploring further.
patrones node.
Data models
matriz— a 2-D array of integers with dimensionsfilas × columnas. Each integer is a color ID that maps to an entry inpaleta.0means the cell is transparent/empty (uncolored background).paleta— the list ofColorPatronobjects that assigns a hex color code and a display name to each numeric ID used inmatriz.porcentaje— tracks the user’s completion percentage; it starts at0when uploaded.activo— controls whether the pattern is visible in the Bordado section.
Uploading a new pattern
Prepare the JSON
Create a JSON representation of a
PatronBordado object. The id field must be a unique string — it becomes the Realtime DB key for the node. Set activo to false initially so the pattern is not shown to customers until you are ready.Open the upload dialog
In the Admin tab, tap the Agregar Bordado button. A dialog titled “Nuevo Patrón de Bordado” appears with a multiline text field labelled “Pega el código JSON aquí”.
Paste and submit
Paste the full JSON into the text field and tap Subir. The app parses the JSON with Gson, forces If the JSON is malformed, a “JSON Inválido” toast appears and nothing is written to the database. On success, a confirmation toast shows “¡Patrón <nombre> subido!”.
activo = false, and writes the object to patrones/{patron.id} in Realtime Database:Sample pattern JSON
The following is a minimal 3×3 pattern to illustrate the structure:1 (red) forms a cross shape and color 2 (green) marks the center. Cells with 0 are transparent.
Toggling pattern visibility
Each row in the admin patterns list has a toggle button. Tapping it inverts theactivo flag in Realtime Database:
activo = true— the pattern appears in the Bordado section for all customers.activo = false— the pattern is hidden but remains in the database; no user progress is lost.
Deleting a pattern
Tap the delete icon on a pattern row. A confirmation dialog appears:“¿Estás seguro de que deseas eliminar el patrón “Flor Pequeña”? Esta acción no se puede deshacer.”Confirming calls
removeValue() on the pattern’s Realtime DB node:
Pagination
The admin patterns list shows 5 patterns per page. The ← / → buttons and the “Página X de Y” label work identically to the café menu pagination. The list is backed by aValueEventListener on the patrones node, so new uploads and deletions appear instantly without a manual refresh.