mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
update libs
This commit is contained in:
parent
b2f40c7af0
commit
f680b1e856
3 changed files with 13 additions and 56 deletions
|
@ -871,7 +871,7 @@
|
|||
</PackageReference>
|
||||
<PackageReference Include="XLabs.IoC.SimpleInjector" Version="2.0.5782" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.2" />
|
||||
<PackageReference Include="Plugin.CurrentActivity" Version="1.0.1" />
|
||||
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\bottom_nav_bg.xml" />
|
||||
|
|
|
@ -13,7 +13,6 @@ using Plugin.Fingerprint;
|
|||
using Plugin.Settings;
|
||||
using XLabs.Ioc;
|
||||
using System.Threading.Tasks;
|
||||
using FFImageLoading.Forms.Droid;
|
||||
using XLabs.Ioc.SimpleInjectorContainer;
|
||||
using SimpleInjector;
|
||||
|
||||
|
@ -24,13 +23,11 @@ namespace Bit.Android
|
|||
#else
|
||||
[Application(Debuggable = false)]
|
||||
#endif
|
||||
public class MainApplication : Application, Application.IActivityLifecycleCallbacks
|
||||
public class MainApplication : Application
|
||||
{
|
||||
private const string FirstLaunchKey = "firstLaunch";
|
||||
private const string LastVersionCodeKey = "lastVersionCode";
|
||||
|
||||
public static Context AppContext;
|
||||
|
||||
public MainApplication(IntPtr handle, JniHandleOwnership transer)
|
||||
: base(handle, transer)
|
||||
{
|
||||
|
@ -56,52 +53,13 @@ namespace Bit.Android
|
|||
// workaround for app compat bug
|
||||
// ref https://forums.xamarin.com/discussion/62414/app-resuming-results-in-crash-with-formsappcompatactivity
|
||||
Task.Delay(10).Wait();
|
||||
|
||||
RegisterActivityLifecycleCallbacks(this);
|
||||
AppContext = ApplicationContext;
|
||||
}
|
||||
|
||||
public override void OnTerminate()
|
||||
{
|
||||
base.OnTerminate();
|
||||
UnregisterActivityLifecycleCallbacks(this);
|
||||
}
|
||||
|
||||
public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
|
||||
{
|
||||
CrossCurrentActivity.Current.Activity = activity;
|
||||
}
|
||||
|
||||
public void OnActivityDestroyed(Activity activity)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnActivityPaused(Activity activity)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnActivityResumed(Activity activity)
|
||||
{
|
||||
CrossCurrentActivity.Current.Activity = activity;
|
||||
}
|
||||
|
||||
public void OnActivitySaveInstanceState(Activity activity, Bundle outState)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnActivityStarted(Activity activity)
|
||||
{
|
||||
CrossCurrentActivity.Current.Activity = activity;
|
||||
}
|
||||
|
||||
public void OnActivityStopped(Activity activity)
|
||||
{
|
||||
CrossCurrentActivity.Current.Init(this);
|
||||
}
|
||||
|
||||
public static void SetIoc(Application application)
|
||||
{
|
||||
Refractored.FabControl.Droid.FloatingActionButtonViewRenderer.Init();
|
||||
CachedImageRenderer.Init(true);
|
||||
FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);
|
||||
ZXing.Net.Mobile.Forms.Android.Platform.Init();
|
||||
CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity);
|
||||
|
||||
|
@ -109,8 +67,8 @@ namespace Bit.Android
|
|||
var container = new Container();
|
||||
|
||||
// Android Stuff
|
||||
container.RegisterSingleton(application.ApplicationContext);
|
||||
container.RegisterSingleton<Application>(application);
|
||||
container.RegisterInstance(application.ApplicationContext);
|
||||
container.RegisterInstance<Application>(application);
|
||||
|
||||
// Services
|
||||
container.RegisterSingleton<IDatabaseService, DatabaseService>();
|
||||
|
@ -158,9 +116,9 @@ namespace Bit.Android
|
|||
container.RegisterSingleton<ICipherCollectionRepository, CipherCollectionRepository>();
|
||||
|
||||
// Other
|
||||
container.RegisterSingleton(CrossSettings.Current);
|
||||
container.RegisterSingleton(CrossConnectivity.Current);
|
||||
container.RegisterSingleton(CrossFingerprint.Current);
|
||||
container.RegisterInstance(CrossSettings.Current);
|
||||
container.RegisterInstance(CrossConnectivity.Current);
|
||||
container.RegisterInstance(CrossFingerprint.Current);
|
||||
|
||||
// Push
|
||||
#if FDROID
|
||||
|
|
|
@ -17,7 +17,6 @@ using Bit.App.Pages;
|
|||
using HockeyApp.iOS;
|
||||
using Bit.iOS.Core;
|
||||
using Google.Analytics;
|
||||
using FFImageLoading.Forms.Touch;
|
||||
using SimpleInjector;
|
||||
using XLabs.Ioc.SimpleInjectorContainer;
|
||||
using CoreNFC;
|
||||
|
@ -301,17 +300,17 @@ namespace Bit.iOS
|
|||
container.RegisterSingleton<ICipherCollectionRepository, CipherCollectionRepository>();
|
||||
|
||||
// Other
|
||||
container.RegisterSingleton(CrossConnectivity.Current);
|
||||
container.RegisterSingleton(CrossFingerprint.Current);
|
||||
container.RegisterInstance(CrossConnectivity.Current);
|
||||
container.RegisterInstance(CrossFingerprint.Current);
|
||||
|
||||
Settings = new Settings("group.com.8bit.bitwarden");
|
||||
container.RegisterSingleton(Settings);
|
||||
container.RegisterInstance(Settings);
|
||||
|
||||
// Push
|
||||
container.RegisterSingleton<IPushNotificationListener, PushNotificationListener>();
|
||||
container.RegisterSingleton<IPushNotificationService, iOSPushNotificationService>();
|
||||
|
||||
CachedImageRenderer.Init();
|
||||
FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
|
||||
Resolver.SetResolver(new SimpleInjectorResolver(container));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue