Skip to content

Finish migration to Compose Multiplatform #7097

Description

@westnordost

This is blocked until the migration to maplibre-compose is merged (#7088 + #6352 => #6072).

What needs to be done

1. Migration from Activities → NavHost + ViewModels

  • In MainActivity any remains of communication between main map and main screen / edit history sidebar will be put into the main screen or view model. Likely, most of that will already be done in [WIP] Complete the MapLibre Compose migration #7088. Likely, the only remains in MainActivity will be:

    • including the composition in the main view (duh!). This should be just a few lines of code or so. Anything compose should end up in MainScreen. Consider splitting out parts of the MainScreen into sub-composables if the file gets too large.
    • passing on URIs passed in intents to the view model
    • respecting the prefs.keepScreenOn setting
  • theme and language changes in the settings should lead to an immediate switch of theme and language in the composition. This should be possible in pure compose, no need to do stuff anymore in the BaseActivity (which will be removed) or Application class

  • Replace SettingsActivity, AboutActivity, UserActivity with a MainNavHost. It must remain possible to deep-link into the auth page in the user screen and into the quest settings in the settings screen. The activities are removed from the app's manifest

    • Consider merging all NavHosts together into one hierarchical NavHost - is it good practice? Does it make things easier?
    • Finally, and optionally, consider migrating to Navigation 3. Again, does it make things easier and better readable?

2. Cleanup

  • androidApp themes.xml and the linked colors.xml can either be reduced to a minimum or removed altogether since no Material-theming in android remains

  • build.gradle.kts in app and in androidApp: most Android-specific dependencies from can be removed

  • remove the CopyStringsTask from buildSrc

  • remove unused classes and functions from app/src/androidMain/:

    • LocaleListCompatUtils not needed since CMP replacement androidx.compose.ui.text.intl.LocaleList exists
    • most remaining files from app/src/androidMain/de/westnordost/streetcomplete/util/ktx can be removed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedblocked by another issueiOSnecessary for iOS port

    Type

    No type

    Projects

    • Status
      Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions