-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
@@ -34,7 +34,9 @@ public static NumberKeyListener Create(InputTypes inputTypes) | |||
if ((inputTypes & InputTypes.NumberFlagDecimal) == 0) | |||
{ | |||
// If decimal isn't allowed, we can just use the Android version | |||
#pragma warning disable 0618 // Find issues with Android API usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which part of the next line is giving an obsolete warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On X.A 7.5.0.15 (Alpha channel at this time): 'DigitsKeyListener.GetInstance(bool, bool)' is obsolete
[Register ("getInstance", "(ZZ)Landroid/text/method/DigitsKeyListener;", ""), Obsolete ("deprecated")]
public unsafe static DigitsKeyListener GetInstance (bool sign, bool @decimal);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in master
public VisualElementPackager(IVisualElementRenderer renderer) | ||
VisualElement _element; | ||
|
||
IElementController ElementController => _element;// _renderer.Element as IElementController; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably remove this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
if (CompressedLayout.GetIsHeadless(child)) { | ||
child.IsPlatformEnabled = true; | ||
FillChildrenWithRenderers(child); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a tab on the next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -13,16 +13,20 @@ public class VisualElementPackager : IDisposable | |||
|
|||
bool _isDisposed; | |||
|
|||
IElementController ElementController => Renderer.Element as IElementController; | |||
IElementController ElementController => _element;// Renderer.Element as IElementController; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably remove this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elegant!
public VisualElementPackager(IVisualElementRenderer renderer) | ||
VisualElement _element; | ||
|
||
IElementController ElementController => _element;// _renderer.Element as IElementController; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Xamarin.Forms.Core/Layout.cs
Outdated
@@ -237,6 +237,13 @@ protected void UpdateChildrenLayout() | |||
double w = Math.Max(0, width - Padding.HorizontalThickness); | |||
double h = Math.Max(0, height - Padding.VerticalThickness); | |||
|
|||
var isHeadless = CompressedLayout.GetIsHeadless(this); | |||
var headlessOffset = CompressedLayout.GetHeadlessOffset(this); | |||
for (var i = 0; i < LogicalChildrenInternal.Count; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces on their own lines. You're in Core territory, now! muwahaha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't scratch that itch! :)
fixed by removing the braces.
if (_childViews == null) | ||
_childViews = new List<IVisualElementRenderer>(); | ||
if (CompressedLayout.GetIsHeadless(view)) { | ||
var _packager = new VisualElementPackager(_renderer, view); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the underscore in the variable name is a little confusing here, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. at some point that variable was a field...
Are these limitations permanent or to be fixed in the future?
Should there be a compile-time / run-time error for this instead of silent fail of the bgcolor set? The reason I ask this is I don't like it when people pollute their visual tree with redundant stuff. If bgcolor has no use there, then it shouldn't be there? |
@adrianknight89 at this point we have no plan for supporting BgColor on headless layouts, nor do we have plans for validating that case |
@StephaneDelcroix thank you for this PR and this feature. Wondering, where can one read about limitations and why they are there. Maybe it's just me can't find the information |
Can we please have some more information on how to use this? |
@bentmar I'll have a blog out shortly with more samples, and then docs to come. Really any layout that you don't need a background on, doesn't transform, and doesn't accept gestures is a candidate. So just add |
Seems like this should be on by default, and only disabled when there's a background/transform/gesture/explicitly disabled? |
* Implement vertical accuracy in GeoLocation API (#1103) * Location: add property 'VerticalAccuracy' (#1099) * vertical accuracy is only available in Android API level 26 and above (#1099) * update Samples app to show vertical accuracy on GeolocationPage * add missing documentation bits for Location.VerticalAccuracy * .gitattributes: get better diff context for C# code (#1115) * Location.VerticalAccuracy: add runtime check for Android version (#1099) (#1116) * the compile-time check is not enough * it crashed on old Android versions (<8.0) * GH-1102 Fix launcher on older devices (#1120) * Update Launcher.ios.tvos.cs * OpenUrlAsync was introduced in iOS 10 not 12 https://docs.microsoft.com/en-us/dotnet/api/uikit.uiapplication.openurlasync?view=xamarin-ios-sdk-12 * Fix trailing whitespace * Really? fix whitespace * Really! Fix whitespace * Fixes #1129 - set empty required declarations on UWP (#1133) * Fixes #1129 - set empty required declarations on UWP * Update Permissions.uwp.cs * Update Xamarin.Essentials.csproj (#1136) * GH-1142 AccessBackgroundLocation only when compile & running Q (#1143) * AccessBackgroundLocation only when compile & running Q * put if compile check around permission * GH-1121 If VC is null use TraitCollection (#1144) * Fixes #1123 (#1126) * Update PlacemarkExtensions.xml (#1132) Co-authored-by: Janus Weil <janus@gcc.gnu.org> Co-authored-by: James Montemagno <james.montemagno@gmail.com> Co-authored-by: Michael <Michael@ZPF.fr>
* Implement vertical accuracy in GeoLocation API (#1103) * Location: add property 'VerticalAccuracy' (#1099) * vertical accuracy is only available in Android API level 26 and above (#1099) * update Samples app to show vertical accuracy on GeolocationPage * add missing documentation bits for Location.VerticalAccuracy * .gitattributes: get better diff context for C# code (#1115) * Location.VerticalAccuracy: add runtime check for Android version (#1099) (#1116) * the compile-time check is not enough * it crashed on old Android versions (<8.0) * GH-1102 Fix launcher on older devices (#1120) * Update Launcher.ios.tvos.cs * OpenUrlAsync was introduced in iOS 10 not 12 https://docs.microsoft.com/en-us/dotnet/api/uikit.uiapplication.openurlasync?view=xamarin-ios-sdk-12 * Fix trailing whitespace * Really? fix whitespace * Really! Fix whitespace * Fixes #1129 - set empty required declarations on UWP (#1133) * Fixes #1129 - set empty required declarations on UWP * Update Permissions.uwp.cs * Update Xamarin.Essentials.csproj (#1136) * GH-1142 AccessBackgroundLocation only when compile & running Q (#1143) * AccessBackgroundLocation only when compile & running Q * put if compile check around permission * GH-1121 If VC is null use TraitCollection (#1144) * Fixes #1123 (#1126) * Update PlacemarkExtensions.xml (#1132) Co-authored-by: Janus Weil <janus@gcc.gnu.org> Co-authored-by: James Montemagno <james.montemagno@gmail.com> Co-authored-by: Michael <Michael@ZPF.fr> Co-authored-by: Jonathan Dick <jodick@microsoft.com> Co-authored-by: Janus Weil <janus@gcc.gnu.org> Co-authored-by: Michael <Michael@ZPF.fr>
Description of Change
Enable Layout Compression for iOS and Android.
NOTE: this feature is still in beta, and opt-in only
Layout Compression allows the user to avoid creating renderers for Layouts (i.e. StackLayout, ContentView, ...).
Pros:
Cons:
Sample:
Enabling LayoutCompression for this layout only creates a Renderer for the page, and one for each label. The BackgroundColor property on the inner ContentView is ignored.
Bugs Fixed
/
API Changes
Added:
Behavioral Changes
/
PR Checklist