Skip to content

Commit 7fb235d

Browse files
committed
Bump to latest
- Apply to patch related to Animation (dotnet#1436) - Apply to register Microsoft.Maui.Graphics Platforms (dotnet#1441) - and so on.
1 parent 22afa03 commit 7fb235d

File tree

7 files changed

+92
-39
lines changed

7 files changed

+92
-39
lines changed

src/Compatibility/Core/src/Tizen/TizenPlatformServices.cs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Threading;
88
using System.Threading.Tasks;
99
using ElmSharp;
10+
using Microsoft.Maui.Animations;
1011
using Microsoft.Maui.Controls.Internals;
1112
using TAppControl = Tizen.Applications.AppControl;
1213
using Color = Microsoft.Maui.Graphics.Color;
@@ -22,42 +23,13 @@ public TizenPlatformServices()
2223
s_context = SynchronizationContext.Current;
2324
}
2425

25-
public class TizenTicker : Ticker
26-
{
27-
readonly Timer _timer;
28-
29-
public TizenTicker()
30-
{
31-
_timer = new Timer((object o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite);
32-
}
33-
34-
protected override void EnableTimer()
35-
{
36-
_timer.Change(16, 16);
37-
}
38-
39-
protected override void DisableTimer()
40-
{
41-
_timer.Change(-1, -1);
42-
}
43-
44-
void HandleElapsed(object state)
45-
{
46-
s_context.Post((o) => SendSignals(-1), null);
47-
}
48-
}
4926
#region IPlatformServices implementation
5027

5128
public void BeginInvokeOnMainThread(Action action)
5229
{
5330
s_context.Post((o) => action(), null);
5431
}
5532

56-
public Ticker CreateTicker()
57-
{
58-
return new TizenTicker();
59-
}
60-
6133
public void StartTimer(TimeSpan interval, Func<bool> callback)
6234
{
6335
Timer timer = null;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#nullable enable
2+
3+
using System;
4+
using System.Threading.Tasks;
5+
6+
namespace Microsoft.Maui.Controls.Platform
7+
{
8+
internal partial class ModalNavigationService
9+
{
10+
public Task<Page> PopModalAsync(bool animated)
11+
{
12+
// TODO: Need to implementation
13+
throw new NotImplementedException();
14+
}
15+
16+
public Task PushModalAsync(Page modal, bool animated)
17+
{
18+
// TODO: Need to implementation
19+
throw new NotImplementedException();
20+
}
21+
}
22+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System.Threading;
2+
using Tizen.Applications;
3+
4+
namespace Microsoft.Maui.Animations
5+
{
6+
public class NativeTicker : Ticker
7+
{
8+
readonly Timer _timer;
9+
readonly SynchronizationContext? _context;
10+
bool _isRunning;
11+
12+
public override bool IsRunning => _isRunning;
13+
14+
public NativeTicker()
15+
{
16+
if (SynchronizationContext.Current == null)
17+
{
18+
TizenSynchronizationContext.Initialize();
19+
}
20+
21+
_context = SynchronizationContext.Current;
22+
_timer = new Timer((object o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite);
23+
}
24+
25+
public override void Start()
26+
{
27+
_timer.Change(16, 16);
28+
_isRunning = true;
29+
}
30+
31+
public override void Stop()
32+
{
33+
_timer.Change(-1, -1);
34+
_isRunning = false;
35+
}
36+
37+
void HandleElapsed(object state)
38+
{
39+
_context?.Post((o) => Fire?.Invoke(), null);
40+
}
41+
}
42+
}

src/Core/src/LifecycleEvents/Tizen/TizenLifecycleExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ public LifecycleBuilder(ILifecycleBuilder builder)
2222
_builder = builder;
2323
}
2424

25-
public void AddEvent(string eventName, Delegate action) =>
25+
public void AddEvent<TDelegate>(string eventName, TDelegate action)
26+
where TDelegate : Delegate
27+
{
2628
_builder.AddEvent(eventName, action);
29+
}
2730
}
2831
}
2932
}

src/Core/src/Platform/Tizen/MauiApplication.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,38 @@ protected override void OnPreCreate()
2323
.Build();
2424

2525
Services = host.Services;
26-
Application = Services.GetRequiredService<IApplication>();
2726

28-
Current.Services?.InvokeLifecycleEvents<TizenLifecycle.OnPreCreate>(del => del(this));
27+
if (Services == null)
28+
throw new InvalidOperationException($"The {nameof(IServiceProvider)} instance was not found.");
29+
30+
Current.Services.InvokeLifecycleEvents<TizenLifecycle.OnPreCreate>(del => del(this));
2931
}
3032

3133
protected override void OnCreate()
3234
{
3335
base.OnCreate();
3436

35-
var services = MauiApplication.Current.Services;
36-
var mauiApp = MauiApplication.Current.Application;
37+
Application = Services.GetRequiredService<IApplication>();
38+
39+
if (Application == null)
40+
throw new InvalidOperationException($"The {nameof(IApplication)} instance was not found.");
3741

3842
MauiContext mauiContext;
3943
IWindow window;
4044

4145
var context = CoreUIAppContext.GetInstance(this);
4246

4347
// TODO Fix once we have multiple windows
44-
if (mauiApp.Windows.Count > 0)
48+
if (Application.Windows.Count > 0)
4549
{
46-
window = mauiApp.Windows[0];
47-
mauiContext = new MauiContext(services, context);
50+
window = Application.Windows[0];
51+
mauiContext = new MauiContext(Services, context);
4852
}
4953
else
5054
{
51-
mauiContext = new MauiContext(services, context);
55+
mauiContext = new MauiContext(Services, context);
5256
ActivationState state = new ActivationState(mauiContext);
53-
window = mauiApp.CreateWindow(state);
57+
window = Application.CreateWindow(state);
5458
}
5559

5660
var page = window.View;

src/Core/src/Platform/Tizen/Microsoft.Maui.Graphics.Skia/SkiaGraphicsService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,10 @@ public BitmapExportContext CreateBitmapExportContext(int width, int height, floa
9090
{
9191
return new SkiaBitmapExportContext(width, height, displayScale, 72, false);
9292
}
93+
94+
public RectangleF GetPathBounds(PathF path)
95+
{
96+
return path.GetBoundsByFlattening();
97+
}
9398
}
9499
}

src/Core/src/Platform/Tizen/ViewExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ public static void UpdateOpacity(this EvasObject nativeView, IView view)
6060
}
6161
}
6262

63+
public static void UpdateClip(this WrapperView nativeView, IView view)
64+
{
65+
nativeView.Clip = view.Clip;
66+
}
67+
6368
public static void UpdateAutomationId(this EvasObject nativeView, IView view)
6469
{
6570
{

0 commit comments

Comments
 (0)