Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XF Upgrade 4.0 #416

Merged
merged 9 commits into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Packages.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.5.2" />
<PackageReference Update="FSharp.Data" Version="3.0.0" />
<PackageReference Update="Xamarin.Forms" Version="3.6.0.344457" />
<PackageReference Update="Xamarin.Forms.Platform.WPF" Version="3.6.0.344457" />
<PackageReference Update="Xamarin.Forms.Maps" Version="3.6.0.344457" />
<PackageReference Update="Xamarin.Forms" Version="4.0.0.425677" />
<PackageReference Update="Xamarin.Forms.Platform.WPF" Version="4.0.0.425677" />
<PackageReference Update="Xamarin.Forms.Maps" Version="4.0.0.425677" />
<PackageReference Update="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Update="FSharp.Compiler.Service" Version="25.0.1" />
<PackageReference Update="Dotnet.ProjInfo" Version="0.9.0" />
Expand Down
8 changes: 4 additions & 4 deletions extensions/Maps/Xamarin.Forms.Maps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module MapsExtension =
// inherited attributes common to all views
?horizontalOptions, ?verticalOptions, ?margin, ?gestureRecognizers, ?anchorX, ?anchorY, ?backgroundColor,
?heightRequest, ?inputTransparent, ?isEnabled, ?isVisible, ?minimumHeightRequest, ?minimumWidthRequest,
?opacity, ?rotation, ?rotationX, ?rotationY, ?scale, ?style, ?translationX, ?translationY, ?widthRequest,
?resources, ?styles, ?styleSheets, ?classId, ?styleId, ?automationId, ?created, ?styleClass) =
?opacity, ?rotation, ?rotationX, ?rotationY, ?scale, ?translationX, ?translationY, ?widthRequest,
?resources, ?styles, ?styleSheets, ?classId, ?styleId, ?automationId, ?created) =

// Count the number of additional attributes
let attribCount = 0
Expand All @@ -47,10 +47,10 @@ module MapsExtension =
?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent,
?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest,
?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation,
?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style,
?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale,
?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest,
?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId,
?automationId=automationId, ?created=created, ?styleClass=styleClass)
?automationId=automationId, ?created=created)

// Add our own attributes. They must have unique names which must match the names below.
match pins with None -> () | Some v -> attribs.Add(MapPinsAttribKey, v)
Expand Down
8 changes: 4 additions & 4 deletions extensions/OxyPlot/OxyPlot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module OxyPlotExtension =
// inherited attributes common to all views
?horizontalOptions, ?verticalOptions, ?margin, ?gestureRecognizers, ?anchorX, ?anchorY, ?backgroundColor, ?heightRequest,
?inputTransparent, ?isEnabled, ?isVisible, ?minimumHeightRequest, ?minimumWidthRequest, ?opacity,
?rotation, ?rotationX, ?rotationY, ?scale, ?style, ?translationX, ?translationY, ?widthRequest,
?resources, ?styles, ?styleSheets, ?classId, ?styleId, ?automationId, ?created, ?styleClass) =
?rotation, ?rotationX, ?rotationY, ?scale, ?translationX, ?translationY, ?widthRequest,
?resources, ?styles, ?styleSheets, ?classId, ?styleId, ?automationId, ?created) =

// Count the number of additional attributes
let attribCount = 1
Expand All @@ -36,10 +36,10 @@ module OxyPlotExtension =
?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent,
?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest,
?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation,
?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style,
?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale,
?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest,
?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId,
?automationId=automationId, ?created=created, ?styleClass=styleClass)
?automationId=automationId, ?created=created)

// Add our own attributes.
attribs.Add(ModelAttribKey, model)
Expand Down
6 changes: 3 additions & 3 deletions extensions/SkiaSharp/SkiaSharp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ module SkiaSharpExtension =
?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent,
?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest,
?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation,
?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style,
?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale,
?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest,
?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId,
?automationId=automationId, ?created=created, ?styleClass=styleClass)
?resources=resources, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId,
?automationId=automationId, ?created=created)

// Add our own attributes. They must have unique names which must match the names below.
match enableTouchEvents with None -> () | Some v -> attribs.Add(CanvasEnableTouchEventsAttribKey, v)
Expand Down
18 changes: 9 additions & 9 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ group neutral
github fsprojects/FSharp.Compiler.PortaCode:master tests/PortaCodeTests.fs

nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.6.0.344457
nuget Xamarin.Forms.Maps 3.6.0.344457
nuget Xamarin.Forms 4.0.0.425677
nuget Xamarin.Forms.Maps 4.0.0.425677
nuget SkiaSharp
nuget SkiaSharp.Views.Forms
nuget OxyPlot.Xamarin.Forms 1.0.0
Expand All @@ -42,7 +42,7 @@ group androidapp
framework: monoandroid71
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.6.0.344457
nuget Xamarin.Forms 4.0.0.425677
nuget Xamarin.Android.FSharp.ResourceProvider 1.0.0.25
nuget Xamarin.Android.Arch.Core.Common 1.0.0.1
nuget Xamarin.Android.Arch.Core.Runtime 1.0.0.1
Expand Down Expand Up @@ -73,32 +73,32 @@ group iosapp
framework: monotouch
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.6.0.344457
nuget Xamarin.Forms 4.0.0.425677
nuget Newtonsoft.Json 11.0.2
nuget FSharp.Data 3.0.0

group macosapp
framework: xamarinmac20
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.6.0.344457
nuget Xamarin.Forms 4.0.0.425677
nuget Newtonsoft.Json 11.0.2
nuget FSharp.Data 3.0.0

group wpfapp
framework: net472
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.6.0.344457
nuget Xamarin.Forms 4.0.0.425677
nuget Newtonsoft.Json 11.0.2
nuget Xamarin.Forms.Platform.WPF 3.6.0.344457
nuget Xamarin.Forms.Platform.WPF 4.0.0.425677
nuget FSharp.Data 3.0.0

group gtkapp
framework: net471
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.6.0.344457
nuget Xamarin.Forms 4.0.0.425677
nuget Newtonsoft.Json 11.0.2
nuget Xamarin.Forms.Platform.GTK 3.6.0.344457
nuget Xamarin.Forms.Platform.GTK 4.0.0.425677
nuget FSharp.Data 3.0.0
24 changes: 12 additions & 12 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ NUGET
Xamarin.Android.Support.v7.Palette (27.0.2.1)
Xamarin.Android.Support.v7.RecyclerView (27.0.2.1)
Xamarin.Android.Support.Vector.Drawable (27.0.2.1)
Xamarin.Forms (3.6.0.344457)
Xamarin.Forms (4.0.0.425677)

GROUP fakebuild
STORAGE: NONE
Expand Down Expand Up @@ -797,9 +797,9 @@ NUGET
FSharp.Data (3.0)
FSharp.Core (>= 4.0.0.1)
Newtonsoft.Json (11.0.2)
Xamarin.Forms (3.6.0.344457)
Xamarin.Forms.Platform.GTK (3.6.0.344457)
Xamarin.Forms (>= 3.6.0.344457)
Xamarin.Forms (4.0.0.425677)
Xamarin.Forms.Platform.GTK (4.0.0.425677)
Xamarin.Forms (>= 4.0.0.425677)

GROUP iosapp
RESTRICTION: == monotouch
Expand Down Expand Up @@ -936,7 +936,7 @@ NUGET
System.Xml.ReaderWriter (4.3.1)
System.Xml.XDocument (4.3)
System.Xml.XmlDocument (4.3)
Xamarin.Forms (3.6.0.344457)
Xamarin.Forms (4.0.0.425677)

GROUP macosapp
RESTRICTION: == xamarinmac
Expand Down Expand Up @@ -1073,7 +1073,7 @@ NUGET
System.Xml.ReaderWriter (4.3.1)
System.Xml.XDocument (4.3)
System.Xml.XmlDocument (4.3)
Xamarin.Forms (3.6.0.344457)
Xamarin.Forms (4.0.0.425677)

GROUP neutral
RESTRICTION: == netstandard2.0
Expand All @@ -1089,9 +1089,9 @@ NUGET
SkiaSharp.Views.Forms (1.68)
SkiaSharp (>= 1.68)
Xamarin.Forms (>= 3.3.0.912540)
Xamarin.Forms (3.6.0.344457)
Xamarin.Forms.Maps (3.6.0.344457)
Xamarin.Forms (>= 3.6.0.344457)
Xamarin.Forms (4.0.0.425677)
Xamarin.Forms.Maps (4.0.0.425677)
Xamarin.Forms (>= 4.0.0.425677)
GITHUB
remote: fsprojects/FSharp.Compiler.PortaCode
src/CodeModel.fs (0c6686bcc518246d879bb3d0e3cd4cdbbc72d5ad)
Expand All @@ -1111,8 +1111,8 @@ NUGET
OpenTK (3.0.1)
OpenTK.GLControl (3.0.1)
OpenTK (>= 3.0.1)
Xamarin.Forms (3.6.0.344457)
Xamarin.Forms.Platform.WPF (3.6.0.344457)
Xamarin.Forms (4.0.0.425677)
Xamarin.Forms.Platform.WPF (4.0.0.425677)
OpenTK (>= 2.0)
OpenTK.GLControl (>= 1.1.2349.61993)
Xamarin.Forms (>= 3.6.0.344457)
Xamarin.Forms (>= 4.0.0.425677)
50 changes: 26 additions & 24 deletions src/Fabulous.Core/ViewConverters.fs
Original file line number Diff line number Diff line change
Expand Up @@ -775,16 +775,7 @@ module Converters =
let prevArray = ValueOption.map seqToArray prevCollOpt
let currArray = ValueOption.map seqToArray collOpt
updateCollectionGeneric prevArray currArray target.Items create (fun _ _ _ -> ()) (fun _ _ -> true) updateChild

