From 3d9c394d2b47706f93920089faa22c8fea6ad6e5 Mon Sep 17 00:00:00 2001 From: Sergej Dick Date: Wed, 18 Dec 2019 10:34:33 +0100 Subject: [PATCH 01/11] first part --- .../Xamarin.Forms.Core.json | 63 ++++++------------- .../blank/.template.config/template.json | 2 +- Packages.targets | 10 +-- paket.dependencies | 32 +++++----- paket.lock | 52 +++++++-------- 5 files changed, 66 insertions(+), 93 deletions(-) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index d74e12f4a..7140ed3d3 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -1353,6 +1353,9 @@ }, { "source": "Source" + }, + { + "source": "IsAnimationPlaying" } ], "primaryConstructorMembers": [ @@ -1417,6 +1420,21 @@ }, { "source": "MaxLength" + }, + { + "source": "CharacterSpacing" + }, + { + "source": "Placeholder" + }, + { + "source": "PlaceholderColor" + }, + { + "source": "Text" + }, + { + "source": "TextColor" } ] }, @@ -1426,9 +1444,6 @@ { "source": "AutoSize" }, - { - "source": "CharacterSpacing" - }, { "source": "FontAttributes" }, @@ -1443,30 +1458,12 @@ { "source": "IsTextPredictionEnabled" }, - { - "source": "Placeholder" - }, - { - "source": "PlaceholderColor" - }, - { - "source": "Text" - }, - { - "source": "TextColor" - } ], "events": [ { "source": "Completed", "inputType": "string -> unit", "convertInputToModel": "ViewConverters.makeEditorCompletedEventHandler" - }, - { - "source": "TextChanged", - "relatedProperties": [ - "Text" - ] } ], "primaryConstructorMembers": [ @@ -1476,9 +1473,6 @@ { "type": "Xamarin.Forms.Entry", "properties": [ - { - "source": "CharacterSpacing" - }, { "source": "ClearButtonVisibility" }, @@ -1506,12 +1500,6 @@ { "source": "IsTextPredictionEnabled" }, - { - "source": "Placeholder" - }, - { - "source": "PlaceholderColor" - }, { "source": "ReturnCommand" }, @@ -1522,12 +1510,6 @@ "source": "SelectionLength", "updateCode": "ViewUpdaters.updateEntrySelectionLength" }, - { - "source": "Text" - }, - { - "source": "TextColor" - }, { "source": "VerticalTextAlignment" } @@ -1537,12 +1519,6 @@ "source": "Completed", "inputType": "string -> unit", "convertInputToModel": "ViewConverters.makeEntryCompletedEventHandler" - }, - { - "source": "TextChanged", - "relatedProperties": [ - "Text" - ] } ], "primaryConstructorMembers": [ @@ -1696,9 +1672,6 @@ { "source": "ItemsLayout" }, - { - "source": "NumberOfSideItems" - }, { "source": "PeekAreaInsets" }, diff --git a/Fabulous.XamarinForms/templates/content/blank/.template.config/template.json b/Fabulous.XamarinForms/templates/content/blank/.template.config/template.json index e853bab35..38b96acb2 100644 --- a/Fabulous.XamarinForms/templates/content/blank/.template.config/template.json +++ b/Fabulous.XamarinForms/templates/content/blank/.template.config/template.json @@ -156,7 +156,7 @@ "type": "parameter", "dataType": "string", "replaces": "XamarinFormsSdk", - "defaultValue": "4.3.0.908675" + "defaultValue": "4.4.0.991265" }, "FabulousPkgsVersion": { "type": "parameter", diff --git a/Packages.targets b/Packages.targets index 780ba317f..63c569bd5 100644 --- a/Packages.targets +++ b/Packages.targets @@ -2,11 +2,11 @@ - - - - - + + + + + diff --git a/paket.dependencies b/paket.dependencies index b90f2b2ea..b7b897ac6 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -30,8 +30,8 @@ group neutral github fsprojects/FSharp.Compiler.PortaCode:master tests/PortaCodeTests.fs nuget FSharp.Core 4.6.2 - nuget Xamarin.Forms 4.3.0.908675 - nuget Xamarin.Forms.Maps 4.3.0.908675 + nuget Xamarin.Forms 4.4.0.991265 + nuget Xamarin.Forms.Maps 4.4.0.991265 nuget Newtonsoft.Json 11.0.2 nuget Dotnet.ProjInfo nuget FSharp.Compiler.Service @@ -52,8 +52,8 @@ group androidapp framework: monoandroid90 source https://api.nuget.org/v3/index.json nuget FSharp.Core 4.6.2 - nuget Xamarin.Forms 4.3.0.908675 - nuget Xamarin.Forms.Maps 4.3.0.908675 + nuget Xamarin.Forms 4.4.0.991265 + nuget Xamarin.Forms.Maps 4.4.0.991265 nuget Xamarin.Android.FSharp.ResourceProvider 1.0.0.28 nuget Newtonsoft.Json 11.0.2 nuget FSharp.Data 3.3.2 @@ -73,8 +73,8 @@ group iosapp framework: monotouch source https://api.nuget.org/v3/index.json nuget FSharp.Core 4.6.2 - nuget Xamarin.Forms 4.3.0.908675 - nuget Xamarin.Forms.Maps 4.3.0.908675 + nuget Xamarin.Forms 4.4.0.991265 + nuget Xamarin.Forms.Maps 4.4.0.991265 nuget Newtonsoft.Json 11.0.2 nuget FSharp.Data 3.3.2 nuget Xamarin.Essentials 1.3.1 @@ -92,8 +92,8 @@ group macosapp framework: xamarinmac20 source https://api.nuget.org/v3/index.json nuget FSharp.Core 4.6.2 - nuget Xamarin.Forms 4.3.0.908675 - nuget Xamarin.Forms.Maps 4.3.0.908675 + nuget Xamarin.Forms 4.4.0.991265 + nuget Xamarin.Forms.Maps 4.4.0.991265 nuget Newtonsoft.Json 11.0.2 nuget FSharp.Data 3.3.2 nuget Xamarin.Essentials 1.3.1 @@ -110,10 +110,10 @@ group wpfapp framework: net472 source https://api.nuget.org/v3/index.json nuget FSharp.Core 4.6.2 - nuget Xamarin.Forms 4.3.0.908675 - nuget Xamarin.Forms.Platform.WPF 4.3.0.908675 - nuget Xamarin.Forms.Maps 4.3.0.908675 - nuget Xamarin.Forms.Maps.WPF 4.3.0.908675 + nuget Xamarin.Forms 4.4.0.991265 + nuget Xamarin.Forms.Platform.WPF 4.4.0.991265 + nuget Xamarin.Forms.Maps 4.4.0.991265 + nuget Xamarin.Forms.Maps.WPF 4.4.0.991265 nuget Newtonsoft.Json 11.0.2 nuget FSharp.Data 3.3.2 nuget Xamarin.Essentials 1.3.1 @@ -131,10 +131,10 @@ group gtkapp framework: net471 source https://api.nuget.org/v3/index.json nuget FSharp.Core 4.6.2 - nuget Xamarin.Forms 4.3.0.908675 - nuget Xamarin.Forms.Platform.GTK 4.3.0.908675 - nuget Xamarin.Forms.Maps 4.3.0.908675 - nuget Xamarin.Forms.Maps.GTK 4.3.0.908675 + nuget Xamarin.Forms 4.4.0.991265 + nuget Xamarin.Forms.Platform.GTK 4.4.0.991265 + nuget Xamarin.Forms.Maps 4.4.0.991265 + nuget Xamarin.Forms.Maps.GTK 4.4.0.991265 nuget Newtonsoft.Json 11.0.2 nuget FSharp.Data 3.3.2 nuget Xamarin.Essentials 1.3.1 diff --git a/paket.lock b/paket.lock index 06b3580c6..60417755c 100644 --- a/paket.lock +++ b/paket.lock @@ -237,15 +237,15 @@ NUGET Xamarin.FFImageLoading.Forms (2.4.11.982) Xamarin.FFImageLoading (>= 2.4.11.982) Xamarin.Forms (>= 3.3.0.912540) - Xamarin.Forms (4.3.0.908675) + Xamarin.Forms (4.4.0.991265) Xamarin.Android.Support.CustomTabs (>= 28.0.0.3) Xamarin.Android.Support.Design (>= 28.0.0.3) Xamarin.Android.Support.v4 (>= 28.0.0.3) Xamarin.Android.Support.v7.AppCompat (>= 28.0.0.3) Xamarin.Android.Support.v7.CardView (>= 28.0.0.3) - Xamarin.Forms.Maps (4.3.0.908675) + Xamarin.Forms.Maps (4.4.0.991265) Xamarin.Android.Support.v7.AppCompat (>= 28.0.0.3) - Xamarin.Forms (>= 4.3.0.908675) + Xamarin.Forms (>= 4.4.0.991265) Xamarin.GooglePlayServices.Maps (>= 60.1142.1) Xamarin.Forms.PancakeView (1.3.6) Xamarin.Forms (>= 3.6.0.220655) @@ -1016,17 +1016,17 @@ NUGET Xamarin.FFImageLoading.Forms (2.4.11.982) Xamarin.FFImageLoading (>= 2.4.11.982) Xamarin.Forms (>= 3.3.0.912540) - Xamarin.Forms (4.3.0.908675) - Xamarin.Forms.Maps (4.3.0.908675) - Xamarin.Forms (>= 4.3.0.908675) - Xamarin.Forms.Maps.GTK (4.3.0.908675) - Xamarin.Forms (>= 4.3.0.908675) - Xamarin.Forms.Maps (>= 4.3.0.908675) + Xamarin.Forms (4.4.0.991265) + Xamarin.Forms.Maps (4.4.0.991265) + Xamarin.Forms (>= 4.4.0.991265) + Xamarin.Forms.Maps.GTK (4.4.0.991265) + Xamarin.Forms (>= 4.4.0.991265) + Xamarin.Forms.Maps (>= 4.4.0.991265) Xamarin.Forms.PancakeView (1.3.6) Xamarin.Forms (>= 3.6.0.220655) - Xamarin.Forms.Platform.GTK (4.3.0.908675) + Xamarin.Forms.Platform.GTK (4.4.0.991265) OpenTK (>= 3.0.1) - Xamarin.Forms (>= 4.3.0.908675) + Xamarin.Forms (>= 4.4.0.991265) GROUP iosapp RESTRICTION: == monotouch @@ -1202,9 +1202,9 @@ NUGET Xamarin.FFImageLoading.Forms (2.4.11.982) Xamarin.FFImageLoading (>= 2.4.11.982) Xamarin.Forms (>= 3.3.0.912540) - Xamarin.Forms (4.3.0.908675) - Xamarin.Forms.Maps (4.3.0.908675) - Xamarin.Forms (>= 4.3.0.908675) + Xamarin.Forms (4.4.0.991265) + Xamarin.Forms.Maps (4.4.0.991265) + Xamarin.Forms (>= 4.4.0.991265) Xamarin.Forms.PancakeView (1.3.6) NETStandard.Library (>= 1.6.1) Xamarin.Forms (>= 3.6.0.220655) @@ -1245,9 +1245,9 @@ NUGET Xamarin.FFImageLoading.Forms (2.4.11.982) Xamarin.FFImageLoading (>= 2.4.11.982) Xamarin.Forms (>= 3.3.0.912540) - Xamarin.Forms (4.3.0.908675) - Xamarin.Forms.Maps (4.3.0.908675) - Xamarin.Forms (>= 4.3.0.908675) + Xamarin.Forms (4.4.0.991265) + Xamarin.Forms.Maps (4.4.0.991265) + Xamarin.Forms (>= 4.4.0.991265) Xamarin.Forms.PancakeView (1.3.6) Xamarin.Forms (>= 3.6.0.220655) @@ -1559,9 +1559,9 @@ NUGET Xamarin.FFImageLoading.Forms (2.4.11.982) Xamarin.FFImageLoading (>= 2.4.11.982) Xamarin.Forms (>= 3.3.0.912540) - Xamarin.Forms (4.3.0.908675) - Xamarin.Forms.Maps (4.3.0.908675) - Xamarin.Forms (>= 4.3.0.908675) + Xamarin.Forms (4.4.0.991265) + Xamarin.Forms.Maps (4.4.0.991265) + Xamarin.Forms (>= 4.4.0.991265) Xamarin.Forms.PancakeView (1.3.6) Xamarin.Forms (>= 3.6.0.220655) GITHUB @@ -1640,14 +1640,14 @@ NUGET Xamarin.FFImageLoading.Forms (2.4.11.982) Xamarin.FFImageLoading (>= 2.4.11.982) Xamarin.Forms (>= 3.3.0.912540) - Xamarin.Forms (4.3.0.908675) - Xamarin.Forms.Maps (4.3.0.908675) - Xamarin.Forms (>= 4.3.0.908675) - Xamarin.Forms.Maps.WPF (4.3.0.908675) + Xamarin.Forms (4.4.0.991265) + Xamarin.Forms.Maps (4.4.0.991265) + Xamarin.Forms (>= 4.4.0.991265) + Xamarin.Forms.Maps.WPF (4.4.0.991265) Microsoft.Maps.MapControl.WPF (>= 1.0.0.3) Xamarin.Forms.PancakeView (1.3.6) Xamarin.Forms (>= 3.6.0.220655) - Xamarin.Forms.Platform.WPF (4.3.0.908675) + Xamarin.Forms.Platform.WPF (4.4.0.991265) OpenTK (>= 3.0.1) OpenTK.GLControl (>= 3.0.1) - Xamarin.Forms (>= 4.3.0.908675) + Xamarin.Forms (>= 4.4.0.991265) From 1003ac323e6e82f67073ff8b0fbf2e80a8f22459 Mon Sep 17 00:00:00 2001 From: Sergej Dick Date: Wed, 18 Dec 2019 10:53:03 +0100 Subject: [PATCH 02/11] second part --- .../Xamarin.Forms.Core.json | 150 +++++++++++++++--- 1 file changed, 131 insertions(+), 19 deletions(-) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index 7140ed3d3..7b9fb46fc 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -1120,6 +1120,9 @@ { "source": "FlyoutIsPresented" }, + { + "source": "FlyoutVerticalScrollMode" + }, { "source": null, "name": "Items", @@ -1436,6 +1439,14 @@ { "source": "TextColor" } + ], + "events": [ + { + "source": "TextChanged", + "relatedProperties": [ + "Text" + ] + } ] }, { @@ -1457,7 +1468,7 @@ }, { "source": "IsTextPredictionEnabled" - }, + } ], "events": [ { @@ -1531,9 +1542,6 @@ { "source": "CancelButtonColor" }, - { - "source": "CharacterSpacing" - }, { "source": "FontAttributes" }, @@ -1548,12 +1556,6 @@ { "source": "HorizontalTextAlignment" }, - { - "source": "Placeholder" - }, - { - "source": "PlaceholderColor" - }, { "source": "SearchCommand", "inputType": "string -> unit", @@ -1568,12 +1570,6 @@ "defaultValue": "true", "updateCode": "ViewUpdaters.updateCommand prevSearchCommandOpt currSearchCommandOpt (fun (_target: Xamarin.Forms.SearchBar) -> _target.Text) (fun (target: Xamarin.Forms.SearchBar) cmd -> target.SearchCommand <- cmd)" }, - { - "source": "Text" - }, - { - "source": "TextColor" - }, { "source": "VerticalTextAlignment" } @@ -1601,9 +1597,6 @@ { "source": "HorizontalScrollBarVisibility" }, - { - "source": "ItemSizingStrategy" - }, { "source": "ItemsUpdatingScrollMode" }, @@ -1649,6 +1642,9 @@ }, { "source": "ItemsLayout" + }, + { + "source": "ItemSizingStrategy" } ] }, @@ -2795,6 +2791,122 @@ "primaryConstructorMembers": [ "Items" ] + }, + { + "type": "Xamarin.Forms.IndicatorView", + "name": "Indicator", + "properties": [ + { + "source": "Count" + }, + { + "source": "HideSingle" + }, + { + "source": "IndicatorLayout" + }, + { + "source": "IndicatorSize" + }, + { + "source": "IndicatorTemplate" + }, + { + "source": "IndicatorShape" + }, + { + "source": "ItemsSource" + }, + { + "source": "MaximumVisible" + }, + { + "source": "Position" + }, + { + "source": "SelectedIndicatorColor" + } + ] + }, + { + "type": "Xamarin.Forms.SwipeItem", + "name": "SwipeItem", + "properties": [ + { + "source": "BackgroundColor" + } + ], + "events": [ + { + "source": "Invoked" + } + ] + }, + { + "type": "Xamarin.Forms.SwipeItemView", + "name": "SwipeItemView", + "properties": [ + { + "source": "Command" + } + ], + "events": [ + { + "source": "Invoked" + } + ] + }, + { + "type": "Xamarin.Forms.SwipeItems", + "name": "SwipeItemView", + "properties": [ + { + "source": "Item" + }, + { + "source": "Mode" + }, + { + "source": "SwipeBehaviorOnInvoked" + } + ], + "events": [ + { + "source": "CollectionChanged" + } + ] + }, + { + "type": "Xamarin.Forms.SwipeView", + "name": "SwipeView", + "properties": [ + { + "source": "BottomItems" + }, + { + "source": "LeftItems" + }, + { + "source": "RightItems" + }, + { + "source": "TopItems" + } + ], + "events": [ + { + "source": "CloseRequested" + }, + { + "source": "SwipeChanging" + }, + { + "source": "SwipeEnded" + }, + { + "source": "SwipeStarted" + } + ] } ] } \ No newline at end of file From 081e5878626b59a76959dcfd9a68d3203688ff04 Mon Sep 17 00:00:00 2001 From: Sergej Dick Date: Wed, 18 Dec 2019 15:27:18 +0100 Subject: [PATCH 03/11] added events --- .../ViewConverters.fs | 25 +++++++++++++++++ .../Xamarin.Forms.Core.json | 27 ++++++++++++++----- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs index ab5be430f..1c4f54ac9 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs @@ -167,4 +167,29 @@ module ViewConverters = let makeCustomTimePickerTimeChangedEventHandler f = System.EventHandler(fun sender args -> f args + ) + + let makeSwipeItemsChangedEventHandler f = + System.Collections.Specialized.NotifyCollectionChangedEventHandler(fun sender args -> + f args + ) + + let makeSwipeViewCloseRequested f = + System.EventHandler(fun sender args -> + f args + ) + + let makeSwipeViewSwipeChanging f = + System.EventHandler(fun sender args -> + f args + ) + + let makeSwipeViewSwipeEnded f = + System.EventHandler(fun sender args -> + f args + ) + + let makeSwipeViewSwipeStarted f = + System.EventHandler(fun sender args -> + f args ) \ No newline at end of file diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index 7b9fb46fc..c6e8e7772 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -2858,7 +2858,7 @@ }, { "type": "Xamarin.Forms.SwipeItems", - "name": "SwipeItemView", + "name": "SwipeItems", "properties": [ { "source": "Item" @@ -2872,7 +2872,10 @@ ], "events": [ { - "source": "CollectionChanged" + "source": "CollectionChanged", + "inputType": "obj -> unit", + "modelType": "System.Collections.Specialized.NotifyCollectionChangedEventHandler", + "convertInputToModel": "ViewConverters.makeSwipeItemsChangedEventHandler" } ] }, @@ -2895,16 +2898,28 @@ ], "events": [ { - "source": "CloseRequested" + "source": "CloseRequested", + "inputType": "obj -> unit", + "modelType": "System.EventHandler", + "convertInputToModel": "ViewConverters.makeSwipeViewCloseRequested" }, { - "source": "SwipeChanging" + "source": "SwipeChanging", + "inputType": "obj -> unit", + "modelType": "System.EventHandler", + "convertInputToModel": "ViewConverters.makeSwipeViewSwipeChanging" }, { - "source": "SwipeEnded" + "source": "SwipeEnded", + "inputType": "obj -> unit", + "modelType": "System.EventHandler", + "convertInputToModel": "ViewConverters.makeSwipeViewSwipeEnded" }, { - "source": "SwipeStarted" + "source": "SwipeStarted", + "inputType": "obj -> unit", + "modelType": "System.EventHandler", + "convertInputToModel": "ViewConverters.makeSwipeViewSwipeStarted" } ] } From c9dc43e6732f33876235b93c68f36083cab78316 Mon Sep 17 00:00:00 2001 From: SergejDK Date: Wed, 18 Dec 2019 21:32:49 +0100 Subject: [PATCH 04/11] some fixes; indicatorview and swipeitems open --- .../samples/AllControls/Droid/MainActivity.fs | 3 +- .../samples/AllControls/iOS/AppDelegate.fs | 3 +- .../CustomControls.fs | 5 +- .../ViewConverters.fs | 22 +------- .../ViewUpdaters.fs | 7 +++ .../Xamarin.Forms.Core.json | 52 +++++++------------ 6 files changed, 36 insertions(+), 56 deletions(-) diff --git a/Fabulous.XamarinForms/samples/AllControls/Droid/MainActivity.fs b/Fabulous.XamarinForms/samples/AllControls/Droid/MainActivity.fs index b2f7f89ab..8f6dfdc37 100644 --- a/Fabulous.XamarinForms/samples/AllControls/Droid/MainActivity.fs +++ b/Fabulous.XamarinForms/samples/AllControls/Droid/MainActivity.fs @@ -20,7 +20,8 @@ type MainActivity() = override this.OnCreate (bundle: Bundle) = base.OnCreate (bundle) - global.Xamarin.Forms.Forms.SetFlags([|"Shell_Experimental"; "CollectionView_Experimental"; "Visual_Experimental"|]) + global.Xamarin.Forms.Forms.SetFlags([|"Shell_Experimental"; "CollectionView_Experimental"; "Visual_Experimental"; + "IndicatorView_Experimental"; "SwipeView_Experimental"|]) Xamarin.Forms.Forms.Init (this, bundle) Xamarin.FormsMaps.Init(this, bundle) diff --git a/Fabulous.XamarinForms/samples/AllControls/iOS/AppDelegate.fs b/Fabulous.XamarinForms/samples/AllControls/iOS/AppDelegate.fs index de490621a..a94ba0818 100644 --- a/Fabulous.XamarinForms/samples/AllControls/iOS/AppDelegate.fs +++ b/Fabulous.XamarinForms/samples/AllControls/iOS/AppDelegate.fs @@ -13,7 +13,8 @@ type AppDelegate () = let mutable _app: AllControls.App option = None override this.FinishedLaunching (uiApp, options) = - Xamarin.Forms.Forms.SetFlags([|"Shell_Experimental"; "CollectionView_Experimental"; "Visual_Experimental"|]); + Xamarin.Forms.Forms.SetFlags([|"Shell_Experimental"; "CollectionView_Experimental"; "Visual_Experimental"; + "IndicatorView_Experimental"; "SwipeView_Experimental"|]); Forms.Init() Xamarin.FormsMaps.Init() OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init() diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs index 244200a34..e5ee902cf 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs @@ -189,10 +189,13 @@ type CustomTimePicker() = if propertyName = "Time" then timeChanged.Trigger(this, this.Time) +type CustomIndicatorView() = + inherit IndicatorView(IndicatorTemplate = ViewElementDataTemplateSelector()) + /// Itemslayout for CarouselView type VerticalLinearItemsLayout() = inherit LinearItemsLayout(ItemsLayoutOrientation.Vertical) - + type HorizontalLinearItemsLayout() = inherit LinearItemsLayout(ItemsLayoutOrientation.Horizontal) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs index 1c4f54ac9..af541a2b8 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewConverters.fs @@ -167,29 +167,9 @@ module ViewConverters = let makeCustomTimePickerTimeChangedEventHandler f = System.EventHandler(fun sender args -> f args - ) + ) let makeSwipeItemsChangedEventHandler f = System.Collections.Specialized.NotifyCollectionChangedEventHandler(fun sender args -> f args - ) - - let makeSwipeViewCloseRequested f = - System.EventHandler(fun sender args -> - f args - ) - - let makeSwipeViewSwipeChanging f = - System.EventHandler(fun sender args -> - f args - ) - - let makeSwipeViewSwipeEnded f = - System.EventHandler(fun sender args -> - f args - ) - - let makeSwipeViewSwipeStarted f = - System.EventHandler(fun sender args -> - f args ) \ No newline at end of file diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs index 2efaf4560..fe28c0b8a 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs @@ -675,6 +675,13 @@ module ViewUpdaters = let realTarget = (target :> Xamarin.Forms.IShellContentController).Page if realTarget <> null then currValue.UpdateIncremental(prevValue, realTarget) | ValueSome _, ValueNone -> target.ContentTemplate <- null + + let updateShellNavBarHasShadow prevValueOpt currValueOpt target = + match prevValueOpt, currValueOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | ValueNone, ValueNone -> () + | _, ValueSome currValue -> Shell.SetNavBarHasShadow(target, currValue) + | ValueSome _, ValueNone -> Shell.SetNavBarHasShadow(target, true) let updatePageUseSafeArea (prevValueOpt: bool voption) (currValueOpt: bool voption) (target: Xamarin.Forms.Page) = let setUseSafeArea newValue = diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index c6e8e7772..edc43db8d 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -624,6 +624,13 @@ "defaultValue": "Xamarin.Forms.Color.Default", "inputType": "Xamarin.Forms.Color", "updateCode": "ViewUpdaters.updateShellUnselectedColor" + }, + { + "source": null, + "name": "ShellNavBarHasShadow", + "defaultValue": "true", + "inputType": "bool", + "updateCode": "ViewUpdaters.updateShellNavBarHasShadow" } ] }, @@ -1574,14 +1581,6 @@ "source": "VerticalTextAlignment" } ], - "events": [ - { - "source": "TextChanged", - "relatedProperties": [ - "Text" - ] - } - ], "primaryConstructorMembers": [ "Text" ] @@ -2794,7 +2793,8 @@ }, { "type": "Xamarin.Forms.IndicatorView", - "name": "Indicator", + "name": "XFIndicatorView", + "canBeInstantiated": false, "properties": [ { "source": "Count" @@ -2814,9 +2814,6 @@ { "source": "IndicatorShape" }, - { - "source": "ItemsSource" - }, { "source": "MaximumVisible" }, @@ -2828,9 +2825,15 @@ } ] }, + { + "type": "Fabulous.XamarinForms.CustomIndicatorView", + "name": "IndicatorView", + "primaryConstructorMembers": [ + "ItemsSource" + ] + }, { "type": "Xamarin.Forms.SwipeItem", - "name": "SwipeItem", "properties": [ { "source": "BackgroundColor" @@ -2844,7 +2847,6 @@ }, { "type": "Xamarin.Forms.SwipeItemView", - "name": "SwipeItemView", "properties": [ { "source": "Command" @@ -2858,7 +2860,6 @@ }, { "type": "Xamarin.Forms.SwipeItems", - "name": "SwipeItems", "properties": [ { "source": "Item" @@ -2881,7 +2882,6 @@ }, { "type": "Xamarin.Forms.SwipeView", - "name": "SwipeView", "properties": [ { "source": "BottomItems" @@ -2898,28 +2898,16 @@ ], "events": [ { - "source": "CloseRequested", - "inputType": "obj -> unit", - "modelType": "System.EventHandler", - "convertInputToModel": "ViewConverters.makeSwipeViewCloseRequested" + "source": "CloseRequested" }, { - "source": "SwipeChanging", - "inputType": "obj -> unit", - "modelType": "System.EventHandler", - "convertInputToModel": "ViewConverters.makeSwipeViewSwipeChanging" + "source": "SwipeChanging" }, { - "source": "SwipeEnded", - "inputType": "obj -> unit", - "modelType": "System.EventHandler", - "convertInputToModel": "ViewConverters.makeSwipeViewSwipeEnded" + "source": "SwipeEnded" }, { - "source": "SwipeStarted", - "inputType": "obj -> unit", - "modelType": "System.EventHandler", - "convertInputToModel": "ViewConverters.makeSwipeViewSwipeStarted" + "source": "SwipeStarted" } ] } From 6ea831e4efda1f96765b50b3bc313527a322db32 Mon Sep 17 00:00:00 2001 From: SergejDK Date: Thu, 19 Dec 2019 23:56:12 +0100 Subject: [PATCH 05/11] first part indicatorview --- .../AllControls/AllControls/AllControls.fs | 8 ++++++-- .../Fabulous.XamarinForms.Core/ViewUpdaters.fs | 12 +++++++++++- .../Xamarin.Forms.Core.json | 16 +++++++--------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs b/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs index f04c78122..f5b504398 100644 --- a/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs +++ b/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs @@ -34,6 +34,7 @@ type RootPageKind = | SkiaCanvas | MapSamples | OxyPlotSamples + | IndicatorViewSample //| VideoSamples //| CachedImageSamples @@ -950,10 +951,12 @@ module App = let carouselViewSample model dispatch = match Device.RuntimePlatform with | Device.iOS | Device.Android -> + let carouselRef = ViewRef() View.ContentPage( View.StackLayout [ mainPageButton dispatch + View.CarouselView(items = [ View.Label(text="Person1") @@ -969,7 +972,8 @@ module App = View.Label(text="Person12") View.Label(text="Person13") View.Label(text="Person14") - ], margin= Thickness 10.) + ], margin= Thickness 10., ref=carouselRef) + View.IndicatorView(itemsSourceBy=carouselRef) ] ) @@ -1261,7 +1265,7 @@ module App = View.Label(text="OxyPlot for XamarinForms 1.0.0 does not support your platform") View.Label(text="For status see https://github.com/oxyplot/oxyplot-xamarin") ]) - + // let videoSamples model dispatch = // View.ScrollingContentPage("VideoManager Sample", [ // mainPageButton dispatch diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs index fe28c0b8a..423fc0ca2 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs @@ -730,4 +730,14 @@ module ViewUpdaters = | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () | ValueNone, ValueNone -> () | _, ValueSome currValue -> Element.SetMenu(target, currValue.Create() :?> Menu) - | ValueSome _, ValueNone -> Element.SetMenu(target, null) \ No newline at end of file + | ValueSome _, ValueNone -> Element.SetMenu(target, null) + + let updateIndicatorViewRef (prevValueOpt: ViewRef voption) (currValueOpt: ViewRef voption) (target: Xamarin.Forms.IndicatorView) = + match prevValueOpt, currValueOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | ValueNone, ValueNone -> () + | _, ValueSome currValue -> + match currValue.TryValue with + | Some v -> IndicatorView.SetItemsSourceBy(target, v) + | None -> () + | ValueSome _, ValueNone -> IndicatorView.SetItemsSourceBy(target, null) \ No newline at end of file diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index edc43db8d..3a021d950 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -2793,8 +2793,6 @@ }, { "type": "Xamarin.Forms.IndicatorView", - "name": "XFIndicatorView", - "canBeInstantiated": false, "properties": [ { "source": "Count" @@ -2822,16 +2820,16 @@ }, { "source": "SelectedIndicatorColor" + }, + { + "source": null, + "name": "ItemsSourceBy", + "defaultValue": "null", + "inputType": "ViewRef", + "updateCode": "ViewUpdaters.updateIndicatorViewRef" } ] }, - { - "type": "Fabulous.XamarinForms.CustomIndicatorView", - "name": "IndicatorView", - "primaryConstructorMembers": [ - "ItemsSource" - ] - }, { "type": "Xamarin.Forms.SwipeItem", "properties": [ From cb48bb29e3606eb8dd72d75f13c527e1bd905b49 Mon Sep 17 00:00:00 2001 From: Sergej Dick Date: Fri, 20 Dec 2019 14:33:11 +0100 Subject: [PATCH 06/11] swipeview added with example --- .../AllControls/AllControls/AllControls.fs | 31 ++++++++++++++++++- .../ViewUpdaters.fs | 8 ++++- .../Xamarin.Forms.Core.json | 9 ++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs b/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs index f5b504398..fb966e8a2 100644 --- a/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs +++ b/Fabulous.XamarinForms/samples/AllControls/AllControls/AllControls.fs @@ -34,7 +34,7 @@ type RootPageKind = | SkiaCanvas | MapSamples | OxyPlotSamples - | IndicatorViewSample + | SwipeSample //| VideoSamples //| CachedImageSamples @@ -396,6 +396,7 @@ module App = View.Button(text = "Skia Canvas", command = (fun () -> dispatch (SetRootPageKind SkiaCanvas))) View.Button(text = "Map Samples", command = (fun () -> dispatch (SetRootPageKind MapSamples))) View.Button(text = "OxyPlot Samples", command = (fun () -> dispatch (SetRootPageKind OxyPlotSamples))) + View.Button(text = "SwipeView Samples", command = (fun () -> dispatch (SetRootPageKind SwipeSample))) //View.Button(text = "VideoManager Samples", command = (fun () -> dispatch (SetRootPageKind VideoSamples))) //View.Button(text = "CachedImage Samples", command = (fun () -> dispatch (SetRootPageKind CachedImageSamples))) ])), @@ -1265,6 +1266,33 @@ module App = View.Label(text="OxyPlot for XamarinForms 1.0.0 does not support your platform") View.Label(text="For status see https://github.com/oxyplot/oxyplot-xamarin") ]) + + let swipeViewSample model dispatch = + View.ContentPage( + View.SwipeView( + leftItems = View.SwipeItems( + sItems = [ + View.SwipeItem(text="Left 1", backgroundColor=Color.LightPink) + View.SwipeItem(text="Left 2", backgroundColor=Color.LightGreen) + ] + ), + rightItems = View.SwipeItems( + sItems = [ + View.SwipeItem(text="Right 1", backgroundColor=Color.LightPink) + View.SwipeItem(text="Right 2", backgroundColor=Color.LightGreen) + ] + ), + content = View.Grid( + height=60.0, + width=300.0, + backgroundColor=Color.LightGray, + + children = [ + View.BoxView(Color.Blue) + ] + ) + ) + ) // let videoSamples model dispatch = // View.ScrollingContentPage("VideoManager Sample", [ @@ -1325,6 +1353,7 @@ module App = //| VideoSamples -> videoSamples model dispatch //| CachedImageSamples -> chachedImageSamples model dispatch | OxyPlotSamples -> oxyPlotSamples model dispatch + | SwipeSample -> swipeViewSample model dispatch type App () as app = diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs index 423fc0ca2..b1526333c 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs @@ -740,4 +740,10 @@ module ViewUpdaters = match currValue.TryValue with | Some v -> IndicatorView.SetItemsSourceBy(target, v) | None -> () - | ValueSome _, ValueNone -> IndicatorView.SetItemsSourceBy(target, null) \ No newline at end of file + | ValueSome _, ValueNone -> IndicatorView.SetItemsSourceBy(target, null) + + let updateSwipeItems (prevCollOpt: ViewElement array voption) (collOpt: ViewElement array voption) (target: Xamarin.Forms.SwipeItems) = + let create (desc: ViewElement) = + desc.Create() :?> Xamarin.Forms.ISwipeItem + + updateCollectionGeneric prevCollOpt collOpt target create (fun _ _ _ -> ()) (fun _ _ -> true) updateChild \ No newline at end of file diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index 3a021d950..e128701b7 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -2867,6 +2867,15 @@ }, { "source": "SwipeBehaviorOnInvoked" + }, + { + "source": null, + "name": "SItems", + "defaultValue": "[]", + "inputType": "ViewElement list", + "modelType": "ViewElement array", + "convertInputToModel": "Array.ofList", + "updateCode": "ViewUpdaters.updateSwipeItems" } ], "events": [ From 7ec8c922f1f9d904795890b8fd287235bbc982f6 Mon Sep 17 00:00:00 2001 From: SergejDK Date: Sun, 29 Dec 2019 23:02:22 +0100 Subject: [PATCH 07/11] CarouselVerticalItemsLayout --- .../src/Fabulous.XamarinForms.Core/CustomControls.fs | 5 +++++ .../src/Fabulous.XamarinForms/Xamarin.Forms.Core.json | 3 +++ 2 files changed, 8 insertions(+) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs index e5ee902cf..f24a8b879 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/CustomControls.fs @@ -199,6 +199,11 @@ type VerticalLinearItemsLayout() = type HorizontalLinearItemsLayout() = inherit LinearItemsLayout(ItemsLayoutOrientation.Horizontal) +type CarouselVerticalItemsLayout() = + inherit LinearItemsLayout(ItemsLayoutOrientation.Vertical, + SnapPointsType = SnapPointsType.MandatorySingle, + SnapPointsAlignment = SnapPointsAlignment.Center) + ///////////////// /// Pages ///////////////// diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index e128701b7..fcfe468a8 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -2619,6 +2619,9 @@ { "type": "Fabulous.XamarinForms.HorizontalLinearItemsLayout" }, + { + "type": "Fabulous.XamarinForms.CarouselVerticalItemsLayout" + }, { "type": "Xamarin.Forms.SearchHandler", "canBeInstantiated": false, From 86900d2e85c08053102e83fddbe61f595664a14c Mon Sep 17 00:00:00 2001 From: Sergej Dick Date: Mon, 3 Feb 2020 10:02:35 +0100 Subject: [PATCH 08/11] requested changes --- .../src/Fabulous.XamarinForms.Core/ViewHelpers.fs | 6 ++++++ .../src/Fabulous.XamarinForms.Core/ViewUpdaters.fs | 6 +++--- .../src/Fabulous.XamarinForms/Xamarin.Forms.Core.json | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs index a8e7ef7ac..3f90041ee 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs @@ -168,3 +168,9 @@ module ViewHelpers = let res = ViewElement(externalObj.GetType(), create, update, attribs) externalsTable.Add(externalObj, res) res + + // Helper for checking Platform - especially ShellHasNavBarShadow + let updateShellNavBarHasShadowHelper = + match Device.RuntimePlatform with + | Device.Android -> true + | _ -> false \ No newline at end of file diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs index b1526333c..9f9534775 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs @@ -681,7 +681,7 @@ module ViewUpdaters = | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () | ValueNone, ValueNone -> () | _, ValueSome currValue -> Shell.SetNavBarHasShadow(target, currValue) - | ValueSome _, ValueNone -> Shell.SetNavBarHasShadow(target, true) + | ValueSome _, ValueNone -> Shell.SetNavBarHasShadow(target, ViewHelpers.updateShellNavBarHasShadowHelper) let updatePageUseSafeArea (prevValueOpt: bool voption) (currValueOpt: bool voption) (target: Xamarin.Forms.Page) = let setUseSafeArea newValue = @@ -732,14 +732,14 @@ module ViewUpdaters = | _, ValueSome currValue -> Element.SetMenu(target, currValue.Create() :?> Menu) | ValueSome _, ValueNone -> Element.SetMenu(target, null) - let updateIndicatorViewRef (prevValueOpt: ViewRef voption) (currValueOpt: ViewRef voption) (target: Xamarin.Forms.IndicatorView) = + let updateIndicatorViewItemsSourceBy (prevValueOpt: ViewRef voption) (currValueOpt: ViewRef voption) (target: Xamarin.Forms.IndicatorView) = match prevValueOpt, currValueOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () | ValueNone, ValueNone -> () | _, ValueSome currValue -> match currValue.TryValue with | Some v -> IndicatorView.SetItemsSourceBy(target, v) - | None -> () + | None -> IndicatorView.SetItemsSourceBy(target, null) | ValueSome _, ValueNone -> IndicatorView.SetItemsSourceBy(target, null) let updateSwipeItems (prevCollOpt: ViewElement array voption) (collOpt: ViewElement array voption) (target: Xamarin.Forms.SwipeItems) = diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index fcfe468a8..ea95460ae 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -628,7 +628,7 @@ { "source": null, "name": "ShellNavBarHasShadow", - "defaultValue": "true", + "defaultValue": "ViewHelpers.updateShellNavBarHasShadowHelper", "inputType": "bool", "updateCode": "ViewUpdaters.updateShellNavBarHasShadow" } @@ -2829,7 +2829,7 @@ "name": "ItemsSourceBy", "defaultValue": "null", "inputType": "ViewRef", - "updateCode": "ViewUpdaters.updateIndicatorViewRef" + "updateCode": "ViewUpdaters.updateIndicatorViewItemsSourceBy" } ] }, From 4a0ba361856d7646e7f842a661e67d974ba3be95 Mon Sep 17 00:00:00 2001 From: SergejDK Date: Mon, 3 Feb 2020 20:01:09 +0100 Subject: [PATCH 09/11] removed defaultvalue --- .../src/Fabulous.XamarinForms.Core/ViewHelpers.fs | 8 +------- .../src/Fabulous.XamarinForms.Core/ViewUpdaters.fs | 7 ++++++- .../src/Fabulous.XamarinForms/Xamarin.Forms.Core.json | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs index 3f90041ee..d269bbf0b 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewHelpers.fs @@ -167,10 +167,4 @@ module ViewHelpers = let update (_prevOpt: ViewElement voption) (_source: ViewElement) (_target: obj) = () let res = ViewElement(externalObj.GetType(), create, update, attribs) externalsTable.Add(externalObj, res) - res - - // Helper for checking Platform - especially ShellHasNavBarShadow - let updateShellNavBarHasShadowHelper = - match Device.RuntimePlatform with - | Device.Android -> true - | _ -> false \ No newline at end of file + res \ No newline at end of file diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs index 9f9534775..c95d00fee 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs @@ -681,7 +681,12 @@ module ViewUpdaters = | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () | ValueNone, ValueNone -> () | _, ValueSome currValue -> Shell.SetNavBarHasShadow(target, currValue) - | ValueSome _, ValueNone -> Shell.SetNavBarHasShadow(target, ViewHelpers.updateShellNavBarHasShadowHelper) + | ValueSome _, ValueNone -> + let hasShadow = + match Device.RuntimePlatform with + | Device.Android -> true + | _ -> false + Shell.SetNavBarHasShadow(target, hasShadow) let updatePageUseSafeArea (prevValueOpt: bool voption) (currValueOpt: bool voption) (target: Xamarin.Forms.Page) = let setUseSafeArea newValue = diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index ea95460ae..da7031074 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -628,7 +628,6 @@ { "source": null, "name": "ShellNavBarHasShadow", - "defaultValue": "ViewHelpers.updateShellNavBarHasShadowHelper", "inputType": "bool", "updateCode": "ViewUpdaters.updateShellNavBarHasShadow" } From 0d7da45461b597cdcf8207095942e0b3beb35f1e Mon Sep 17 00:00:00 2001 From: SergejDK Date: Mon, 3 Feb 2020 20:19:31 +0100 Subject: [PATCH 10/11] added defaultvalue again --- .../src/Fabulous.XamarinForms/Xamarin.Forms.Core.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index da7031074..2ba37f2c0 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -628,6 +628,7 @@ { "source": null, "name": "ShellNavBarHasShadow", + "defaultValue": "", "inputType": "bool", "updateCode": "ViewUpdaters.updateShellNavBarHasShadow" } From 6ece43d3d8e5d5a48db3a73fb34d3e16b094b56e Mon Sep 17 00:00:00 2001 From: SergejDK Date: Mon, 10 Feb 2020 19:16:55 +0100 Subject: [PATCH 11/11] changes --- .../src/Fabulous.XamarinForms/Xamarin.Forms.Core.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json index 2ba37f2c0..2f3f7cd44 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Xamarin.Forms.Core.json @@ -2803,9 +2803,6 @@ { "source": "HideSingle" }, - { - "source": "IndicatorLayout" - }, { "source": "IndicatorSize" }, @@ -2813,7 +2810,7 @@ "source": "IndicatorTemplate" }, { - "source": "IndicatorShape" + "source": "IndicatorsShape" }, { "source": "MaximumVisible" @@ -2862,9 +2859,6 @@ { "type": "Xamarin.Forms.SwipeItems", "properties": [ - { - "source": "Item" - }, { "source": "Mode" },