Skip to content

Commit

Permalink
Merge branch 'release/9.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheesebaron committed Jan 13, 2023
2 parents 0a5e623 + a4aa7ae commit ec55db6
Show file tree
Hide file tree
Showing 38 changed files with 111 additions and 68 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,17 @@
# Changelog

## [9.0.7](https://github.com/MvvmCross/MvvmCross/tree/9.0.7) (2023-01-13)

[Full Changelog](https://github.com/MvvmCross/MvvmCross/compare/9.0.6...9.0.7)

**Breaking changes:**

- Switch from IntPtr to NativeHandle [\#4545](https://github.com/MvvmCross/MvvmCross/pull/4545) ([Cheesebaron](https://github.com/Cheesebaron))

**Fixed bugs:**

- Fix crash when App gets rehydrated [\#4547](https://github.com/MvvmCross/MvvmCross/pull/4547) ([Cheesebaron](https://github.com/Cheesebaron))

## [9.0.6](https://github.com/MvvmCross/MvvmCross/tree/9.0.6) (2023-01-12)

[Full Changelog](https://github.com/MvvmCross/MvvmCross/compare/9.0.5...9.0.6)
Expand Down
3 changes: 3 additions & 0 deletions MvvmCross/Platforms/Android/Core/MvxAndroidSetup.cs
Expand Up @@ -37,6 +37,9 @@ public void PlatformInitialize(Activity activity)
ArgumentNullException.ThrowIfNull(activity.Application);

PlatformInitialize(activity.Application);

// this is needed for when App is rehydrated from being killed by Android in the background
_currentTopActivity?.OnActivityCreated(activity, null);
}

public void PlatformInitialize(Application application)
Expand Down
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.Logging;
using MvvmCross.Binding.Bindings;
using MvvmCross.Logging;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand All @@ -20,11 +21,11 @@ protected MvxActionBasedTableViewSource(UITableView tableView)
Initialize();
}

public MvxActionBasedTableViewSource(IntPtr handle)
public MvxActionBasedTableViewSource(NativeHandle handle)
: base(handle)
{
MvxLogHost.GetLog<MvxActionBasedTableViewSource>()?.Log(
LogLevel.Warning, "MvxActionBasedTableViewSource IntPtr constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
LogLevel.Warning, "MvxActionBasedTableViewSource NativeHandle constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
Initialize();
}

Expand Down
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.Logging;
using MvvmCross.Binding.BindingContext;
using MvvmCross.Logging;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand All @@ -23,11 +24,11 @@ protected MvxBaseTableViewSource(UITableView tableView)
_tableView = new WeakReference<UITableView>(tableView);
}

protected MvxBaseTableViewSource(IntPtr handle)
protected MvxBaseTableViewSource(NativeHandle handle)
: base(handle)
{
MvxLogHost.GetLog<MvxBaseTableViewSource>()?.Log(LogLevel.Warning,
"MvxBaseTableViewSource IntPtr constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
"MvxBaseTableViewSource NativeHandle constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
}

protected UITableView TableView
Expand Down
Expand Up @@ -8,6 +8,7 @@
using MvvmCross.Binding.Attributes;
using MvvmCross.Binding.BindingContext;
using MvvmCross.Binding.Bindings;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand Down Expand Up @@ -44,18 +45,18 @@ public MvxCollectionReusableView(IEnumerable<MvxBindingDescription> bindingDescr
this.CreateBindingContext(bindingDescriptions);
}

public MvxCollectionReusableView(IntPtr handle)
public MvxCollectionReusableView(NativeHandle handle)
: this(string.Empty, handle)
{
}

public MvxCollectionReusableView(string bindingText, IntPtr handle)
public MvxCollectionReusableView(string bindingText, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingText);
}

public MvxCollectionReusableView(IEnumerable<MvxBindingDescription> bindingDescriptions, IntPtr handle)
public MvxCollectionReusableView(IEnumerable<MvxBindingDescription> bindingDescriptions, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingDescriptions);
Expand Down
Expand Up @@ -7,6 +7,7 @@
using CoreGraphics;
using MvvmCross.Binding.BindingContext;
using MvvmCross.Binding.Bindings;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand Down Expand Up @@ -43,18 +44,18 @@ public MvxCollectionViewCell(IEnumerable<MvxBindingDescription> bindingDescripti
this.CreateBindingContext(bindingDescriptions);
}

public MvxCollectionViewCell(IntPtr handle)
public MvxCollectionViewCell(NativeHandle handle)
: this(string.Empty, handle)
{
}

public MvxCollectionViewCell(string bindingText, IntPtr handle)
public MvxCollectionViewCell(string bindingText, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingText);
}

public MvxCollectionViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions, IntPtr handle)
public MvxCollectionViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingDescriptions);
Expand Down
Expand Up @@ -6,6 +6,7 @@
using Foundation;
using Microsoft.Extensions.Logging;
using MvvmCross.Logging;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand All @@ -17,10 +18,10 @@ public class MvxSimpleTableViewSource : MvxTableViewSource

