Xamarin.Forms 2.4.0.74863

DavidOrtinauDavidOrtinau USForum Administrator, Xamarin Team, Insider, University Xamurai
edited November 13 in Xamarin.Forms Releases

We've published a service release to our current stable release of Xamarin.Forms, version 2.4.0.74863.

Builds are now being generated from Visual Studio Team Services which is why we have a new build number "74863".

Release Notes

If you have a bug to report, drop us a detailed report here so we can investigate.

«1345

Posts

  • rogiheerogihee NLMember ✭✭✭

    I think PR 1151 needs to be merged in order for the FastRenderers and Android AppCompat to be usable.

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    Finally stable release :smile: . No longer pre in my project.
    Great work!

  • JKayJKay USMember ✭✭✭

    @rogihee That PR says it was merged 7 days ago. Wouldn't that mean it is included in this release?

  • DnielBugaDnielBuga USMember ✭✭

    @JKay said:
    @rogihee That PR says it was merged 7 days ago. Wouldn't that mean it is included in this release?

    No, unfortunately it does not. It was merged into master, not into the 2.4.0 branch.

  • JKayJKay USMember ✭✭✭
    edited September 28

    Quick Questions:

    Question 1

    If I have a CustomRenderer like so:

    ExtendedLabelRenderer : LabelRenderer

    do I need to change it to:

    ExtendedLabelRenderer : FastLabelRenderer

    Question 2

    Can someone expand upon this:

    Breaking Change: [Core] ListViewCachingStrategy.RecycleElement now has a prerequisite that each DataTemplate must return the same type of ViewCell. For example, given a ListView with a DataTemplateSelector that can return either MyDataTemplateA (where MyDataTemplateA returns a ViewCell of type MyViewCellA), or MyDataTemplateB (where MyDataTemplateB returns a ViewCell of type MyViewCellB), when MyDataTemplateA is returned, then MyDataTemplateA must return MyViewCellA, else an exception will be thrown.

    I can't quite understand what it means? maybe a real world example?

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    @JKay said:
    Quick Questions:

    Question 1

    If I have a CustomRenderer like so:

    ExtendedLabelRenderer : LabelRenderer

    do I need to change it to:

    ExtendedLabelRenderer : FastLabelRenderer

    First of all, you can't because FastRenderes are internal classes currently - i.e. - https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/FastRenderers/LabelRenderer.cs

  • JKayJKay USMember ✭✭✭

    @NamyslawSzymaniuk Good spot.

    So does this mean any custom controls like ExtendedLabelRenderer wont be using fastrenderers, or am I misunderstanding how fast renderers work?

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    To be honest, I have no idea, but most probably is that currently, it's not possible to extend Fast Renderers (would be possible in future).

    Also remember, that if your app uses "default" (not customized) controls, Fast Renderers are disabled by default - https://developer.xamarin.com/releases/xamarin-forms/xamarin-forms-2.4/2.4.0-stable/ - to enable it, it's needed to invoke Forms.SetFlags("FastRenderers_Experimental"); in OnCreate.

  • rogiheerogihee NLMember ✭✭✭

    Yes, but that creates an error if the Activity is "restarted" (user closes screen and comes back to the app).

    The FastRenderers are marked internal because I assume they first want to stabilize the API. AFAICR there were some differences between the different platfrom renderers and they frist want to harmonize that and then update the fastrenderers for that API and then mark them public.

  • rogiheerogihee NLMember ✭✭✭
    edited September 28

    I created 59816 for the OnCreate crash with FastRenderers

  • DavidDancyDavidDancy AUMember ✭✭✭✭

    @DavidOrtinau + team:

    There is a serious regression in the XAML loader:

    https://bugzilla.xamarin.com/show_bug.cgi?id=59818

    TL;DR:

    I have a simple form where I bind the ColumnDefinition of a Grid to a value in the Application's ResourceDictionary, like so:

    <ColumnDefinition Width="{StaticResource NumberColumnWidth}" /> <!-- test -->
    

    This binding worked fine in 2.3.4.237 and previous.

    After upgrading to 2.4.0.280, the binding fails with a runtime exception as the form is being loaded:

    Xamarin.Forms.Xaml.XamlParseException: Position 30:24. Cannot assign property "Width": Property does not exists, or is not assignable, or mismatching type between value and property

    Interestingly, the form displays fine in the Preview window of VS Mac.

    Repro project is attached to the bug report and an early fix would be much appreciated as the bug is blocking further work on the affected app.

  • JohnHardmanJohnHardman GBUniversity ✭✭✭✭✭
    edited September 28

    @DavidOrtinau

    Regarding:

    “Behavior change: Using the new AutomationProperties may impact UI Test execution on Android. AutomationId, Name, and HelpText will all set the native ContentDescription property, with Name and/or HelpText taking precedence over AutomationId (Name and HelpText will be concatenated). This means that any tests looking for AutomationId will now fail if Name and/or HelpText are also set on that element. To work around this issue, please alter your UI Tests to look for the value of Name/HelpText in this scenario.”

    Am I reading this right – that for any view that has been made accessible by providing help text etc., AutomationId is now effectively useless? And that as help text will be translated for different languages, that automated tests now have to actually look for specific, localised text, rather than using a functional, invariant, AutomationId, such that automated tests and the apps under tests will now need to share resource files to be practical?

    If that's the case, I'm glad I put my automated UI test creation on hold a while back, until UITest supports UWP. BTW - is there any update on UWP support in UITest?

    [Edit: The blog at https://blog.xamarin.com/accessbility-xamarin-forms/ says "an element such as Slider will read a combination of the Hint and Name values". If the Name value is read, that means both Name and Help Text may be read to the user. So where previously, we might have generated AutomationId algorithmically to create a unique AutomationId where elements are added to a page dynamically (e.g. an ObservableCollection used with a ListView), now we may have to re-structure our UI to wrap each repeating accessible element of a collection in another view, simply so that our automated UI tests can search for Name and/or HelpText within a smaller scope (the extra view) that is guaranteed to not contain elements with the same Name and/or HelpText. Whilst not the end of the world, adding further nesting to a UI to support automated testing is going to cause a dilemma when performance is an issue.]

  • JohnHardmanJohnHardman GBUniversity ✭✭✭✭✭

    @DavidOrtinau

    Regarding:

    "Behavior change: Calling Focus on a Picker on WinRT/UWP will now open the drop down."

    I'm guessing this is trying to make behavior consistent across platforms. However, IMHO this is degrading the UI on Windows, rather than improving it. And making behavior consistent where that goes against expected behavior on a platform is something that Xamarin have previously made a point of not doing (which is why, amongst others, bug https://bugzilla.xamarin.com/show_bug.cgi?id=28621 is still outstanding 2.5 years after it was logged).

    I'm guessing changing the behavior again is out of the question? If so, can we get another property on Picker, DatePicker and TimePicker, that specifies the desired behavior when focus if given to the view?

  • JohnHardmanJohnHardman GBUniversity ✭✭✭✭✭

    @DavidOrtinau

    Regarding:

    "Breaking Change: [Core] ListViewCachingStrategy.RecycleElement now has a prerequisite that each DataTemplate must return the same type of ViewCell. For example, given a ListView with a DataTemplateSelector that can return either MyDataTemplateA (where MyDataTemplateA returns a ViewCell of type MyViewCellA), or MyDataTemplateB (where MyDataTemplateB returns a ViewCell of type MyViewCellB), when MyDataTemplateA is returned, then MyDataTemplateA must return MyViewCellA, else an exception will be thrown."

    Perhaps it's me, but I find that unclear. What is it supposed to say after "then"? That MyDataTemplateA must always return MyViewCellA, and MyDataTemplateB must always return MyViewCellB? Or something else?

  • PaulDiPietroPaulDiPietro USXamarin Team Xamurai

    @JohnHardman said:
    @DavidOrtinau

    Regarding:

    "Behavior change: Calling Focus on a Picker on WinRT/UWP will now open the drop down."

    I'm guessing this is trying to make behavior consistent across platforms. However, IMHO this is degrading the UI on Windows, rather than improving it. And making behavior consistent where that goes against expected behavior on a platform is something that Xamarin have previously made a point of not doing (which is why, amongst others, bug https://bugzilla.xamarin.com/show_bug.cgi?id=28621 is still outstanding 2.5 years after it was logged).

    I'm guessing changing the behavior again is out of the question? If so, can we get another property on Picker, DatePicker and TimePicker, that specifies the desired behavior when focus if given to the view?

    @JohnHardman This was reverted entirely for various reasons and shouldn't be in the notes.

  • JohnHardmanJohnHardman GBUniversity ✭✭✭✭✭

    @PaulDiPietro - I must buy you a beer :-)

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    @DavidDancy said:
    @DavidOrtinau + team:

    There is a serious regression in the XAML loader:

    https://bugzilla.xamarin.com/show_bug.cgi?id=59818

    TL;DR:

    I have a simple form where I bind the ColumnDefinition of a Grid to a value in the Application's ResourceDictionary, like so:

    <ColumnDefinition Width="{StaticResource NumberColumnWidth}" /> <!-- test -->
    

    This binding worked fine in 2.3.4.237 and previous.

    After upgrading to 2.4.0.280, the binding fails with a runtime exception as the form is being loaded:

    Xamarin.Forms.Xaml.XamlParseException: Position 30:24. Cannot assign property "Width": Property does not exists, or is not assignable, or mismatching type between value and property

    Interestingly, the form displays fine in the Preview window of VS Mac.

    Repro project is attached to the bug report and an early fix would be much appreciated as the bug is blocking further work on the affected app.

    I've just checked my app code, and I'm using:
    <ColumnDefinition Width="{StaticResource DetailsListItemSwipeWidth}"/>
    18 times in XAML, as I'm using it as a definition of Telerik RadListView swipe icon width.

    Static value is defined in App.xaml, as:
    <GridLength x:Key="DetailsListItemSwipeWidth">100</GridLength>

    And I didn't faced any issues at 2.4.0.275-pre3 NOR at 2.4.0.280. It's compiling correctly for me - I've updated XF nuget to 2.4.0.280 today morning, and during whole dev day, I've cleaned/built/rebuilt app maany times without any isse.
    I'm using latest stable release of VS 2017 Enterprise.

  • MalcolmJackMalcolmJack USMember ✭✭
    edited September 28

    just a heads up: I was getting a mass of these errors:
    "Duplicate 'Compile' items were included" & "Duplicate 'EmbeddedResource' items were included errors.

    Turns out it was fixes I had made to my .csproj files because of this bug:
    https://bugzilla.xamarin.com/show_bug.cgi?id=55591

    Removed the ItemGroup with the None Remove=***.xaml entry, and all compiles again :)

  • BrightLeeBrightLee KRMember ✭✭✭

    Thank for all Xamarin team.
    It's more stable than any versions.
    I'm really happy to use it.

  • VincentwxVincentwx CAMember ✭✭

    Has the template been changed to create a .net standard 2.0 based solution when you create a new Xamarin.Forms app?

  • DavidDancyDavidDancy AUMember ✭✭✭✭

    @NamyslawSzymaniuk The difference between your code and mine is that mine uses x:Double in the ResourceDictionary whereas you're using (perhaps more correctly) GridLength.

    The issue for me is that this is a regression because in 2.3.4.237 my code worked fine. Upgrading to 2.4.0.280 broke it.

    It's acceptable (just!) if I have to go through my resource dictionaries and change x:Double to GridLength where it's being used for column widths. However since this is a breaking change I would have expected something to be in the release notes about it, but I found nothing.

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭
    edited September 29

    @DavidDancy well, you are right. I can't remeber when (with which XF/Telerik versions) I used first time definition, but I DO remember, that I also have some build/runtime error, when I tried to simply define my Width as x:Double.

  • PhilippSumiPhilippSumi USMember ✭✭✭
    edited September 29

    Installed and initial tests are looking good! Thanks for a solid realease!

    I'm noticing one thing though: I'm using a custom control to render "links", basically tappable labels. The control is just a ContentView with an attached tap recognizer, and contain a grid with labels and optionally icons. I noticed that hit testing recognition is aweful - I have to tap my labels multiple times until the associated tap command eventually fires. This something change with regards to hit testing and paddings/margins around the content?

    Correction: This is much worse I think. It appears that if I tap a tiny bit longer, or my tap is a "micro-swipe", the tap recognizer doesn't fire. The recognition is seriously off here...

  • sgirouxsgiroux CAMember

    As for the ListViewCachingStrategy changes, you guys should update this page:
    h t t p s://developer.xamarin.com/guides/xamarin-forms/user-interface/listview/performance/

  • EmmanuelVazquezEmmanuelVazquez USMember ✭✭

    @PhilippSumi said:
    Installed and initial tests are looking good! Thanks for a solid realease!

    I'm noticing one thing though: I'm using a custom control to render "links", basically tappable labels. The control is just a ContentView with an attached tap recognizer, and contain a grid with labels and optionally icons. I noticed that hit testing recognition is aweful - I have to tap my labels multiple times until the associated tap command eventually fires. This something change with regards to hit testing and paddings/margins around the content?

    Correction: This is much worse I think. It appears that if I tap a tiny bit longer, or my tap is a "micro-swipe", the tap recognizer doesn't fire. The recognition is seriously off here...

    We had this issue with previous prereleases, our issue was on droid. We solved it by remove our use of setSingleLine in our custom droid label renderer. idk if that helps.

  • PhilippSumiPhilippSumi USMember ✭✭✭
    edited September 29

    @EmmanuelVazquez It's indeed Android. There's no custom renderers involved in my case though.
    Edit: Created ticket at https://bugzilla.xamarin.com/show_bug.cgi?id=59863

  • DavidOrtinauDavidOrtinau USForum Administrator, Xamarin Team, Insider, University Xamurai

    Service Release is up to address the Fast Renderer OnCreate issue, PR 1151. Please keep the bugzilla reports coming.

    We're looking into tap gesture reports.

  • DavidOrtinauDavidOrtinau USForum Administrator, Xamarin Team, Insider, University Xamurai

    @DavidDancy thanks. Stephane update the ticket and he's looking at it.

  • DanielRobbinsDanielRobbins USMember ✭✭

    Ooh, I found a nasty bug -- at least for my app! Take any input elements (Picker, Entry, etc.) that are initially created off-screen, in my case inside a RelativeLayout that is initially positioned off-screen. Now use TranslateTo() to animate the RelativeLayout, so that it glides from the off-screen area so that it is now fully visible. This is a nice effect that I am using in an app. When you do this, the input elements will not be able to receive any input from the user. They will be unelectable by touch, etc. I imagine in the Forms code that the off-screen input elements are being tagged as not able to receive input, but they are not getting reconsidered for input after translation. Confirmed on both Android and iOS -- so appears to be a Forms issue. It may not be specific to just this exact release but has cropped in recently, because this used to work.

  • DanielRobbinsDanielRobbins USMember ✭✭

    OK, looking more at the issue and I think the issue may be with Grid not working correctly. I think I have a pretty simple grid:

    this._grid = new Grid
                {
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    RowDefinitions =
                    {
                        new RowDefinition { Height = new GridLength(7, GridUnitType.Star) },
                        new RowDefinition { Height = new GridLength(3, GridUnitType.Star) },
                        new RowDefinition { Height = new GridLength(30, GridUnitType.Absolute) }
                    },
                    ColumnDefinitions =
                    {
                        new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }
                    },
                    RowSpacing = 0,
                    ColumnSpacing = 0
                };
    

    Using this._grid.Children.Add(obj, row, rowspan, col, colspan) I set System.ArgumentOutOfRange exception (parameter 'bottom') using the following values:

            _grid.Children.Add(_map, 0, 1, 0, 2);
            _grid.Children.Add(_slidein_layout, 0, 1, 0, 2);
            _grid.Children.Add(_static_layout, 0, 1, 1, 1);
    

    Now, the pop-up definition of this method in Visual Studio says the position arguments are (left, right, top, bottom) so presumably I have the rows and columns mixed up, but if I swap the first two arguments with the last two, I get an out-of-range exception as well (on parameter 'left):

            _grid.Children.Add(_map, 0, 2, 0, 1);
            _grid.Children.Add(_slidein_layout, 0, 2, 0, 1);
            _grid.Children.Add(_static_layout, 1, 1, 0, 1);
    

    Either I am extremely confused or one of these should work. I have read the following posts as well:

    forums.xamarin.com/discussion/21950/set-column-span-by-using-grid-children-add-from-source-code
    www.xrmcoaches.com/2015/03/xamarin-forms-solving-the-mystery-of-grid-children-addleftrighttopbottom/

  • DanielRobbinsDanielRobbins USMember ✭✭
    edited October 2

    I think the above issue plus some lack of clarity on the behavior of InputTransparent (does it transfer to children?) may have been the source of the original issue. Specifically, if you have two StackLayouts aligned so that one is perfectly on top of the other, and the top StackLayout has InputTransparent set to true, yet it has a GestureRecognizer inside it on a child element, then I would expect the GestureRecognizer to still be able to capture input if you click within the bounds of the child element, but if you click anywhere else within the top StackLayout, the input should fall to the StackLayout below the the top StackLayout. However, it looks like the top StackLayout will occlude input elements in the lower StackLayout regardless of the top StackLayout's InputTransparent setting.

  • Hi, just updated my project to use xamarin 2.4 now. Some how my android views are not correctly working, just the title bar is shown but no content. UWP seems fine, iOS not tested. Do I need to do something else?

  • DavidOrtinauDavidOrtinau USForum Administrator, Xamarin Team, Insider, University Xamurai

    @DanielRobbins looking into your report. Did you get it working by adjusting InputTransparent?

    @NicolaiSchnberg.2424 maybe you've already done this, but please confirm you've updated all references to Xamarin.Forms in your solution to the same version. Then clean and delete the bin/obj folders before retesting. Let's make sure we are totally clean. If this issue persists, please share a project and open an issue for us on Bugzilla.

  • DanielRobbinsDanielRobbins USMember ✭✭
    edited October 2

    @DavidOrtinau no I did not. It appears that even if the StackLayout is visually transparent (meaning it contains no children in a particular area that are visually occluding the StackLayout underneath) and has InputTransparent set on itself, it will block input elements in a StackLayout below it. Also see the Grid issue I reported one comment above. Thanks :)

  • I've made a request in the Xamarin Evolution to make the new 2.4 Android FormsEditText class more extendable.
    Behavior when pressing the device back button inside a Entry changed when upgrading to 2.4.0.282. Now the Entry looses focus instead of going back from the NavigationPage.

  • maxbromomaxbromo IDMember ✭✭

    As mentioned by @rogihee, there seems to be a problem with appCompat.
    E.g. this code (which is advocated by https: //xamarinhelp.com/accommodate-on-screen-keyboard-xamarin-forms/ and seems to quite widely used based on a quick google) returns null:

    var statusBarHeightInfo = typeof(FormsAppCompatActivity).GetField("_statusBarHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

    Had to revert to 2.3.4.270 to avoid this.

  • PaulBrennerPaulBrenner USUniversity ✭✭

    Can you guys please update the docs when you make breaking changes.
    https://developer.xamarin.com/guides/xamarin-forms/platform-features/device/ still says to use Device.Windows

  • DavidOrtinauDavidOrtinau USForum Administrator, Xamarin Team, Insider, University Xamurai

    @PaulBrenner yes, it's on the way.

    Anytime you do see those discrepancies, please hit the "I have a problem" button and open an issue for the docs team.

  • DavidOrtinauDavidOrtinau USForum Administrator, Xamarin Team, Insider, University Xamurai

    @DanielRobbins please file reports for us and supply a project so we can expedite troubleshooting.

    @maxbromo we published a service release to address the SetFlags issue with AppCompat. Issue 59816 PR 1151 . I'm not clear how that's related to your issue though. Please confirm the service release doesn't fix your issue, and file a report on Bugzilla with code for us to troubleshoot.

«1345
Sign In or Register to comment.