Skip to content

Commit 14ca8a9

Browse files
committed
Bump to latest (#71)
- Window lifecycle (dotnet#1754) - Move New Navigation Handler to Core and make it internal (dotnet#1800) - Scrollview handler (dotnet#1669) - ScrollView Resize + Window Handler Resize (dotnet#1676) - Font AutoScalingEnabled (dotnet#1774) - Rename Font Properties (dotnet#1755) - Update layout system to ensure native measure/arrange are called for all controls, even from Page subclasses (dotnet#1819) - IContainer as IList<IView> (dotnet#1724) - Implement Layout padding for new StackLayouts and GridLayout (dotnet#1749) - Delete all the TabIndex, TabStop, Focusable things! (dotnet#1777) - Introduce SetSemanticFocus API via SemanticExtensions (dotnet#1829) - Improve Window and AnimationManager (dotnet#1653) - And so on
1 parent 38c3e88 commit 14ca8a9

30 files changed

+686
-457
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Microsoft.Maui.Hosting;
2+
using Microsoft.Maui.LifecycleEvents;
3+
using Microsoft.Maui.Controls.Compatibility;
4+
5+
namespace Microsoft.Maui.Controls.Hosting
6+
{
7+
public static partial class AppHostBuilderExtensions
8+
{
9+
internal static IAppHostBuilder ConfigureCompatibilityLifecycleEvents(this IAppHostBuilder builder) =>
10+
builder.ConfigureLifecycleEvents(events => events.AddTizen(OnConfigureLifeCycle));
11+
12+
static void OnConfigureLifeCycle(ITizenLifecycleBuilder tizen)
13+
{
14+
tizen.OnPreCreate((app) =>
15+
{
16+
// This is the initial Init to set up any system services registered by
17+
// Forms.Init(). This happens before any UI has appeared.
18+
// This creates a dummy MauiContext.
19+
20+
var services = MauiApplication.Current.Services;
21+
MauiContext mauiContext = new MauiContext(services, CoreUIAppContext.GetInstance(MauiApplication.Current));
22+
ActivationState state = new ActivationState(mauiContext);
23+
Forms.Init(state, new InitializationOptions(MauiApplication.Current) { Flags = InitializationFlags.SkipRenderers, DisplayResolutionUnit = DisplayResolutionUnit.DP() });
24+
})
25+
.OnMauiContextCreated((mauiContext) =>
26+
{
27+
// This is the final Init that sets up the real context from the application.
28+
29+
var state = new ActivationState(mauiContext!);
30+
Forms.Init(state);
31+
});
32+
}
33+
}
34+
}

src/Compatibility/Core/src/AppHostBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.iOS.Platform.DefaultRenderer;
3636
#elif TIZEN
3737
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
38+
using Microsoft.Maui.Graphics.Skia;
3839
using BoxRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.BoxViewRenderer;
3940
using CollectionViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StructuredItemsViewRenderer;
4041
using OpenGLViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;

src/Compatibility/Core/src/Compatibility.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@
2222
<ItemGroup>
2323
<Compile Remove="GTK\**" />
2424
<Compile Remove="MacOS\**" />
25-
<Compile Remove="Tizen\**" />
2625
<Compile Remove="WPF\**" />
2726
<EmbeddedResource Remove="GTK\**" />
2827
<EmbeddedResource Remove="MacOS\**" />
29-
<EmbeddedResource Remove="Tizen\**" />
3028
<EmbeddedResource Remove="WPF\**" />
3129
<None Remove="GTK\**" />
3230
<None Remove="MacOS\**" />
33-
<None Remove="Tizen\**" />
3431
<None Remove="WPF\**" />
3532
<Content Remove="GTK\**" />
3633
<Content Remove="MacOS\**" />

src/Compatibility/Core/src/Tizen/HandlerToRendererShim.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ public void SetVirtualView(Maui.IElement view)
176176
{
177177
throw new NotImplementedException();
178178
}
179+
180+
public void Invoke(string command, object args)
181+
{
182+
throw new NotImplementedException();
183+
}
179184
}
180185

181186
}

src/Compatibility/Core/src/Tizen/Renderers/CarouselPageRenderer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ void OnInnerLayoutUpdate()
173173

