Conversation
c476e56 to
18d14ff
Compare
This comment was marked as resolved.
This comment was marked as resolved.
145ffd7 to
dd12df8
Compare
e0566a2 to
a980d12
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the app’s multi-activity screen flow to a single-activity architecture using AndroidX Navigation 3 (NavKey + EntryProvider), routing internal screens via explicit Intent actions handled by MainActivity.
Changes:
- Introduces Navigation 3 route graphs (
*Nav.kt) and a sharedMihomoNavDisplaywrapper for transitions and entry decorators. - Consolidates entry points (notifications, external control, crash flows) to launch
MainActivitywithIntents.ACTION_*instead of dedicated activities. - Removes legacy Activities/intent helpers that are no longer needed after the navigation migration.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| service/src/main/kotlin/com/github/kr328/clash/service/ProfileWorker.kt | Routes notification tap to MainActivity using ACTION_PROPERTIES + UUID. |
| gradle/libs.versions.toml | Adds Navigation 3 + lifecycle navigation3 artifacts; bumps lifecycle version. |
| common/src/main/kotlin/com/github/kr328/clash/common/util/Intent.kt | Removes Intent.fileName/setFileName helpers; keeps UUID routing helpers. |
| common/src/main/kotlin/com/github/kr328/clash/common/store/Lazy.kt | Adds unsafeLazy() helper used by the new MainActivity. |
| common/src/main/kotlin/com/github/kr328/clash/common/constants/Intents.kt | Adds route action constants (ACTION_PROPERTIES, ACTION_LOGCAT, etc.). |
| common/src/main/kotlin/com/github/kr328/clash/common/constants/Components.kt | Removes PROPERTIES_ACTIVITY component; keeps MAIN_ACTIVITY. |
| app/src/main/kotlin/com/github/kr328/clash/ui/BaseActivity.kt | Removes legacy base activity (edge-to-edge + exclude-from-recents behavior moved). |
| app/src/main/kotlin/com/github/kr328/clash/settings/ui/SettingsScreen.kt | Reworks settings root callbacks to explicit “open screen” lambdas. |
| app/src/main/kotlin/com/github/kr328/clash/settings/SettingsNav.kt | Adds Navigation 3 settings nested back stack and entries. |
| app/src/main/kotlin/com/github/kr328/clash/settings/SettingsActivity.kt | Removes standalone Settings activity (now navigated within MainActivity). |
| app/src/main/kotlin/com/github/kr328/clash/settings/OverrideSettingsActivity.kt | Removes standalone activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/settings/NetworkSettingsActivity.kt | Removes standalone activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/settings/MetaFeatureSettingsActivity.kt | Removes standalone activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/settings/AppSettingsActivity.kt | Removes standalone activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/settings/AccessControlActivity.kt | Removes standalone activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/remote/Remote.kt | Routes crash/apk-broken launches to MainActivity actions. |
| app/src/main/kotlin/com/github/kr328/clash/proxy/ProxyNav.kt | Adds Navigation 3 proxy entry. |
| app/src/main/kotlin/com/github/kr328/clash/proxy/ProxyActivity.kt | Removes standalone Proxy activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/profile/vm/NewProfileViewModel.kt | Removes activity-result based properties flow hook. |
| app/src/main/kotlin/com/github/kr328/clash/profile/vm/FilesViewModel.kt | Fixes package to com.github.kr328.clash.profile.vm. |
| app/src/main/kotlin/com/github/kr328/clash/profile/ui/NewProfileScreen.kt | Switches properties launch to callback-based navigation (onProperties(UUID)). |
| app/src/main/kotlin/com/github/kr328/clash/profile/ui/FilesScreen.kt | Fixes package and imports for moved profile file UI. |
| app/src/main/kotlin/com/github/kr328/clash/profile/ProvidersActivity.kt | Removes standalone Providers activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/profile/PropertiesActivity.kt | Removes standalone Properties activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/profile/ProfilesNav.kt | Adds Navigation 3 profiles flow with nested back stack + UUID route params. |
| app/src/main/kotlin/com/github/kr328/clash/profile/ProfilesActivity.kt | Removes standalone Profiles activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/profile/NewProfileActivity.kt | Removes standalone New Profile activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/nav/MihomoNavDisplay.kt | Adds shared Nav3 NavDisplay wrapper with transitions and decorators. |
| app/src/main/kotlin/com/github/kr328/clash/main/MainNav.kt | Adds Navigation 3 main/help entries. |
| app/src/main/kotlin/com/github/kr328/clash/main/MainActivity.kt | Removes old .main.MainActivity (replaced by root MainActivity). |
| app/src/main/kotlin/com/github/kr328/clash/main/HelpActivity.kt | Removes standalone Help activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/log/LogsActivity.kt | Removes standalone Logs activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/log/LogcatService.kt | Updates notification intent routing and refactors running state tracking. |
| app/src/main/kotlin/com/github/kr328/clash/log/LogcatActivity.kt | Removes standalone Logcat activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/log/LogNav.kt | Adds Navigation 3 log flow with Logs/Logcat destinations. |
| app/src/main/kotlin/com/github/kr328/clash/files/FilesActivity.kt | Removes standalone Files activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/crash/CrashNav.kt | Adds Navigation 3 crash entries. |
| app/src/main/kotlin/com/github/kr328/clash/crash/AppCrashedActivity.kt | Removes standalone crash activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/crash/ApkBrokenActivity.kt | Removes standalone apk-broken activity (now a Nav3 destination). |
| app/src/main/kotlin/com/github/kr328/clash/MainApplication.kt | Cleans up imports after moving ExternalControlActivity package. |
| app/src/main/kotlin/com/github/kr328/clash/MainActivity.kt | Adds new single-activity Nav3 host + intent action routing. |
| app/src/main/kotlin/com/github/kr328/clash/ExternalControlActivity.kt | Moves package to root and routes to properties via MainActivity action. |
| app/src/main/kotlin/com/github/kr328/clash/DialerReceiver.kt | Updates launcher intent creation to use MainActivity.Companion.intent. |
| app/src/main/AndroidManifest.xml | Points launcher + alias to new MainActivity and removes deprecated activities. |
| app/build.gradle.kts | Enables Kotlin serialization plugin and adds Navigation 3 dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs https://github.com/android/nav3-recipes.