Removing RegisterSetup - use extension method RegisterSetupType instead

This commit is contained in:
Nick Randolph 2018-03-27 16:41:43 +11:00 коммит произвёл Martijn van Dijk
Родитель b6111942fb
Коммит 596d958102
6 изменённых файлов: 10 добавлений и 27 удалений

Просмотреть файл

@ -112,11 +112,6 @@ namespace MvvmCross.Droid.Support.V4
base.OnStop();
ViewModel?.ViewDisappeared();
}
protected virtual void RegisterSetup<TMvxAndroidSetup>() where TMvxAndroidSetup : MvxAndroidSetup, new()
{
MvxSetup.RegisterSetupType<TMvxAndroidSetup>(GetType().Assembly);
}
}
public abstract class MvxFragmentActivity<TViewModel>

Просмотреть файл

@ -87,8 +87,6 @@ namespace MvvmCross.Droid.Support.V7.AppCompat
{
base.OnCreate(bundle);
ViewModel?.ViewCreated();
//TODO: Add setup init and startup here
}
protected override void OnDestroy()
@ -126,11 +124,6 @@ namespace MvvmCross.Droid.Support.V7.AppCompat
var view = MvxAppCompatActivityHelper.OnCreateView(parent, name, context, attrs);
return view ?? base.OnCreateView(parent, name, context, attrs);
}
protected virtual void RegisterSetup<TMvxAndroidSetup>() where TMvxAndroidSetup : MvxAppCompatSetup, new()
{
this.RegisterSetupType<TMvxAndroidSetup>();
}
}
public abstract class MvxAppCompatActivity<TViewModel>

Просмотреть файл

@ -115,8 +115,6 @@ namespace MvvmCross.Platforms.Android.Views
{
base.OnCreate(bundle);
ViewModel?.ViewCreated();
//TODO: Add setup init and startup here
}
protected override void OnDestroy()
@ -148,11 +146,6 @@ namespace MvvmCross.Platforms.Android.Views
base.OnStop();
ViewModel?.ViewDisappeared();
}
protected virtual void RegisterSetup<TMvxAndroidSetup>() where TMvxAndroidSetup : MvxAndroidSetup, new()
{
this.RegisterSetupType<TMvxAndroidSetup>();
}
}
public abstract class MvxActivity<TViewModel>

Просмотреть файл

@ -111,11 +111,6 @@ namespace MvvmCross.Platforms.Android.Views
base.OnStop();
ViewModel?.ViewDisappeared();
}
protected virtual void RegisterSetup<TMvxAndroidSetup>() where TMvxAndroidSetup : MvxAndroidSetup, new()
{
MvxSetup.RegisterSetupType<TMvxAndroidSetup>(GetType().Assembly);
}
}
[Obsolete("TabActivity is obsolete. Use ViewPager + Indicator or any other Activity with Toolbar support.")]

Просмотреть файл

@ -5,20 +5,27 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using MvvmCross.Core;
using MvvmCross.Forms.Platforms.Android.Views;
using Playground.Core.ViewModels;
namespace Playground.Forms.Droid
{
[Activity(
Label = "Playground.Forms",
Label = "Playground.Forms",
Icon = "@mipmap/icon",
Theme = "@style/AppTheme",
//MainLauncher = true, // No Splash Screen: Uncomment this lines if removing splash screen
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
LaunchMode = LaunchMode.SingleTask)]
public class MainActivity : MvxFormsAppCompatActivity<MainViewModel>
{
// No Splash Screen: uncomment this constructor
// public MainActivity() : base()
// {
// this.RegisterSetupType<Setup>();
// }
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;

Просмотреть файл

@ -22,7 +22,7 @@ namespace Playground.Forms.Droid
public SplashScreen()
: base(Resource.Layout.SplashScreen)
{
RegisterSetup<Setup>();
this.RegisterSetupType<Setup>();
}
protected override void TriggerFirstNavigate()