Skip to content

Commit c027ff1

Browse files
committed
Android SplashScreens: Remove TriggerFirstNavigate and use RunAppStart instead
1 parent 8e9d2b2 commit c027ff1

2 files changed

Lines changed: 10 additions & 17 deletions

File tree

MvvmCross.Android.Support/V7.AppCompat/MvxSplashScreenAppCompatActivity.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Android.Views;
88
using MvvmCross.Core;
99
using MvvmCross.Platforms.Android.Core;
10-
using MvvmCross.Platforms.Android.Views;
1110
using MvvmCross.ViewModels;
1211

1312
namespace MvvmCross.Droid.Support.V7.AppCompat
@@ -20,6 +19,8 @@ public abstract class MvxSplashScreenAppCompatActivity
2019

2120
private readonly int _resourceId;
2221

22+
private Bundle _bundle;
23+
2324
public new MvxNullViewModel ViewModel
2425
{
2526
get { return base.ViewModel as MvxNullViewModel; }
@@ -40,6 +41,8 @@ protected override void OnCreate(Bundle bundle)
4041
{
4142
RequestWindowFeatures();
4243

44+
_bundle = bundle;
45+
4346
var setup = MvxAndroidSetupSingleton.EnsureSingletonAvailable(ApplicationContext);
4447
setup.InitializeAndMonitor(this);
4548

@@ -77,14 +80,7 @@ public virtual void InitializationComplete()
7780
if (!_isResumed)
7881
return;
7982

80-
TriggerFirstNavigate();
81-
}
82-
83-
protected virtual void TriggerFirstNavigate()
84-
{
85-
var startup = Mvx.Resolve<IMvxAppStart>();
86-
if (!startup.IsStarted)
87-
startup.Start();
83+
RunAppStart(_bundle);
8884
}
8985
}
9086
}

MvvmCross/Platforms/Android/Views/MvxSplashScreenActivity.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public abstract class MvxSplashScreenActivity
1919

2020
private readonly int _resourceId;
2121

22+
private Bundle _bundle;
23+
2224
public new MvxNullViewModel ViewModel
2325
{
2426
get { return base.ViewModel as MvxNullViewModel; }
@@ -39,6 +41,8 @@ protected override void OnCreate(Bundle bundle)
3941
{
4042
RequestWindowFeatures();
4143

44+
_bundle = bundle;
45+
4246
var setup = MvxAndroidSetupSingleton.EnsureSingletonAvailable(ApplicationContext);
4347
setup.InitializeAndMonitor(this);
4448

@@ -76,14 +80,7 @@ public virtual void InitializationComplete()
7680
if (!_isResumed)
7781
return;
7882

79-
TriggerFirstNavigate();
80-
}
81-
82-
protected virtual void TriggerFirstNavigate()
83-
{
84-
var startup = Mvx.Resolve<IMvxAppStart>();
85-
if (!startup.IsStarted)
86-
startup.Start();
83+
RunAppStart(_bundle);
8784
}
8885
}
8986
}

0 commit comments

Comments
 (0)