Skip to content

Commit 794c1aa

Browse files
committed
Bump to latest (rc1)
- ImageButtonHandler and Handler Re-usability (dotnet#2352) - Remove IBoxView (dotnet#2619) - Add SupportedOSPlatformVersion (dotnet#2565) - Merge all the .NET 6 projects/solutions (dotnet#2505) - Shadow Support (dotnet#570) - Add IndicatorView handler(dotnet#2038)
1 parent a42544f commit 794c1aa

32 files changed

+273
-150
lines changed
File renamed without changes.

.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
</ItemGroup>
2626
<ItemGroup Condition="$(TargetFramework.StartsWith('tizen')) != true AND $(TargetFramework.StartsWith('net6.0-tizen')) != true ">
2727
<Compile Remove="**\**\*.Tizen.cs" />
28-
<None Include="**\**\*.Tizen.cs" />
28+
<None Include="**\**\*.Tizen.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
2929
<Compile Remove="**\Tizen\**\*.cs" />
30-
<None Include="**\Tizen\**\*.cs" />
30+
<None Include="**\Tizen\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
3131
</ItemGroup>
3232
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) != true AND '$(TargetFramework)' != 'net6.0'">
3333
<Compile Remove="**\*.Standard.cs" />

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<IncludeWindowsTargetFrameworks Condition="($([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full') or ('$(Packing)' == 'true')">true</IncludeWindowsTargetFrameworks>
66
<BuildForAndroidOnly Condition="$(SolutionFileName.StartsWith('._Microsoft.Maui.Droid')) and '$(Packing)' == ''">true</BuildForAndroidOnly>
77
<BuildForiOSOnly Condition="$(SolutionFileName.StartsWith('._Microsoft.Maui.iOS')) and '$(Packing)' == ''">true</BuildForiOSOnly>
8-
<BuildForTizenOnly Condition="$(SolutionFileName.StartsWith('._Microsoft.Maui.Tizen')) and '$(Packing)' == ''">true</BuildForiOSOnly>
8+
<BuildForTizenOnly Condition="$(SolutionFileName.StartsWith('._Microsoft.Maui.Tizen')) and '$(Packing)' == ''">true</BuildForTizenOnly>
99
<BuildForLegacy Condition="($(SolutionFileName.StartsWith('._')) or $(SolutionFileName.StartsWith('Comet'))) and !$(SolutionFileName.Contains('-net6')) and '$(Packing)' == ''">true</BuildForLegacy>
1010
</PropertyGroup>
1111

src/Controls/src/Core/Platform/Tizen/DragGestureHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ async Task<EvasObject> GetImageIconAsync(EvasObject parent)
177177
var services = Handler.MauiContext?.Services;
178178
var provider = services.GetService(typeof(IImageSourceServiceProvider)) as IImageSourceServiceProvider;
179179
var service = provider?.GetImageSourceService(mImage);
180-
var result = await service.LoadImageAsync(mImage, image);
180+
var result = await service.GetImageAsync(mImage, image);
181181
if (result == null)
182182
return null;
183183
return image;

src/Controls/src/Core/Platform/Tizen/Shell/ShellItemView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ EToolbarItem AppendTabsItem(string text, ImageSource iconSource)
447447
var provider = MauiContext.Services.GetRequiredService<IImageSourceServiceProvider>();
448448
var service = provider.GetRequiredImageSourceService(iconSource);
449449

450-
_ = service.LoadImageAsync(iconSource, image);
450+
_ = service.GetImageAsync(iconSource, image);
451451

452452
item.SetIconPart(image);
453453
}

src/Controls/src/Core/Platform/Tizen/Shell/ShellNavBar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async void UpdateMenuIcon()
265265
var provider = MauiContext.Services.GetRequiredService<IImageSourceServiceProvider>();
266266
var service = provider.GetRequiredImageSourceService(source);
267267

268-
await service.LoadImageAsync(source, _menuIcon);
268+
await service.GetImageAsync(source, _menuIcon);
269269
}
270270
_menuButton.SetIconPart(_menuIcon);
271271
_menuButton.Show();

src/Core/src/Handlers/BoxView/BoxViewHandler.Tizen.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Core/src/Handlers/Button/ButtonHandler.Tizen.cs

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Threading.Tasks;
23
using Tizen.UIExtensions.ElmSharp;
34

45
namespace Microsoft.Maui.Handlers
@@ -17,7 +18,6 @@ protected override void ConnectHandler(Button nativeView)
1718
nativeView.Released += OnButtonClicked;
1819
nativeView.Clicked += OnButtonReleased;
1920
nativeView.Pressed += OnButtonPressed;
20-
2121
base.ConnectHandler(nativeView);
2222
}
2323

@@ -26,32 +26,40 @@ protected override void DisconnectHandler(Button nativeView)
2626
nativeView.Released -= OnButtonClicked;
2727
nativeView.Clicked -= OnButtonReleased;
2828
nativeView.Pressed -= OnButtonPressed;
29-
3029
base.DisconnectHandler(nativeView);
3130
}
3231

33-
public static void MapText(ButtonHandler handler, IButton button)
32+
public static void MapText(IButtonHandler handler, IText button)
3433
{
35-
handler.NativeView?.UpdateText(button);
34+
handler.TypedNativeView?.UpdateText(button);
3635
}
3736

38-
public static void MapTextColor(ButtonHandler handler, IButton button)
37+
public static void MapTextColor(IButtonHandler handler, ITextStyle button)
3938
{
40-
handler.NativeView?.UpdateTextColor(button);
39+
handler.TypedNativeView?.UpdateTextColor(button);
4140
}
4241

43-
//TODO : Need to impl
44-
[MissingMapper]
45-
public static void MapImageSource(ButtonHandler handler, IButton image) { }
42+
public static void MapImageSource(IButtonHandler handler, IButton image) =>
43+
MapImageSourceAsync(handler, image).FireAndForget(handler);
44+
45+
public static Task MapImageSourceAsync(IButtonHandler handler, IButton image)
46+
{
47+
if (image.ImageSource == null)
48+
{
49+
return Task.CompletedTask;
50+
}
51+
52+
return handler.ImageSourceLoader.UpdateImageSourceAsync();
53+
}
4654

4755
[MissingMapper]
48-
public static void MapCharacterSpacing(ButtonHandler handler, IButton button) { }
56+
public static void MapCharacterSpacing(IButtonHandler handler, ITextStyle button) { }
4957

5058
[MissingMapper]
51-
public static void MapFont(ButtonHandler handler, IButton button) { }
59+
public static void MapFont(IButtonHandler handler, ITextStyle button) { }
5260

5361
[MissingMapper]
54-
public static void MapPadding(ButtonHandler handler, IButton button) { }
62+
public static void MapPadding(IButtonHandler handler, IButton button) { }
5563

5664
void OnButtonClicked(object? sender, EventArgs e)
5765
{
@@ -67,5 +75,11 @@ void OnButtonPressed(object? sender, EventArgs e)
6775
{
6876
VirtualView?.Pressed();
6977
}
78+
79+
void OnSetImageSource(Image? image)
80+
{
81+
NativeView.Image = image;
82+
VirtualView.ImageSourceLoaded();
83+
}
7084
}
7185
}

src/Core/src/Handlers/Button/ButtonHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
using NativeView = Google.Android.Material.Button.MaterialButton;
55
#elif WINDOWS
66
using NativeView = Microsoft.Maui.MauiButton;
7-
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID)
7+
#elif TIZEN
8+
using NativeView = Tizen.UIExtensions.ElmSharp.Button;
9+
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID && !TIZEN)
810
using NativeView = System.Object;
911
#endif
1012

src/Core/src/Handlers/Button/IButtonHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
using NativeView = Google.Android.Material.Button.MaterialButton;
55
#elif WINDOWS
66
using NativeView = Microsoft.Maui.MauiButton;
7-
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID)
7+
#elif TIZEN
8+
using NativeView = Tizen.UIExtensions.ElmSharp.Button;
9+
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID && !TIZEN)
810
using NativeView = System.Object;
911
#endif
1012

src/Core/src/Handlers/Image/IImageHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
using NativeView = Android.Widget.ImageView;
55
#elif WINDOWS
66
using NativeView = Microsoft.UI.Xaml.Controls.Image;
7-
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID)
7+
#elif TIZEN
8+
using NativeView = Tizen.UIExtensions.ElmSharp.Image;
9+
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID && !TIZEN)
810
using NativeView = System.Object;
911
#endif
1012

src/Core/src/Handlers/Image/ImageHandler.Tizen.cs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,46 @@ protected override Image CreateNativeView()
1818
protected override void DisconnectHandler(Image nativeView)
1919
{
2020
base.DisconnectHandler(nativeView);
21-
_sourceManager.Reset();
21+
SourceLoader.Reset();
2222
}
2323

2424
public override bool NeedsContainer =>
2525
VirtualView?.Background != null ||
2626
VirtualView?.Clip != null ||
2727
base.NeedsContainer;
2828

29-
public static void MapBackground(ImageHandler handler, IImage image)
29+
public static void MapBackground(IImageHandler handler, IImage image)
3030
{
3131
handler.UpdateValue(nameof(IViewHandler.ContainerView));
3232
handler.GetWrappedNativeView()?.UpdateBackground(image);
3333
}
3434

35-
public static void MapAspect(ImageHandler handler, IImage image) =>
36-
handler.NativeView?.UpdateAspect(image);
35+
public static void MapAspect(IImageHandler handler, IImage image) =>
36+
handler.TypedNativeView?.UpdateAspect(image);
3737

38-
public static void MapIsAnimationPlaying(ImageHandler handler, IImage image) =>
39-
handler.NativeView?.UpdateIsAnimationPlaying(image);
38+
public static void MapIsAnimationPlaying(IImageHandler handler, IImage image) =>
39+
handler.TypedNativeView?.UpdateIsAnimationPlaying(image);
4040

41-
public static void MapSource(ImageHandler handler, IImage image) =>
41+
public static void MapSource(IImageHandler handler, IImage image) =>
4242
MapSourceAsync(handler, image).FireAndForget(handler);
4343

44-
public static async Task MapSourceAsync(ImageHandler handler, IImage image)
44+
public static async Task MapSourceAsync(IImageHandler handler, IImage image)
4545
{
4646
if (handler.NativeView == null)
4747
return;
4848

49-
var token = handler._sourceManager.BeginLoad();
49+
// TODO : fix it later
50+
//return handler.SourceLoader.UpdateImageSourceAsync();
5051

52+
var token = handler.SourceLoader.SourceManager.BeginLoad();
5153
var provider = handler.GetRequiredService<IImageSourceServiceProvider>();
52-
var result = await handler.NativeView.UpdateSourceAsync(image, provider, token);
54+
var result = await handler.TypedNativeView.UpdateSourceAsync(image, provider, token);
55+
handler.SourceLoader.SourceManager.CompleteLoad(result);
56+
}
5357

54-
handler._sourceManager.CompleteLoad(result);
58+
void OnSetImageSource(Image? obj)
59+
{
60+
//Empty on purpose
5561
}
5662
}
5763

src/Core/src/Handlers/Image/ImageHandler.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
using NativeView = Android.Widget.ImageView;
77
#elif WINDOWS
88
using NativeView = Microsoft.UI.Xaml.Controls.Image;
9-
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID)
9+
#elif TIZEN
10+
using NativeView = Tizen.UIExtensions.ElmSharp.Image;
11+
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID && !TIZEN)
1012
using NativeView = System.Object;
1113
#endif
1214

