Menu

One Kotlin core for every screen: what is shared and what is not
📰

One Kotlin core for every screen: what is shared and what is not

DEV Community: kotlin·Yonto Player·4 days ago
#ygOjyYCw
#devtokotlin#devto#dev#plugin#android
Reading 0:00
15s threshold

Yonto Player is a media player for your own library, and everything below its screens is one Kotlin Multiplatform module, :core . The apps shipping today are Android TV, phones and tablets, and all of them build on it, along with the test suites. The core is built so that Apple devices can share it too; the Apple versions are not out yet.

This post is about where I draw the lines inside that module: what goes in common code, what gets an expect / actual , what is not allowed in common at all, and what the whole arrangement costs.

What the core holds

:core is the domain. It holds the content models, the ContentSourceAdapter interface every source implements, the plugin runtime, the stores, and the playback and download state. It does not import Compose.

Above it there are two more shared modules. :app:model holds the view models and UI state, with no Compose, so a non-Compose UI can sit on it. :app:common holds the plain composables and the strings.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.