protected virtual NSString CellIdentifier => _cellIdentifier;

public MvxSimpleTableViewSource(IntPtr handle)
public MvxSimpleTableViewSource(NativeHandle handle)
: base(handle)
{
MvxLogHost.Default?.LogWarning("MvxSimpleTableViewSource IntPtr constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
MvxLogHost.Default?.LogWarning("MvxSimpleTableViewSource NativeHandle constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
}

public MvxSimpleTableViewSource(UITableView tableView, string nibName, string cellIdentifier = null,
Expand Down
Expand Up @@ -7,24 +7,25 @@
using System.Windows.Input;
using Foundation;
using MvvmCross.Binding.Bindings;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
{
public class MvxStandardTableViewCell
: MvxTableViewCell
{
public MvxStandardTableViewCell(IntPtr handle)
public MvxStandardTableViewCell(NativeHandle handle)
: this("TitleText" /* default binding is ToString() on the passed in item */, handle)
{
}

public MvxStandardTableViewCell(string bindingText, IntPtr handle)
public MvxStandardTableViewCell(string bindingText, NativeHandle handle)
: base(bindingText, handle)
{
}

public MvxStandardTableViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions, IntPtr handle)
public MvxStandardTableViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions, NativeHandle handle)
: base(bindingDescriptions, handle)
{
}
Expand Down
Expand Up @@ -10,6 +10,7 @@
using MvvmCross.Binding.Bindings;
using MvvmCross.Binding.Bindings.SourceSteps;
using MvvmCross.Logging;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand Down Expand Up @@ -52,10 +53,10 @@ public MvxStandardTableViewSource(UITableView tableView, string bindingText)
{
}

public MvxStandardTableViewSource(IntPtr handle)
public MvxStandardTableViewSource(NativeHandle handle)
: base(handle)
{
MvxLogHost.Default?.LogWarning("MvxStandardTableViewSource IntPtr constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
MvxLogHost.Default?.LogWarning("MvxStandardTableViewSource NativeHandle constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
}

public MvxStandardTableViewSource(
Expand Down
7 changes: 4 additions & 3 deletions MvvmCross/Platforms/Ios/Binding/Views/MvxTableViewCell.cs
Expand Up @@ -8,6 +8,7 @@
using Foundation;
using MvvmCross.Binding.BindingContext;
using MvvmCross.Binding.Bindings;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand Down Expand Up @@ -44,18 +45,18 @@ public MvxTableViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions,
this.CreateBindingContext(bindingDescriptions);
}

public MvxTableViewCell(IntPtr handle)
public MvxTableViewCell(NativeHandle handle)
: this(string.Empty, handle)
{
}

public MvxTableViewCell(string bindingText, IntPtr handle)
public MvxTableViewCell(string bindingText, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingText);
}

public MvxTableViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions, IntPtr handle)
public MvxTableViewCell(IEnumerable<MvxBindingDescription> bindingDescriptions, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingDescriptions);
Expand Down
Expand Up @@ -8,6 +8,7 @@
using Foundation;
using MvvmCross.Binding.BindingContext;
using MvvmCross.Binding.Bindings;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Binding.Views
Expand Down Expand Up @@ -44,18 +45,18 @@ public MvxTableViewHeaderFooterView(IEnumerable<MvxBindingDescription> bindingDe
this.CreateBindingContext(bindingDescriptions);
}

public MvxTableViewHeaderFooterView(IntPtr handle)
public MvxTableViewHeaderFooterView(NativeHandle handle)
: this(string.Empty, handle)
{
}

public MvxTableViewHeaderFooterView(string bindingText, IntPtr handle)
public MvxTableViewHeaderFooterView(string bindingText, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingText);
}

public MvxTableViewHeaderFooterView(IEnumerable<MvxBindingDescription> bindingDescriptions, IntPtr handle)
public MvxTableViewHeaderFooterView(IEnumerable<MvxBindingDescription> bindingDescriptions, NativeHandle handle)
: base(handle)
{
this.CreateBindingContext(bindingDescriptions);
Expand Down
9 changes: 3 additions & 6 deletions MvvmCross/Platforms/Ios/Binding/Views/MvxTableViewSource.cs
Expand Up @@ -2,17 +2,14 @@
// The .NET Foundation licenses this file to you under the MS-PL license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using Foundation;
using Microsoft.Extensions.Logging;
using MvvmCross.Binding.Attributes;
using MvvmCross.Binding.Extensions;
using MvvmCross.Logging;
using MvvmCross.WeakSubscription;
using UIKit;
using ObjCRuntime;

namespace MvvmCross.Platforms.Ios.Binding.Views
{
Expand All @@ -26,10 +23,10 @@ protected MvxTableViewSource(UITableView tableView)
{
}

protected MvxTableViewSource(IntPtr handle)
protected MvxTableViewSource(NativeHandle handle)
: base(handle)
{
MvxLogHost.Default?.LogWarning("TableViewSource IntPtr constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
MvxLogHost.Default?.LogWarning("TableViewSource NativeHandle constructor used - we expect this only to be called during memory leak debugging - see https://github.com/MvvmCross/MvvmCross/pull/467");
}

[MvxSetToNullAfterBinding]
Expand Down
7 changes: 2 additions & 5 deletions MvvmCross/Platforms/Ios/Binding/Views/MvxView.cs
Expand Up @@ -2,12 +2,9 @@
// The .NET Foundation licenses this file to you under the MS-PL license.
// See the LICENSE file in the project root for more information.

using System;
using CoreGraphics;
using Foundation;
using MvvmCross.Binding.Attributes;
using MvvmCross.Binding.BindingContext;
using UIKit;
using ObjCRuntime;

namespace MvvmCross.Platforms.Ios.Binding.Views
{
Expand All @@ -22,7 +19,7 @@ public class MvxView
// interface builder (or Xamarin iOS designer). More documentation can be found:
// - here: https://developer.xamarin.com/guides/ios/user_interface/designer/ios_designable_controls_overview/
// - and here: https://developer.xamarin.com/guides/ios/under_the_hood/api_design/#Types_and_Interface_Builder
public MvxView(IntPtr handle) : base(handle) { }
public MvxView(NativeHandle handle) : base(handle) { }

public MvxView()
{
Expand Down
Expand Up @@ -5,6 +5,7 @@
using System;
using Foundation;
using MvvmCross.Base;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Views.Base
Expand All @@ -24,7 +25,7 @@ protected MvxEventSourceCollectionViewController(NSObjectFlag t) : base(t)
{
}

protected internal MvxEventSourceCollectionViewController(IntPtr handle) : base(handle)
protected internal MvxEventSourceCollectionViewController(NativeHandle handle) : base(handle)
{
}

Expand Down
Expand Up @@ -5,6 +5,7 @@
using System;
using Foundation;
using MvvmCross.Base;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Views.Base
Expand Down Expand Up @@ -35,7 +36,7 @@ protected MvxEventSourcePageViewController(NSObjectFlag t) : base(t)
{
}

protected internal MvxEventSourcePageViewController(IntPtr handle) : base(handle)
protected internal MvxEventSourcePageViewController(NativeHandle handle) : base(handle)
{
}

Expand Down
Expand Up @@ -6,6 +6,7 @@
using Foundation;
using MvvmCross.Base;
using MvvmCross.Platforms.Ios.Views.Base;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Views.Base
Expand All @@ -24,7 +25,7 @@ protected MvxEventSourceSplitViewController(NSObjectFlag t) : base(t)
{
}

protected internal MvxEventSourceSplitViewController(IntPtr handle) : base(handle)
protected internal MvxEventSourceSplitViewController(NativeHandle handle) : base(handle)
{
}

Expand Down
Expand Up @@ -5,6 +5,7 @@
using System;
using Foundation;
using MvvmCross.Base;
using ObjCRuntime;
using UIKit;

namespace MvvmCross.Platforms.Ios.Views.Base
Expand All @@ -24,7 +25,7 @@ protected MvxEventSourceTabBarController(NSObjectFlag t) : base(t)
{
}

protected internal MvxEventSourceTabBarController(IntPtr handle) : base(handle)
protected internal MvxEventSourceTabBarController(NativeHandle handle) : base(handle)
{
}

Expand Down

0 comments on commit ec55db6

Please sign in to comment.