feat(gelderlander): open Midas Settings from the profile menu #51
Labels
No labels
area/architecture
area/build-ci
area/bytecode
area/code-quality
area/docs
area/extension
area/fingerprint
area/security
area/tests
Bug report
Feature request
review
sev/low
sev/medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
midas/midas-patches#51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #16. Depends on #49.
Feature description
Add a row Midas Settings to De Gelderlander's settings/profile menu ("Instellingen") that opens
MidasSettingsActivity(#49).Findings (9.21.1)
The menu is server-driven
op9calls@GET("v2/profile-menu")onhttps://mobileapi.gelderlander.nl/mobile. The repositoryqp9(anchor"com.kubusapp.profilemenu.repository.ProfileMenuRepositoryImpl$profileMenuData$1") only caches in memory.com.kubus.module.network.model:ProfileMenuResponse(List<ProfileMenuSection>), withgetSections();ProfileMenuSection(String title, List<ProfileMenuItem> items);ProfileMenuItem(String title, String subtitle, String url, boolean isLoginRequired, String destination, MenuItemIcon icons, TrackingInfo trackingInfo).title,destinationandtrackingInfomust be non-null;new TrackingInfo()is public.getSections()is ProfileMenuViewModel (com.kubusapp.profilemenu.b).Click path
com.kubusapp.profilemenu.ProfileMenuFragment.F0(mp9 destination, ProfileMenuItem item)ishandleClick. The anchor is the function-reference string"handleClick(Lcom/kubusapp/profilemenu/ProfileMenuItemDestination;Lcom/kubus/module/network/model/ProfileMenuItem;)V". It is the only method in the class with signature(L, ProfileMenuItem)V.mp9values: myAccount, myList, darkMode, pushNotifications, feedback, appInfo, privacy, termsAndConditions, colophon, url, unsupported.Approach
ProfileMenuResponse.getSections(), return a copy of the list with an extra section that holds one item: Use destination"url". Whether the Compose renderer (vp9.O, which doesn't decompile) showsunsupportedrows is unknown.ProfileMenuFragment.F0, ifp2.getUrl()equals the sentinel, start the Activity usingrequireContext()(name kept) andreturn-void. This also skips the app's tracking call.com.kubusapp.DeepLinkRouterActivityhandlesdg://gelderlander.nl/.... Intercept a path likedg://gelderlander.nl/midas-settingsin its forwarding methodQ(), and document it, for example as a home-screen shortcut.Risks
v2/profile-menufails, the screen shows its error state and the row is missing. The deep link covers that.nullicon differently from server rows. Check on the device, and use an existingMenuItemIconif needed.Done when
docs/apps/gelderlander.md.Done in
440a1a4(v1.6.0-dev.2, merged to main). Device-tested on De Gelderlander 9.21.1: the 'Midas' section with the Midas Settings row renders at the bottom of Instellingen (above Uitloggen), opens the screen, back returns; deep link dg://gelderlander.nl/midas-settings opens it too (fallback when the menu can't load offline).