Skip to content

feat: navigator#16652

Open
alperozturk96 wants to merge 5 commits intomasterfrom
feat/navigator
Open

feat: navigator#16652
alperozturk96 wants to merge 5 commits intomasterfrom
feat/navigator

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Mar 11, 2026

Approach

Introduce NavigatorActivity shell activity that hosts fragments via FragmentContainerView. All screens that previously had their own activity are migrated to fragments and pushed through Navigator. NavigatorScreen sealed class represents each destination.

DrawerActivity launches NavigatorActivity with the target NavigatorScreen as a parcelable extra, keeping the call site clean with no per-screen logic.

Why FileDisplayActivity is not used?

Other activities like SettingsActivity and various non-drawer activities also trigger drawer navigation items. Wiring Navigator into FDA from the start would require every caller to hold a reference to FDA or route through it, which is not possible without a larger refactor. e.g. Navigating from CommunityActivity to some other activity.

This way any activity can launch NavigatorActivity via a simple Intent, no FDA dependency required. Once all navigation is consolidated into NavigatorActivity we can remove it and just use FDA

@alperozturk96 alperozturk96 added the navigation Navigation matters (e.g. covered under #11072) label Mar 11, 2026
@alperozturk96 alperozturk96 added this to the Nextcloud App 33.1.0 milestone Mar 11, 2026
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions
Copy link

Codacy

SpotBugs

CategoryBaseNew
Bad practice4040
Correctness7272
Dodgy code237237
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4343
Security1818
Total454454

@github-actions
Copy link

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16652.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

import com.owncloud.android.ui.fragment.community.CommunityFragment

class Navigator(private val fragmentManager: FragmentManager, private val fragmentContainer: View) {
fun push(screen: NavigatorScreen) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not push same fragment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Fine to do it in another PR

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

Labels

3. to review navigation Navigation matters (e.g. covered under #11072)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants