зеркало из https://github.com/DeGsoft/maui-linux.git
Merge branch '3.6.0' into 4.0.0
This commit is contained in:
Коммит
1e68249a0d
|
@ -381,6 +381,10 @@ namespace Xamarin.Forms.Platform.Android
|
|||
while (IsLayoutRequested)
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(1));
|
||||
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
cycle++;
|
||||
|
||||
if (cycle >= 10)
|
||||
|
@ -541,4 +545,4 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
bool IScrollView.ScrollBarsInitialized { get; set; } = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
var handler = new PropertyChangedEventHandler(OnMenuItemPropertyChanged);
|
||||
|
||||
_tableView = tableView;
|
||||
SetupSelection(tableView);
|
||||
|
||||
if (_cell != null)
|
||||
{
|
||||
|
@ -641,7 +640,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
return null;
|
||||
}
|
||||
|
||||
static void SetupSelection(UITableView table)
|
||||
internal static void SetupSelection(UITableView table)
|
||||
{
|
||||
if (table.GestureRecognizers == null)
|
||||
return;
|
||||
|
@ -722,4 +721,4 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using Xamarin.Forms.Internals;
|
||||
|
||||
|
@ -74,6 +75,19 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
}
|
||||
}
|
||||
|
||||
internal static UIModalPresentationStyle ToNativeModalPresentationStyle(this PlatformConfiguration.iOSSpecific.UIModalPresentationStyle style)
|
||||
{
|
||||
switch (style)
|
||||
{
|
||||
case PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.FormSheet:
|
||||
return UIModalPresentationStyle.FormSheet;
|
||||
case PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.FullScreen:
|
||||
return UIModalPresentationStyle.FullScreen;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(style));
|
||||
}
|
||||
}
|
||||
|
||||
internal static UIReturnKeyType ToUIReturnKeyType(this ReturnType returnType)
|
||||
{
|
||||
switch (returnType)
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Xamarin.Forms
|
|||
static bool? s_isiOS9OrNewer;
|
||||
static bool? s_isiOS10OrNewer;
|
||||
static bool? s_isiOS11OrNewer;
|
||||
static bool? s_isiOS13OrNewer;
|
||||
static bool? s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden;
|
||||
#endif
|
||||
|
||||
|
@ -69,6 +70,16 @@ namespace Xamarin.Forms
|
|||
}
|
||||
}
|
||||
|
||||
internal static bool IsiOS13OrNewer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!s_isiOS13OrNewer.HasValue)
|
||||
s_isiOS13OrNewer = UIDevice.CurrentDevice.CheckSystemVersion(13, 0);
|
||||
return s_isiOS13OrNewer.Value;
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool RespondsToSetNeedsUpdateOfHomeIndicatorAutoHidden
|
||||
{
|
||||
get
|
||||
|
@ -341,4 +352,4 @@ namespace Xamarin.Forms
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
_modal = modal;
|
||||
|
||||
var elementConfiguration = modal.Element as IElementConfiguration<Page>;
|
||||
if (elementConfiguration?.On<PlatformConfiguration.iOS>().ModalPresentationStyle() == PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.FormSheet)
|
||||
ModalPresentationStyle = UIKit.UIModalPresentationStyle.FormSheet;
|
||||
var modalPresentationStyle = elementConfiguration?.On<PlatformConfiguration.iOS>()?.ModalPresentationStyle() ?? PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.FullScreen;
|
||||
ModalPresentationStyle = modalPresentationStyle.ToNativeModalPresentationStyle();
|
||||
|
||||
View.BackgroundColor = UIColor.White;
|
||||
View.AddSubview(modal.ViewController.View);
|
||||
|
|
|
@ -944,6 +944,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
protected ListView List;
|
||||
protected ITemplatedItemsView<Cell> TemplatedItemsView => List;
|
||||
bool _isDragging;
|
||||
bool _setupSelection;
|
||||
bool _selectionFromNative;
|
||||
bool _disposed;
|
||||
bool _wasEmpty;
|
||||
|
@ -999,6 +1000,19 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
_isDragging = true;
|
||||
}
|
||||
|
||||
void SetupSelection(UITableViewCell nativeCell, UITableView tableView)
|
||||
{
|
||||
if (!(nativeCell is ContextActionsCell))
|
||||
return;
|
||||
|
||||
if (_setupSelection)
|
||||
return;
|
||||
|
||||
ContextActionsCell.SetupSelection(tableView);
|
||||
|
||||
_setupSelection = true;
|
||||
}
|
||||
|
||||
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
Cell cell;
|
||||
|
@ -1036,6 +1050,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
else
|
||||
throw new NotSupportedException();
|
||||
|
||||
SetupSelection(nativeCell, tableView);
|
||||
|
||||
if (List.IsSet(Specifics.SeparatorStyleProperty))
|
||||
{
|
||||
if (List.OnThisPlatform().GetSeparatorStyle() == SeparatorStyle.FullWidth)
|
||||
|
|
|
@ -174,19 +174,39 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
base.ViewDidLayoutSubviews();
|
||||
|
||||
if (View.Subviews.Length < 2)
|
||||
bool layoutMaster = false;
|
||||
bool layoutDetails = false;
|
||||
|
||||
if (Forms.IsiOS13OrNewer)
|
||||
{
|
||||
layoutMaster = _masterController?.View?.Superview != null;
|
||||
layoutDetails = _detailController?.View?.Superview != null;
|
||||
}
|
||||
else if (View.Subviews.Length < 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
layoutMaster = true;
|
||||
layoutDetails = true;
|
||||
}
|
||||
|
||||
var detailsBounds = _detailController.View.Frame;
|
||||
var masterBounds = _masterController.View.Frame;
|
||||
if (layoutMaster)
|
||||
{
|
||||
var masterBounds = _masterController.View.Frame;
|
||||
_masterWidth = (nfloat)Math.Max(_masterWidth, masterBounds.Width);
|
||||
|
||||
_masterWidth = (nfloat)Math.Max(_masterWidth, masterBounds.Width);
|
||||
if (!masterBounds.IsEmpty)
|
||||
MasterDetailPage.MasterBounds = new Rectangle(0, 0, _masterWidth, masterBounds.Height);
|
||||
}
|
||||
|
||||
if (!masterBounds.IsEmpty)
|
||||
MasterDetailPage.MasterBounds = new Rectangle(0, 0, _masterWidth, masterBounds.Height);
|
||||
|
||||
if (!detailsBounds.IsEmpty)
|
||||
MasterDetailPage.DetailBounds = new Rectangle(0, 0, detailsBounds.Width, detailsBounds.Height);
|
||||
if (layoutDetails)
|
||||
{
|
||||
var detailsBounds = _detailController.View.Frame;
|
||||
if (!detailsBounds.IsEmpty)
|
||||
MasterDetailPage.DetailBounds = new Rectangle(0, 0, detailsBounds.Width, detailsBounds.Height);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ViewDidLoad()
|
||||
|
|
Загрузка…
Ссылка в новой задаче