-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Meta] Migrate to Single-Activity Compose Navigation architecture #1172
Comments
Good plan, but I think it shouldn't be named So I'm for a new We must however pay extra attention to activities/intents which can be launched from outside. For instance the login Intent or the Account intent. And of course all the screens that take arguments from a PendingIntent / notification. |
We could try starting this mega-issue 😅 I suggest to
Then we can also work on multiple activities in parallel. What do you think @ArnyminerZ @sunkup? @ArnyminerZ Would you like to start with the MainActivity PR? |
Sounds good to me.
I take it that apps which start certain activities (Etar, JtxBoard, Tasks.org) might have to make changes to how they send users to certain parts of the DAVx5 app. Or would the reference, default to the new MainActivity? Otherwise we could notify the app developers about the breaking changes? |
Yes, I'd prefer to
|
List of known references, to check they don't break:
|
Right now we are using the multi-activity architecture that was the standard for a long time, but it looks like everything is moving to a single-activity with navigation (at least it's how it's explained in the docs).
In the migration guide, the first thing they recommend is to "Move screen-specific UI logic out of activities", which we have already done pretty much everywhere, so this is completed. The next step would be of course, start getting rid of the activities in order to migrate into a single-activity.
I don't think this process should be done in a single movement, but maybe from less to more complex. First move activities that don't have any intent-filters, and are directly related to each other. For example,
AboutActivity
can be merged withAccountsActivity
, and the same goes forIntroActivity
.PermissionsActivity
is for example a complex one, because it's related to multiple other activities, so I'd wait to migrate it.I'd split it into the following steps.
The idea is obviously at the end of the process,
AccountsActivity
stops existing and we have a properMainActivity
, that holds the main navgraph, and redirects accordingly to the request made.First Phase (no cross-dependencies)
I'll put first the activity that will hold the other ones, and below the ones that would be merged into it.
AccountsActivity
IntroActivity
AboutActivity
AppSettingsActivity
TasksActivity
AccountActivity
CollectionActivity
CreateAddressBookActivity
CreateCalendarActivity
WebdavMountsActivity
AddWebdavMountActivity
Second Phase (
AppSettingsActivity
)This activity is defined as parent for
DebugInfoActivity
,PermissionsActivity
andTasksActivity
.TasksActivity
Should already be merged into the Activity by this point, so no worries here.
DebugInfoActivity
It has
IntentBuilder
defined inside, so this would have to be moved intoAppSettingsActivity
. All the extras can be moved into the companion ofAppSettingsActivity
, and I'd probably create a new action named something likeat.bitfire.davdroid.ui.debug_info
, so that ifAppSettingsActivity
is launched with this action, it will be automatically redirected to the destination of the "old"DebugInfoActivity
passing all the extras.Then, all the functions in
DebugInfoActivity
would be moved into a viewmodel (shareZipFile
,shareFile
,viewFile
).All usages of
DebugInfoActivity
andDebugInfoActivity.IntentBuilder
would of course be moved toAppSettingsActivity
.PermissionsActivity
It is used in multiple places, but doesn't have any extras, so we would only have to add an action, for example
at.bitfire.davdroid.ui.permissions
, which if given toAppSettingsActivity
sets the navgraph location to the contents ofPermissionsScreen
.The text was updated successfully, but these errors were encountered: