CXR-L(EN)
CXR-L(EN)
IntroductionQuick StartDevelopment Flow & State-MachineTerms and Abbreviations
Feature Development
Version HistoryAndroid
iOS
cxr-l-sdk · v1.0.1 · snapshot 2026-05-13· ↗ source
Glasses Custom View
iOS: Glasses-side Custom View
Scenario
Describe the layout via JSON and deliver icon resources, then open, update, and close the Custom View UI on the glasses.
Prerequisites
- Authentication and connection are completed (see “Connection and Session”).
- Encoded icon data and layout JSON are prepared (field names must match the protocol).
Key APIs (by name)
The following names follow RGCxrClient’s public Swift APIs. If Xcode autocomplete shows slight differences, follow the headers:
sendCustomViewIcons(_:): upload icons (encoded as JSON / struct array).openCustomView(_:): open the full tree for the first time.updateCustomView(_:): incremental updates.closeCustomView(): close.customViewRunningEventPublisher: observe runtime state and drive phone-side UI hints.
Recommended order
- Build a list of
IconData(or equivalent type) → callsendCustomViewIcons. - Call
openCustomViewto send root and child nodes. - For partial changes, call
updateCustomViewwith only the changed node ids and props. - When done, call
closeCustomView.
Development suggestions
- Keep icon
nameconsistent between the icon list and layout JSON references. - Prefer incremental updates to reduce bandwidth and flicker.
- Use
customViewRunningEventPublisherto determine whether it is safe toopenagain. - After scene building is complete (the view is running on the glasses), enable Audio and Photo entries under the same session (aligned with “Connection and Session”).
Sample entry points (typical)
| Action | Common demo method name |
|---|---|
| Send icons | sendCustomIcons |
| Open/update/close | openCustomViewTapped / updateCustomViewTapped / closeCustomViewTapped |
| Data structures | CustomViewItems.swift, etc. |
Please follow the actual symbol names in the ios_cxr_l_sample repo.