01
Dev.to Kotlin
作者:Sajid Ali
發布:09-05 07:43
My Journey Making Compose Multiplatform Work on tvOS, and What I Learned
This series is about how that requirement ended with me maintaining a fork of Compose Multiplatform with tvOS support, and what I learned along the way.
重點摘要
Skiko already supported tvOS, making the port feasible.
The work required changes in both the Gradle plugin and Compose runtime.
The hardest problems were input handling, focus, and ongoing upstream maintenance.
This high-level overview explains how an Android and Android TV developer at Devolic ended up maintaining a fork of Compose Multiplatform with tvOS support. The team first moved from Android Views to Jetpack Compose, then added desktop, iOS and tvOS to the roadmap. Native SwiftUI on tvOS was rejected because focus handling could not match Android TV behavior. After confirming that tvOS is close enough to iOS and that Skiko already had tvOS targets, the author enabled tvOS in the Gradle plugin and runtime, then ported modules in dependency order. The largest effort was compose:ui:ui, especially rendering, Siri Remote input, focus, density and text input. The article closes with lessons on dependency-first checks, sharing code between iOS and tvOS, and expecting frequent upstream rebases.
我如何让 Compose Multiplatform 在 tvOS 上运行,以及从中学到什么
这个系列讲的是,这一需求最终如何让我维护一个支持 tvOS 的 Compose Multiplatform 分支,以及我一路学到的经验。
重點摘要
Skiko 已支持 tvOS,使移植变得可行。
需要同时修改 Gradle 插件和 Compose runtime。
最难的是输入、焦点处理以及持续跟进上游变更。
这篇概览文章讲述了一名拥有十年 Android 和 Android TV 经验的开发者,如何因为流媒体应用需要覆盖多平台,而开始维护一个支持 tvOS 的 Compose Multiplatform 分支。团队先从 Android Views 迁移到 Jetpack Compose,随后把 desktop、iOS 和 tvOS 纳入路线图,但在 tvOS 上尝试原生 SwiftUI 后,因焦点管理无法达到 Android TV 的行为而放弃。确认 tvOS 与 iOS 架构相近、且 Skiko 已提供 tvOS 目标后,作者先修改 Gradle 插件和 runtime,再按依赖顺序逐步移植模块。工作量最大的部分是 compose:ui:ui,涉及渲染、Siri Remote 输入、焦点、屏幕密度和文本输入。
我如何讓 Compose Multiplatform 在 tvOS 上運作,以及一路學到的事
這個系列講的是,這項需求最後如何讓我維護一個支援 tvOS 的 Compose Multiplatform 分支,以及我在過程中的收穫。
重點摘要
Skiko 已支援 tvOS,讓移植具備可行性。
需要同時修改 Gradle 外掛與 Compose runtime。
最難的是輸入、焦點處理與持續跟進上游變更。
這篇總覽文章說明,一位有十年 Android 與 Android TV 經驗的開發者,如何因為串流 App 需要支援多平台,而開始維護一個帶有 tvOS 支援的 Compose Multiplatform fork。團隊先從 Android Views 轉到 Jetpack Compose,再把 desktop、iOS 與 tvOS 納入規劃,但在 tvOS 上採用 SwiftUI 後,因焦點管理無法達到 Android TV 的行為而作罷。確認 tvOS 與 iOS 架構相近、且 Skiko 已有 tvOS 目標後,作者先改 Gradle 外掛與 runtime,再依賴關係順序逐步移植模組。最費工的是 compose:ui:ui,涵蓋渲染、Siri Remote 輸入、焦點、密度與文字輸入。