Skip to content

feat(KMP-9): host the shared home screen on iOS with hand-rolled tab state#179

Open
js-jasinski wants to merge 9 commits into
matejdro:mainfrom
js-jasinski:feat/KMP-9-ios-home-screen
Open

feat(KMP-9): host the shared home screen on iOS with hand-rolled tab state#179
js-jasinski wants to merge 9 commits into
matejdro:mainfrom
js-jasinski:feat/KMP-9-ios-home-screen

Conversation

@js-jasinski

Copy link
Copy Markdown

The Problem

The iOS app only showed a placeholder screen, the shared home screen (tab bar + content) wasn't hosted on iOS yet.

Solution

  • make the iOS app show the shared HomeScreenContent (the 4-tab home screen)
  • drive tab selection with hand-rolled state in MainViewController (iOS has no navigation library)
  • app-ios now depends on home/ui, and home/ui exposes common-navigation as api so the shared Tab/SelectedTabContent are visible

Developer Notes

  • iOS tab content is a per-tab placeholder for now; the real screens come later
  • The shared home layer runs on iOS without pulling in libpebble3 (it stays in home/ui's Android source set, out of the iOS framework)
  • The tab snapshot in MainViewController (val tab = selectedTab) is intentional as it stops the cross-fade's outgoing pane from showing the new tab during the animation
Simulator Screenshot - iPhone 17 - 2026-06-17 at 11 33 58

…ugin

Introduces a `library-kmp-module` convention plugin in buildSrc so modules can
target Android and iOS with Compose Multiplatform. Uses the AGP
`com.android.kotlin.multiplatform.library` plugin (avoids the
kotlin.android <-> kotlin.multiplatform conflict) and gates iOS targets to macOS.
Converts common-navigation to a Kotlin Multiplatform module via the
library-kmp-module convention.
Converts home/ui to a Kotlin Multiplatform module. All existing code moves to the
Android source set unchanged, and the shared source set is left empty, so iOS
compiles with nothing in it yet.

- switch home/ui to the multiplatform module convention
- move all sources and resources into androidMain, with no code changes
- apply the Metro, KSP and serialization plugins directly
- run showkase and the navigation compiler through kspAndroid
- keep the Accompanist permissions opt-in on the Android source set only
- drop the unused parcelize plugin
Moves the home screen's content and its navigation bar/rail into the shared source
set so the home screen's visuals run on both Android and iOS.

- move HomeScreenContent and the nav bar/rail into commonMain
- make it data-driven over a list of tabs (tab + icon + label) so it no longer
  depends on Android resources
- build that tab list from Android resources in the Android HomeScreen wrapper
- keep the kotlinova screen wrapper, window-size check and previews on Android
- add Compose Multiplatform material3 and foundation to commonMain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant