Create ViewModels immediately after injection
Various activities and fragments are creating their view models at different points in their lifecycles. To avoid subtle lifecycle bugs let's standardise this and create view models immediately after injection.
Subtask of #1823.
Test instructions: This set of changes doesn't introduce new features, it only rearranges some code and is supposed not to break anything. It makes sense to test that the workflows and actions for which code has been touched. These include:
- Creating a new account on a fresh install
- Adding contacts via QR codes and make sure it works
- Add a contact remotely and before that finishes (by only completing the dialog on one of the devices first), check that the screen with the "pending contacts" works as expected
- Changing the alias for a contact
- Changing the account password
- Sending an image and opening that image full screen on both the sender and receiver device
- Opening the transports screen (by opening the navigation drawer on the left, tapping any of the connection modes at the bottom) and check that changing anything there persists (i.e. is still changed when navigating away and back to that screen)
Edited by Sebastian