-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(listview): [iOS] [Android] Support ItemsPresenter.MinHeight
Match Windows' behavior when ItemsPresenter.MinHeight (or MinWidth for horizontal-scrolling list) is set inside of a ListView or GridView. Since the ItemsPresenter is actually outside the scrollable container (NativeListViewBase), this is implemented by mapping the MinHeight value to the native layout calculated by VirtualizingPanelLayout. This supports scenarios where a minimal scrollable extent, regardless of number of items, is desired. (cherry picked from commit 6dfc251) # Conflicts: # src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.Measure.cs
- Loading branch information
1 parent
162dee5
commit 486e8eb
Showing
8 changed files
with
243 additions
and
9 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
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
14 changes: 14 additions & 0 deletions
14
src/Uno.UI/UI/Xaml/Controls/ItemsControl/ItemsPresenter.iOSAndroid.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,14 @@ | ||
#if __IOS__ || __ANDROID__ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Linq; | ||
|
||
namespace Windows.UI.Xaml.Controls | ||
{ | ||
partial class ItemsPresenter : ILayoutOptOut | ||
{ | ||
public bool ShouldUseMinSize => !(_itemsPanel is NativeListViewBase); | ||
} | ||
} | ||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Windows.UI.Xaml | ||
{ | ||
/// <summary> | ||
/// Uno-specific interface that allows controls to specify that particular properties should be ignored by the shared layouting, eg for | ||
/// compatibility when a native template is used. | ||
/// </summary> | ||
internal interface ILayoutOptOut | ||
{ | ||
bool ShouldUseMinSize { get; } | ||
} | ||
} |