/// Update the menu items of a Shell, given previous and current view elements
let internal updateMenuItemsShell (prevCollOpt: seq<'T> voption) (collOpt: seq<'T> voption) (target: Xamarin.Forms.Shell) =
let create (desc: ViewElement) =
desc.Create() :?> Xamarin.Forms.MenuItem

let prevArray = ValueOption.map seqToArray prevCollOpt
let currArray = ValueOption.map seqToArray collOpt
updateCollectionGeneric prevArray currArray target.MenuItems create (fun _ _ _ -> ()) (fun _ _ -> true) updateChild


/// Update the menu items of a ShellContent, given previous and current view elements
let internal updateMenuItemsShellContent (prevCollOpt: seq<'T> voption) (collOpt: seq<'T> voption) (target: Xamarin.Forms.ShellContent) =
let create (desc: ViewElement) =
Expand All @@ -811,7 +802,31 @@ module Converters =
let prevArray = ValueOption.map seqToArray prevCollOpt
let currArray = ValueOption.map seqToArray collOpt
updateCollectionGeneric prevArray currArray target.Items create (fun _ _ _ -> ()) (fun _ _ -> true) updateChild


/// Update the IsFocusedProperty of a SearchHandler, given previous and current IsFocused
let internal updateIsFocused prevValue currValue (target: Xamarin.Forms.SearchHandler) =
match prevValue, currValue with
| ValueNone, ValueNone -> ()
| ValueSome prevVal, ValueSome newVal when prevVal = newVal -> ()
| _, ValueNone -> target.SetIsFocused(false)
| _, ValueSome newVal -> target.SetIsFocused(newVal)

/// Update the SelectedItemProperty of a SearchHandler, given previous and current SelectedItem
let internal updateSelectedItem prevValue currValue (target: Xamarin.Forms.SearchHandler) =
match prevValue, currValue with
| ValueNone, ValueNone -> ()
| ValueSome prevVal, ValueSome newVal when prevVal = newVal -> ()
| _, ValueNone -> target.ClearValue(Xamarin.Forms.SearchHandler.SelectedItemProperty)
| _, ValueSome newVal -> target.SetValue(Xamarin.Forms.SearchHandler.SelectedItemProperty, newVal)

/// Update the selectedItems of a SeletableItemsView, given previous and current view elements
let internal updateSelectedItems (prevCollOpt: seq<'T> voption) (collOpt: seq<'T> voption) (target: Xamarin.Forms.SelectableItemsView) =
let create (desc: ViewElement) = desc.Create()

let prevArray = ValueOption.map seqToArray prevCollOpt
let currArray = ValueOption.map seqToArray collOpt
updateCollectionGeneric prevArray currArray target.SelectedItems create (fun _ _ _ -> ()) (fun _ _ -> true) updateChild

/// Trigger ScrollView.ScrollToAsync if needed, given the current values
let internal triggerScrollToAsync (currValue: (float * float * AnimationKind) voption) (target: Xamarin.Forms.ScrollView) =
match currValue with
Expand Down Expand Up @@ -844,19 +859,6 @@ module Converters =
| NotAnimated -> false
target.GoToAsync(navigationState, animated) |> ignore
| _ -> ()

/// Trigger ShellSection.GoToAsync if needed, given the current values
let internal triggerSSGoToAsync (currValue: (string list * Map<string, string> * AnimationKind) voption) (target: Xamarin.Forms.ShellSection) =
match currValue with
| ValueSome (routes, queryData, animationKind) ->
let animated =
match animationKind with
| Animated -> true
| NotAnimated -> false
let lst = ResizeArray<string>()
lst.AddRange(routes)
target.GoToAsync(lst, queryData, animated) |> ignore
| _ -> ()

/// Check if two LayoutOptions are equal
let internal equalLayoutOptions (x:Xamarin.Forms.LayoutOptions) (y:Xamarin.Forms.LayoutOptions) =
Expand Down
2 changes: 1 addition & 1 deletion templates/content/blank/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"type": "parameter",
"dataType": "string",
"replaces": "XamarinFormsSdk",
"defaultValue": "3.6.0.344457"
"defaultValue": "4.0.0.425677"
},
"FabulousPkgsVersion": {
"type": "parameter",
Expand Down
2 changes: 1 addition & 1 deletion tests/Fabulous.Cli.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open FsUnit
open FSharp.Compiler.PortaCode.Tests.Basic// for TestHelpers

module Versions =
let XamarinForms = "3.6.0.344457"
let XamarinForms = "4.0.0.425677"
let NewtonsoftJson = "11.0.2"

[<TestClass>]
Expand Down
Loading