From Views to Compose: Where can I start?
已有一个使用 View 构建的现有应用?了解如何采用增量方式进行迁移。
1. Migration Strategy
2. Adopt Compose in new features
New Feature in a New Screen
New Feature in an Existing Screen
3. Create a module of common UI components
buttons, app bars, chips, and so on.
dialogs, cards, and so on.
4. Incrementally migrate existing features one screen at a time
Rely on UI testing to prevent regressions.
5. Fragments
Once all the contents are in Compose.
Remove Fragments and replace them with a corresponding screen level composable.
Use Navigation Compose to navigate and pass data between these screen-level composables.