-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathStructuredItemsViewHandler.Android.cs
More file actions
36 lines (30 loc) · 1.26 KB
/
StructuredItemsViewHandler.Android.cs
File metadata and controls
36 lines (30 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#nullable disable
using System;
using System.Collections.Generic;
using System.Text;
using AndroidX.RecyclerView.Widget;
namespace Microsoft.Maui.Controls.Handlers.Items
{
public partial class StructuredItemsViewHandler<TItemsView> : ItemsViewHandler<TItemsView> where TItemsView : StructuredItemsView
{
protected override IItemsLayout GetItemsLayout() => VirtualView.ItemsLayout;
protected override StructuredItemsViewAdapter<TItemsView, IItemsViewSource> CreateAdapter() => new(VirtualView);
public static void MapHeaderTemplate(StructuredItemsViewHandler<TItemsView> handler, StructuredItemsView itemsView)
{
}
public static void MapFooterTemplate(StructuredItemsViewHandler<TItemsView> handler, StructuredItemsView itemsView)
{
}
public static void MapItemsLayout(StructuredItemsViewHandler<TItemsView> handler, StructuredItemsView itemsView)
{
if (handler.PlatformView is IMauiRecyclerView<TItemsView> recyclerView)
{
recyclerView.UpdateAdapter();
recyclerView.UpdateScrollingMode();
recyclerView.UpdateLayoutManager();
}
}
public static void MapItemSizingStrategy(StructuredItemsViewHandler<TItemsView> handler, StructuredItemsView itemsView)
=> (handler.PlatformView as IMauiRecyclerView<TItemsView>)?.UpdateAdapter();
}
}