bitfireAT / davx5-ose

DAVx⁵ is an open-source CalDAV/CardDAV suite and sync app for Android. You can also access your online files (WebDAV) with it.
https://www.davx5.com
GNU General Public License v3.0
1.25k stars 69 forks source link

Start at LoginDetails page if logging in via intent #772

Closed sunkup closed 2 weeks ago

sunkup commented 2 weeks ago

Purpose

DAVx5 should start with the login details page automatically when the login type is determined by the Intent.

Short description

When the intent.data is not empty a new method navToPage is called, which sets the active page to be the login details page. This is by default of type UrlLogin, so we currently don't need to set it explicitly.

Checklist

sunkup commented 2 weeks ago

@rfc2822

I noticed that currently the nextcloud login flow can not be started via intent. There seems to exist intentToInitialLoginType() but it does not have any usages. So starting via an intent ala

adb shell am start -e loginFlow nextcloud at.bitfire.davdroid/at.bitfire.davdroid.ui.setup.LoginActivity

currently does nothing.

The login type should of course be changed accordingly to the presence of the intent extra, but that may be outside the scope of this PR.

Issue here: https://github.com/bitfireAT/davx5-ose/issues/773

sunkup commented 2 weeks ago
  1. Wrapping the "initial login data" lines into if (savedInstanceState == null) should help. Then the code should only be executed on the first creation, but not on re-creation.

The code is only run once now. Re-creation / rotation still looses user changes though ...

rfc2822 commented 2 weeks ago

The code is only run once now. Re-creation / rotation still looses user changes though ...

Hm really? For instance when I'm on the last (account details) page and rotate the screen, it now stays on that page.

sunkup commented 2 weeks ago

Hm really? For instance when I'm on the last (account details) page and rotate the screen, it now stays on that page.

Yes, directly after launching the intent, still on the login details page: try changing the text in the input fields. Ie base URL, user name or password. When rotating the screen the changes are reset.