mirror of
https://github.com/bitwarden/android.git
synced 2024-12-27 11:28:28 +03:00
Added some comments and improvemments.
This commit is contained in:
parent
3de13325c9
commit
c3370b58ec
1 changed files with 9 additions and 2 deletions
|
@ -76,6 +76,7 @@ namespace Bit.App
|
||||||
private Window _autofillWindow;
|
private Window _autofillWindow;
|
||||||
private Window _mainWindow;
|
private Window _mainWindow;
|
||||||
|
|
||||||
|
//Allows setting Options from MainActivity before base.OnCreate
|
||||||
public void SetOptions(AppOptions appOptions)
|
public void SetOptions(AppOptions appOptions)
|
||||||
{
|
{
|
||||||
Options = appOptions ?? new AppOptions();
|
Options = appOptions ?? new AppOptions();
|
||||||
|
@ -88,12 +89,13 @@ namespace Bit.App
|
||||||
if (activationState != null
|
if (activationState != null
|
||||||
&& activationState.State.TryGetValue("autofillFramework", out string autofillFramework)
|
&& activationState.State.TryGetValue("autofillFramework", out string autofillFramework)
|
||||||
&& autofillFramework == "true"
|
&& autofillFramework == "true"
|
||||||
&& activationState.State.ContainsKey("autofillFrameworkCipherId")) //AutofillExternalActivity
|
&& activationState.State.ContainsKey("autofillFrameworkCipherId"))
|
||||||
{
|
{
|
||||||
return new Window(new NavigationPage()); //No actual page needed. Only used for auto-filling the fields directly (externally)
|
return new Window(new NavigationPage()); //No actual page needed. Only used for auto-filling the fields directly (externally)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Options != null && (Options.FromAutofillFramework || Options.Uri != null || Options.OtpData != null || Options.CreateSend != null)) //"Internal" Autofill and Uri/Otp/CreateSend
|
//"Internal" Autofill and Uri/Otp/CreateSend. This is where we create the autofill specific Window
|
||||||
|
if (Options != null && (Options.FromAutofillFramework || Options.Uri != null || Options.OtpData != null || Options.CreateSend != null))
|
||||||
{
|
{
|
||||||
_autofillWindow = new Window(new NavigationPage(new AndroidNavigationRedirectPage()));
|
_autofillWindow = new Window(new NavigationPage(new AndroidNavigationRedirectPage()));
|
||||||
_autofillWindow.Created += (sender, args) =>
|
_autofillWindow.Created += (sender, args) =>
|
||||||
|
@ -143,6 +145,7 @@ namespace Bit.App
|
||||||
return _mainWindow;
|
return _mainWindow;
|
||||||
}
|
}
|
||||||
#elif IOS
|
#elif IOS
|
||||||
|
//iOS doesn't use the CreateWindow override used in Android so we just set the Application.Current.MainPage directly
|
||||||
public new static Page MainPage
|
public new static Page MainPage
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -576,6 +579,10 @@ namespace Bit.App
|
||||||
UpdateThemeAsync();
|
UpdateThemeAsync();
|
||||||
};
|
};
|
||||||
_isResumed = true;
|
_isResumed = true;
|
||||||
|
#if IOS
|
||||||
|
//We only set the MainPage here for iOS as Android is using the CreateWindow override for the initial page.
|
||||||
|
App.MainPage = new NavigationPage(new HomePage(Options));
|
||||||
|
#endif
|
||||||
_accountsManager.NavigateOnAccountChangeAsync().FireAndForget();
|
_accountsManager.NavigateOnAccountChangeAsync().FireAndForget();
|
||||||
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
|
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue