AzNavRail

AzNavRail API Reference (v7.25: The Live Dictatorship)

This document serves as the technical reference for the AzNavRail library. Version 7.25 introduces Dynamic Reactive Binding, allowing the annotation-driven architecture to react to runtime state changes in the host Activity.


1. High-Inference API (@Az)

The primary interface for the library is the @Az annotation. In v7.25, annotations now support *Property strings which bind directly to properties in your AzActivity (ideally mutableStateOf).

com.hereliesaz.aznavrail.annotation.Az

Target: FUNCTION, CLASS, PROPERTY

Parameter Type Description
app App Configuration for the MainActivity (Global State).
advanced Advanced Binds system overlays and loading states.
rail RailItem Defines a navigation destination or action.
menu MenuItem Defines an item visible only in the expanded footer menu.
host RailHost Defines a parent item that expands inline.
nested NestedRail Defines a popup menu structure.
toggle Toggle Defines a state toggle button.
cycler Cycler Defines a multi-option cycle button.
reloc RelocItem Defines a draggable, reorderable item with hidden menus.
background Background Plunges content beneath the safe zones based on weight.
divider Divider Injects visual silence into the list.

Context Classes & Reactive Bindings

All items now support the following Reactive Binding Fields. Provide the name of a property in your Activity as a String.

RailItem / MenuItem / NestedRail / RelocItem

Toggle

Cycler

Advanced (Class Level)

App (Class Level)


2. The Configuration Duality (Scope API)

When extending AzActivity, you may optionally override AzNavRailScope.configureRail() to inject dynamic parameters.

azConfig

Controls behavioral and geometrical mechanics.

fun azConfig(
    dockingSide: AzDockingSide = AzDockingSide.LEFT,
    packButtons: Boolean = false,
    noMenu: Boolean = false,
    vibrate: Boolean = false,
    displayAppName: Boolean = false,
    activeClassifiers: Set<String> = emptySet(),
    usePhysicalDocking: Boolean = false,
    expandedWidth: Dp = 130.dp,
    collapsedWidth: Dp = 80.dp,
    showFooter: Boolean = true
)

3. UI Components

Standalone components designed to be used inside your @Composable screens.

AzTextBox

A high-ground text input field with support for autocomplete, password masking, multiline text, and pre-filled initial values.

AzForm

A form builder component for managing and grouping multiple AzTextBox fields together. Form entries now strictly enforce and securely support initial pre-filled values (initialValue) across platform variants.

AzToggle

A standalone toggle switch matching the rail’s aesthetic.

AzButton

A circular or shaped button that automatically resizes text to fit.


4. Low-Level API (Manual)

AzActivity

The base class for your Activity.

AzGraph (Generated)

The KSP processor generates this object. It casts the activity to your specific instance type to access the bound properties, ensuring Recomposition occurs whenever your mutableStateOf properties change.


5. Tutorial Framework API

The tutorial framework allows programmatic control over scripted interactive scenes and highlights.

AzTutorialController

A controller for managing tutorial states, allowing external systems to initiate, end, and track read status for tutorials. It is accessible anywhere within the AzNavHost tree via a CompositionLocal.

Accessing the Controller:

val tutorialController = LocalAzTutorialController.current

Methods & Properties: