-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(effectiveviewport): [iOS] The SCP is now flagged as ScrollHost
- Loading branch information
Showing
16 changed files
with
248 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Uno.UI/UI/Xaml/Controls/Layouter/ISetLayoutSlots.iOS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Uno.UI.UI.Xaml.Controls.Layouter | ||
{ | ||
internal interface ISetLayoutSlots | ||
{ | ||
// On iOS lots of elements does not use the Layouter to measure themselves and their children, | ||
// doing this the are bypassing some important steps, including setting LayoutInformation.LayoutSlot. | ||
|
||
// This marker interface is designed to flag elements that does not use the Layouter, | ||
// but which are still taking care to update that LayoutInformation.LayoutSlot for its children. | ||
// (The LayoutSlot is set by parent on its children !). | ||
|
||
// This is to avoid massive refactoring of existing elements and MUST NOT be used in new development, | ||
// use the Layouter instead! | ||
|
||
// Note: For future dev, we might need to add an equivalent marker interface like IUseLayouter! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.Native.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using Windows.Foundation; | ||
using Uno.UI.Extensions; | ||
|
||
#if !UNO_HAS_MANAGED_SCROLL_PRESENTER && !__WASM__ | ||
|
||
namespace Windows.UI.Xaml.Controls | ||
{ | ||
// This file only contains support of NativeScrollContentPresenter | ||
|
||
partial class ScrollContentPresenter | ||
{ | ||
internal INativeScrollContentPresenter Native { get; set; } | ||
|
||
private object RealContent => Native?.Content; | ||
|
||
#region SCP to Native SCP | ||
public ScrollBarVisibility NativeHorizontalScrollBarVisibility | ||
{ | ||
set | ||
{ | ||
if (Native is { } native) | ||
{ | ||
native.HorizontalScrollBarVisibility = value; | ||
} | ||
} | ||
} | ||
|
||
public ScrollBarVisibility NativeVerticalScrollBarVisibility | ||
{ | ||
set | ||
{ | ||
if (Native is { } native) | ||
{ | ||
native.VerticalScrollBarVisibility = value; | ||
} | ||
} | ||
} | ||
|
||
public bool CanHorizontallyScroll | ||
{ | ||
get => Native?.CanHorizontallyScroll ?? false; | ||
set | ||
{ | ||
if (Native is { } native) | ||
{ | ||
native.CanHorizontallyScroll = value; | ||
} | ||
} | ||
} | ||
|
||
public bool CanVerticallyScroll | ||
{ | ||
get => Native?.CanVerticallyScroll ?? false; | ||
set | ||
{ | ||
if (Native is { } native) | ||
{ | ||
native.CanVerticallyScroll = value; | ||
} | ||
} | ||
} | ||
#endregion | ||
|
||
#region Native SCP to SCP | ||
internal void OnNativeScroll(double horizontalOffset, double verticalOffset, bool isIntermediate) | ||
{ | ||
Scroller?.OnPresenterScrolled(horizontalOffset, verticalOffset, isIntermediate); | ||
|
||
ScrollOffsets = new Point(horizontalOffset, verticalOffset); | ||
InvalidateViewport(); | ||
} | ||
|
||
internal void OnNativeZoom(float zoomFactor) | ||
{ | ||
Scroller?.OnPresenterZoomed(zoomFactor); | ||
} | ||
#endregion | ||
} | ||
} | ||
#endif |
Oops, something went wrong.