Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Fix crash disconnecting the IndicatorView #11346

Merged
merged 3 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ protected override MauiPageControl CreatePlatformView()
private protected override void OnConnectHandler(AView platformView)
{
base.OnConnectHandler(platformView);
PlatformView.SetIndicatorView(VirtualView);

if(platformView is MauiPageControl pageControl)
pageControl.SetIndicatorView(VirtualView);
}

private protected override void OnDisconnectHandler(AView platformView)
{
base.OnDisconnectHandler(platformView);
PlatformView.SetIndicatorView(null);

if (platformView is MauiPageControl pageControl)
pageControl.SetIndicatorView(null);
}

public static void MapCount(IIndicatorViewHandler handler, IIndicatorView indicator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public partial class IndicatorViewHandler : ViewHandler<IIndicatorView, MauiPage
protected override void ConnectHandler(MauiPageControl platformView)
{
base.ConnectHandler(platformView);
PlatformView?.SetIndicatorView(VirtualView);

platformView?.SetIndicatorView(VirtualView);

UpdateIndicator();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ public partial class IndicatorViewHandler : ViewHandler<IIndicatorView, MauiPage
protected override void ConnectHandler(MauiPageControl platformView)
{
base.ConnectHandler(platformView);
PlatformView?.SetIndicatorView(VirtualView);

platformView?.SetIndicatorView(VirtualView);

UpdateIndicator();
}

protected override void DisconnectHandler(MauiPageControl platformView)
{
base.DisconnectHandler(platformView);
PlatformView?.SetIndicatorView(null);

platformView?.SetIndicatorView(null);
}

public static void MapCount(IIndicatorViewHandler handler, IIndicatorView indicator)
Expand Down