Repository navigation
feat: [SDK-5588] refresh the demo UI with a button grid, new dialogs and updated styles - #2860
fadi-george wants to merge 41 commits into
Conversation
Sections with two or more buttons use a shared ButtonGrid per sdk-shared styles.md: odd last button spans, hidden buttons reflow, labels scale down to fit on one line. Shortens ADD ALIASES / ADD TAGS / ADD TRIGGERS and the Triggers CLEAR ALL label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ith the keyboard All dialogs share a DemoDialog that sits below the safe area plus a 24dp inset and stays put when the keyboard opens, so Appium element frames stay accurate. Height is bounded and content scrolls on overflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the current user Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The External ID row already shows logged-in vs anonymous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ser fetch automatically The toggle only switched the demo's own REST lookup; identity verification is set per app in the dashboard. A logged-in user with a cached JWT is now fetched by external_id with a Bearer token, otherwise by onesignal_id. Updating the JWT refetches the user, and logout clears the cached token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er Id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… field Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One tag and one alias row exercise the rest of OneSignalUserProfile, including the foreign-alias failure. A half-filled row is not sent. The dialog now hands a single CompositeLoginRequest down instead of six positional arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lf filled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tional Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It navigates rather than calling the SDK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DemoLayout.scrollTopPadding was defined but never applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sections ending in buttons got 4dp more space below them than sections ending in a card, and card-to-button gaps were 12 instead of 8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Buttons 48 -> 40, section spacing 24 -> 16, and toggle rows drop Material's 48dp tap-target padding. Dialog inputs use a compact outlined field (~44 instead of the 56 minimum) with 12dp between fields, and dialog padding goes 24 -> 20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Material3's CenterAlignedTopAppBar in this BOM is fixed at 64dp, so the bar is a plain centered layout that keeps the status-bar insets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop Material's 48dp touch target so the controls align with the dialog content, and make each whole row tappable instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dialog window stops at the system bars, so a backdrop drawn inside it left them undimmed. The system dim at osBackdrop's 0.54 covers the whole display. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There is no identified user to refresh a token for until login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the top inset pads the page; the bottom inset sits at the end of the scroll content so the last item still scrolls clear of the bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… app Builds with their own ONESIGNAL_APP_ID (including Appium runs) no longer show a nudge to add one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isplay:" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Monospace made long IDs and notification titles wrap onto two lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each log entry is a single-line Text, so the default line-height trim dropped all of the extra height; turn the trim off so 1.5 applies. Seven entries now fill the log exactly. The LOGS header uses the same font as the entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ated:" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Section headers stay uppercase, so title case buttons read as buttons and match the dialog actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows lose their own vertical padding so the card padding sets the list edges. Dividers get 5 above and 1 below: the row above ends in descender space and the row below starts with ascender space, so equal padding read closer to the row above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📊 Diff Coverage Report✓ Coverage check passed (no source files changed) |
nan-li
left a comment
There was a problem hiding this comment.
Blocking note: I left 1 note on something that happens often in MainViewModel.loginUserWithProfile for Identity Verification apps. Everything else looks good or really minor.
Nit, there are some restated comments: ActionButton.kt:43 (restates ButtonStyle.colors and border), CardKvRow.kt:71 (restates copyable and EMPTY_VALUE).
| viewModelScope.launch(Dispatchers.IO) { | ||
| val result = | ||
| repository.loginUserWithProfile(externalUserId, email, sms, jwtToken, emailEnabled, smsEnabled) | ||
| val result = repository.loginUserWithProfile(request) |
There was a problem hiding this comment.
On Identity Verification apps, this hits a timing bug deterministically.
Unlike regular loginUser, OneSignal.login(externalId, profile, jwt) waits for the network call and fires onUserStateChange before this line returns. That means fetchUserDataFromApi() runs before lines 307 to 309 set _externalUserId and cache the new JWT.
On Identity Verification apps, this breaks deterministically:
- From anonymous, the fetch runs without a JWT and leaves the profile cards empty.
- On a user switch, the fetch loads the previous user and overwrites
_externalUserIdback to the old ID.
There was a problem hiding this comment.
Good catch, confirmed. Fixed in 0f8bcfb: the new external ID and JWT are cached before login, so the observer fetch signs as the new user. If the login fails without switching users, it restores the previous ones, and it refetches once login returns. Also removed the two restated comments.
OneSignal.login(externalId, profile, jwt) returns only after the user switch, so onUserStateChange fetched the user with the previous external ID and JWT. Cache the new identity first, restore it if the login fails without switching, and refetch once login returns. Also drop two comments that restated the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Description
One Line Summary
Refresh the Android demo app UI (button grid, reworked dialogs, new type and color system) to serve as the reference for the shared demo spec.
Details
Motivation
The demo apps across SDKs are being aligned on one spec (sdk-shared
demo/styles.mdanddemo/build.md, OneSignal/sdk-shared#76). This PR is the Android reference implementation that the spec was written against.Scope
Changes are limited to
examples/demo. No SDK code changes.Layout and components
Logs, tabular timestamps, 1.5 line spacing.assets/licenses).Theme.kt,#F7F7F7background. Unused colors and strings removed fromres/values.Dialogs and User section
addUserJwtInvalidatedListenerlogsJWT invalidated: {externalId}.Notif willDisplay:andNotif click:.Testing
Unit testing
None. Demo app UI only.
Manual testing
Built with
./gradlew :app:installGmsDebug -PSDK_VERSION=5.11.0fromOneSignalSDK/and checked on an Android 17 emulator: every section, the dialogs, copy buttons, log view and secondary screen. The Appium changes for the renamed logs and removed Status row are in OneSignal/sdk-shared#76.Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code