Files
Meshtastic-Android/core/ui
James Rich 81b5e03f27 fix: address review triage (F-1,2,5,7,13,14,16)
- migrate all remaining permission call sites (PrivacySection, NodeDetailScreens,
  TakPermissionUtil, ConnectionsScreen) to rememberXxxPermissionState(); delete the
  old rememberRequestXxx/isXxx wrappers — single source of truth, resolves the
  FINE-vs-FINE|COARSE location-grant conflict (F-5)
- add in-context Bluetooth + local-network requests with permanent-denial→settings
  recovery on the Connections scan toggles (F-1)
- pre-Android-12 Bluetooth state reports granted instead of delegating to location,
  fixing the intro Bluetooth-screen regression (F-2)
- null Activity no longer collapses to PERMANENTLY_DENIED (F-13)
- extract + test isPermissionGroupGranted (requireAll coarse-location logic) (F-7)
- make granular PermissionRecoveryCard overload internal (F-14)
- order PermissionStatus by lifecycle (F-16)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:04:42 -05:00
..

:core:ui

Overview

The :core:ui module contains shared Jetpack Compose components, themes, and utility functions used across the entire Meshtastic Android application. It ensures a consistent look and feel following Material 3 guidelines.

Key Components

1. Alert Dialogs (org.meshtastic.core.ui.component.AlertDialogs.kt)

  • MeshtasticDialog: The base dialog component for all alerts.
  • MeshtasticResourceDialog: Optimized for dialogs with resource-only content.
  • MeshtasticTextDialog: Optimized for dialogs with mixed resource and raw text content.

2. Common UI Elements

  • LastHeardInfo: Displays when a node was last seen.
  • TelemetryInfo: Displays battery, voltage, and other telemetry data.
  • TransportIcon: Shows the connection type (BLE, USB, TCP).
  • MainAppBar: The standard top app bar used in the app.

3. Preferences

Standardized Material 3 preference components for settings screens:

  • RegularPreference
  • SwitchPreference
  • DropDownPreference
  • SliderPreference
  • EditTextPreference

4. Utilities

  • ModifierExtensions.kt: Useful Compose Modifiers (e.g., conditional modifiers).
  • ProtoExtensions.kt: Extensions for mapping Protobuf models to UI-friendly strings or icons.

Usage

Most components are designed to be used with the Compose Multiplatform Resource library for strings.

import org.meshtastic.core.ui.component.MeshtasticResourceDialog
import org.meshtastic.core.resources.Res
import org.meshtastic.core.resources.ok

MeshtasticResourceDialog(
    title = Res.string.your_title,
    message = Res.string.your_message,
    onDismissRequest = { /* ... */ },
    confirmButtonText = Res.string.ok
)

Dependency Graph

graph TB
  :core:ui[ui]:::kmp-library-compose
  :core:ui -.-> :core:common
  :core:ui -.-> :core:data
  :core:ui -.-> :core:database
  :core:ui -.-> :core:datastore
  :core:ui -.-> :core:model
  :core:ui -.-> :core:navigation
  :core:ui -.-> :core:prefs
  :core:ui -.-> :core:repository
  :core:ui -.-> :core:resources
  :core:ui -.-> :core:service
  :core:ui -.-> :core:testing

classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;