174174
void OnCurrentPageChanged(object sender, EventArgs e)
175175
{
176-
CustomFocusManager.StartReorderTabIndex();
177-
178176
Element.UpdateFocusTreePolicy();
179177

180178
if (IsChangedByScroll())

src/Compatibility/Core/src/Tizen/Renderers/CustomFocusManager.cs

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
99
{
1010
class CustomFocusManager : IDisposable
1111
{
12-
static bool s_reorderTriggered;
13-
static readonly ObservableCollection<CustomFocusManager> s_tabIndexList = new ObservableCollection<CustomFocusManager>();
14-
1512
VisualElement _nextUp;
1613
VisualElement _nextDown;
1714
VisualElement _nextLeft;
1815
VisualElement _nextRight;
1916
VisualElement _nextForward;
2017
VisualElement _nextBackward;
21-
int _tabIndex = -1;
22-
bool _isTabStop = true;
2318

2419
static CustomFocusManager()
2520
{
26-
s_tabIndexList.CollectionChanged += TabIndexCollectionChanged;
2721
}
2822

2923
public CustomFocusManager(VisualElement element, Widget nativeView)
@@ -40,52 +34,6 @@ public CustomFocusManager(VisualElement element, Widget nativeView)
4034
VisualElement Element { get; }
4135
Widget NativeView { get; }
4236

43-
public int TabIndex
44-
{
45-
get
46-
{
47-
return _tabIndex;
48-
}
49-
set
50-
{
51-
if (IsTabStop)
52-
{
53-
if (_tabIndex > -1)
54-
{
55-
s_tabIndexList.Remove(this);
56-
}
57-
if (value > -1)
58-
{
59-
s_tabIndexList.Add(this);
60-
}
61-
}
62-
_tabIndex = value;
63-
}
64-
}
65-
66-
public bool IsTabStop
67-
{
68-
get
69-
{
70-
return _isTabStop;
71-
}
72-
set
73-
{
74-
if (TabIndex > -1)
75-
{
76-
if (_isTabStop)
77-
{
78-
s_tabIndexList.Remove(this);
79-
}
80-
if (value)
81-
{
82-
s_tabIndexList.Add(this);
83-
}
84-
}
85-
_isTabStop = value;
86-
}
87-
}
88-
8937
public VisualElement NextUp
9038
{
9139
get => _nextUp;
@@ -152,23 +100,6 @@ public void Dispose()
152100
GC.SuppressFinalize(this);
153101
}
154102

155-
public static void StartReorderTabIndex()
156-
{
157-
if (Device.IsInvokeRequired)
158-
{
159-
Device.BeginInvokeOnMainThread(() =>
160-
{
161-
StartReorderTabIndex();
162-
});
163-
return;
164-
}
165-
if (!s_reorderTriggered)
166-
{
167-
s_reorderTriggered = true;
168-
Device.BeginInvokeOnMainThread(ReorderTabIndex);
169-
}
170-
}
171-
172103
protected virtual void Dispose(bool disposing)
173104
{
174105
if (disposing)
@@ -198,10 +129,6 @@ protected virtual void Dispose(bool disposing)
198129
NextBackward.PropertyChanged -= OnNextViewPropertyChanged;
199130
}
200131
}
201-
if (s_tabIndexList.Contains(this))
202-
{
203-
s_tabIndexList.Remove(this);
204-
}
205132
}
206133

207134
void SetUpFocus(VisualElement next, FocusDirection direction)
@@ -251,36 +178,6 @@ FocusDirection GetFocusDirection(VisualElement nextView)
251178
return FocusDirection.Next;
252179
}
253180

254-
static void ReorderTabIndex()
255-
{
256-
s_reorderTriggered = false;
257-
var list = s_tabIndexList.Where((t) => t.IsTabStop && ElementIsVisible(t)).OrderBy(x => x.Element.TabIndex);
258-
CustomFocusManager first = null;
259-
CustomFocusManager last = null;
260-
foreach (var item in list)
261-
{
262-
if (first == null)
263-
first = item;
264-
265-
if (last != null)
266-
{
267-
item.NextBackward = last.Element;
268-
last.NextForward = item.Element;
269-
}
270-
last = item;
271-
}
272-
if (first != null && last != null)
273-
{
274-
first.NextBackward = last.Element;
275-
last.NextForward = first.Element;
276-
}
277-
}
278-
279-
static void TabIndexCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
280-
{
281-
StartReorderTabIndex();
282-
}
283-
284181
static bool PageIsVisible(Page page)
285182
{
286183
if (page == null)

src/Compatibility/Core/src/Tizen/Renderers/EntryRenderer.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,7 @@ void OnTextChanged(object sender, EventArgs e)
121121

122122
void OnCompleted(object sender, EventArgs e)
123123
{
124-
if (Element.ReturnType == ReturnType.Next)
125-
{
126-
FocusSearch(true)?.SetFocus(true);
127-
}
128-
else
129-
{
130-
Control.SetFocus(false);
131-
}
124+
Control.SetFocus(false);
132125
((IEntryController)Element).SendCompleted();
133126
}
134127

src/Compatibility/Core/src/Tizen/Renderers/FlyoutPageRenderer.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ void UpdateDetail(bool isInit)
141141

142142
void UpdateIsPresented()
143143
{
144-
// To update TabIndex order
145-
CustomFocusManager.StartReorderTabIndex();
146-
147144
_flyoutPage.IsPresented = Element.IsPresented;
148145
}
149146

src/Compatibility/Core/src/Tizen/Renderers/MasterDetailPageRenderer.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ void UpdateDetailPage(bool isInit)
146146

147147
void UpdateIsPresented()
148148
{
149-
// To update TabIndex order
150-
CustomFocusManager.StartReorderTabIndex();
151-
152149
_mdpage.IsPresented = Element.IsPresented;
153150
}
154151

src/Compatibility/Core/src/Tizen/Renderers/TabbedPageRenderer.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ void OnToolbarItemSelected(object sender, EToolbarItemEventArgs e)
417417

418418
void OnCurrentPageChanged()
419419
{
420-
// To update TabIndex order
421-
CustomFocusManager.StartReorderTabIndex();
422-
423420
if (_isUpdateByScroller || _isUpdateByToolbar || !_isInitialized)
424421
return;
425422

0 commit comments

Comments
 (0)