@@ -16,7 +18,7 @@ public partial class ImageHandler : IImageHandler
1618
{
1719
public static IPropertyMapper<IImage, IImageHandler> Mapper = new PropertyMapper<IImage, IImageHandler>(ViewHandler.ViewMapper)
1820
{
19-
#if __ANDROID__
21+
#if __ANDROID__ || TIZEN
2022
[nameof(IImage.Background)] = MapBackground,
2123
#endif
2224
[nameof(IImage.Aspect)] = MapAspect,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using ElmSharp;
5+
using TImage = Tizen.UIExtensions.ElmSharp.Image;
6+
7+
namespace Microsoft.Maui.Handlers
8+
{
9+
//TODO: Need to impl
10+
public partial class ImageButtonHandler : ViewHandler<IImageButton, TImage>
11+
{
12+
protected override TImage CreateNativeView() => throw new NotImplementedException();
13+
14+
void OnSetImageSource(TImage? obj)
15+
{
16+
throw new NotImplementedException();
17+
}
18+
}
19+
}

src/Core/src/Handlers/ImageButton/ImageButtonHandler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
#elif WINDOWS
1111
using NativeImage = Microsoft.UI.Xaml.Media.ImageSource;
1212
using NativeView = Microsoft.UI.Xaml.FrameworkElement;
13-
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID)
13+
#elif TIZEN
14+
using NativeImage = Tizen.UIExtensions.ElmSharp.Image;
15+
using NativeView = Tizen.UIExtensions.ElmSharp.Image;
16+
#elif NETSTANDARD || (NET6_0 && !IOS && !ANDROID && !TIZEN)
1417
using NativeView = System.Object;
1518
using NativeImage = System.Object;
1619
#endif
@@ -44,6 +47,8 @@ public ImageButtonHandler(IPropertyMapper mapper) : base(mapper ?? Mapper)
4447
UI.Xaml.Controls.Image IImageHandler.TypedNativeView => (UI.Xaml.Controls.Image)NativeView.Content;
4548
#elif __ANDROID__
4649
Android.Widget.ImageView IImageHandler.TypedNativeView => NativeView;
50+
#elif TIZEN
51+
Tizen.UIExtensions.ElmSharp.Image IImageHandler.TypedNativeView => NativeView;
4752
#else
4853
object IImageHandler.TypedNativeView => NativeView;
4954
#endif
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System;
2+
using Tizen.UIExtensions.ElmSharp;
3+
4+
namespace Microsoft.Maui.Handlers
5+
{
6+
public partial class IndicatorViewHandler : ViewHandler<IIndicatorView, IndicatorView>
7+
{
8+
protected override IndicatorView CreateNativeView()
9+
{
10+
_ = NativeParent ?? throw new ArgumentNullException(nameof(NativeParent));
11+
return new IndicatorView(NativeParent);
12+
}
13+
14+
protected override void ConnectHandler(IndicatorView nativeView)
15+
{
16+
base.ConnectHandler(nativeView);
17+
NativeView.SelectedPosition += OnSelectedPosition;
18+
}
19+
20+
protected override void DisconnectHandler(IndicatorView nativeView)
21+
{
22+
base.DisconnectHandler(nativeView);
23+
NativeView.SelectedPosition -= OnSelectedPosition;
24+
}
25+
26+
public static void MapCount(IndicatorViewHandler handler, IIndicatorView indicator)
27+
{
28+
handler.NativeView.UpdateIndicatorCount(indicator);
29+
}
30+
31+
public static void MapPosition(IndicatorViewHandler handler, IIndicatorView indicator)
32+
{
33+
handler.NativeView.UpdatePosition(indicator);
34+
}
35+
36+
//TODO : Need to impl
37+
[MissingMapper]
38+
public static void MapHideSingle(IndicatorViewHandler handler, IIndicatorView indicator) { }
39+
40+
[MissingMapper]
41+
public static void MapMaximumVisible(IndicatorViewHandler handler, IIndicatorView indicator) { }
42+
43+
[MissingMapper]
44+
public static void MapIndicatorSize(IndicatorViewHandler handler, IIndicatorView indicator) { }
45+
46+
[MissingMapper]
47+
public static void MapIndicatorColor(IndicatorViewHandler handler, IIndicatorView indicator) { }
48+
49+
[MissingMapper]
50+
public static void MapSelectedIndicatorColor(IndicatorViewHandler handler, IIndicatorView indicator) { }
51+
52+
[MissingMapper]
53+
public static void MapIndicatorShape(IndicatorViewHandler handler, IIndicatorView indicator) { }
54+
55+
void OnSelectedPosition(object? sender, SelectedPositionChangedEventArgs e)
56+
{
57+
VirtualView.Position = e.SelectedPosition;
58+
}
59+
}
60+
}

src/Core/src/Handlers/NavigationPage/NavigationViewHandler.Tizen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Microsoft.Maui.Handlers
1515
{
16-
internal partial class NavigationViewHandler :
16+
public partial class NavigationViewHandler :
1717
ViewHandler<INavigationView, Naviframe>, INativeViewHandler
1818
{
1919
readonly List<Widget> _naviItemContentPartList = new List<Widget>();

0 commit comments

Comments
 (0)