Skip to main content

Documentation 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.

The Cuenta tab is the central place for managing your personal information inside La Casa del Bordadito. From here you can view your account details, update your profile, change your photo, and sign out. All data is stored under Usuarios/{uid} in the Firebase Realtime Database and is reflected in real time wherever your name or photo appears in the app.

Profile fields

EditarPerfil exposes four editable fields:
FieldDB keyNotes
Full namenombresRequired — cannot be saved empty
Date of birthfecha_nacRequired — cannot be saved empty; free-text, displayed in the profile tab
Country codecodigoTelefonoRequired — selected via CountryCodePicker; stored as +52, +1, etc.
Phone numbertelefonoRequired — digits only, without the dial code
On save, EditarPerfil.actualizarInfo() calls updateChildren(hashMap) on the Usuarios/{uid} reference so only the four fields above are overwritten — other profile data (email, provider, timestamps) remains untouched.

Changing your profile photo

1

Open the photo picker

In EditarPerfil, tap the floating action button (FABCambiarImg) overlaid on the profile image. A popup menu appears with two options: Cámara and Galería.
2

Grant permissions

  • Camera: the app requests CAMERA (and WRITE_EXTERNAL_STORAGE on Android < 13).
  • Gallery: the app requests WRITE_EXTERNAL_STORAGE on Android < 13; no extra permission is needed on Android 13+.
3

Upload to Firebase Storage

After the image is captured or selected, subirImagenStorage() uploads the file to the path imagenesPerfil/{uid} in Firebase Storage. The storage reference is obtained via:
val rutaImagen = "imagenesPerfil/" + firebaseAuth.uid
val storageReference = FirebaseStorage.getInstance().getReference(rutaImagen)
storageReference.putFile(imageUri!!)
4

Update the database URL

Once the upload succeeds, actualizarImagenBD(urlImagenCargada) writes the download URL to Usuarios/{uid}/urlImagenPerfil. The profile image view refreshes automatically via the ValueEventListener already attached to that node.

Avatar fallback

When urlImagenPerfil is empty or "null", the app generates a deterministic avatar using the multiavatar library instead of showing a blank placeholder. AvatarGenerator.generateAvatarByUid() calls AvatarData.generateWithSha256(uid) (which internally SHA-256-hashes the UID to produce a consistent seed), renders the result as an SVG with MultiAvatar.getAvatarSvgBytes(avatarData), and loads the bytes into the ImageView using Coil with SvgDecoder:
fun generateAvatarByUid(context: Context, imageView: ImageView, uid: String) {
    val result = AvatarData.generateWithSha256(uid)

    result.onSuccess { avatarData ->
        renderAvatar(context, imageView, avatarData)
    }

    result.onFailure { error ->
        generateRandomAvatar(context, imageView)
    }
}
The avatar is unique per UID and consistent across app restarts — two devices logged in to the same account always show the same generated image.

Phone number with international dial code

The country code picker is powered by the CountryCodePicker (CCP) library. The selected country code (e.g. +52 for Mexico) is read at save time with:
codigo = binding.selectorCod.selectedCountryCodeWithPlus
Both values are stored separately (codigoTelefono and telefono) so they can be displayed concatenated in the profile view (TvTelefono.text = codTelefono + telefono).

What the Cuenta tab displays

FragmentCuenta.leerInfoUsuario() attaches a ValueEventListener to Usuarios/{uid} and populates the profile tab in real time:

Email

The account email address. Read-only — it cannot be changed from inside the app.

Name

The nombres field. Tap Editar Perfil to change it.

Date of birth

The fecha_nac field set in EditarPerfil.

Phone

Displayed as codigoTelefono + telefono, e.g. +526621398836.

Member since

Formatted from the tiempo timestamp using Constantes.obtenerFecha(tiempo)dd/MM/yyyy.

Account status

"Verificado" for Google accounts and verified email accounts; "No verificado" for unverified email accounts.

Signing out

The Cerrar Sesión button in the profile tab executes the following sequence:
binding.layoutPerfil.BtnCerrarSesion.setOnClickListener {
    com.example.applacasadelbordadito.ApplicationClass.actualizarEstadoOnline(false)
    firebaseAuth.signOut()
    startActivity(Intent(requireContext(), OpcionesLogin::class.java))
    activity?.finishAffinity()
}
  1. Sets Usuarios/{uid}/online to false in Realtime Database.
  2. Clears the Firebase Auth session.
  3. Navigates to OpcionesLogin and removes the entire back-stack.
Use a square image when updating your profile photo. The photo is displayed in a circular crop throughout the app — a square source image ensures your face or subject is not cut off at the sides. Landscape photos may lose the left and right edges.

Build docs developers (and LLMs) love