Closed sunkup closed 1 month ago
We could use the initial data approach here too:
* pass `initialLoginType` & `initialloginInfo` to the `LoginScreen` * `LoginScreen` injects/creates the model with the initial data in the constructor
Then we could get rid of the
if (savedInstanceState == null)
and have better separation of concerns (no direct model access from outside).
While it would have been possible (and shorter in code) I have added an extra startPage parameter as well. The alternative is to infer the starting page from the login type inside the model, which is shorter, but less flexible. I can change that back if you prefer :)
The advantage would be that future intents could start the correct login page more easily.
Purpose
The nextcloud login/setup flow could not be started via intent. This fixes it.
Short description
LoginActivity:
intentToInitialLoginType()
to determine login type from intent.selectLoginType()
to change the login type accordinglyLoginScreenModel:
selectLoginType()
to also update the ui state of the login details page. Previously it only updated the ui state of the login type page.See also: Creation of intent in nextcloud app.
Testing
Intent for testing:
Checklist