├── .gitattributes
├── .gitignore
├── FluidSharp.Maui.sln
├── FluidSharp.Video.Recorder
├── FluidSharp.Video.Recorder.csproj
└── VideoRecorderLayoutSurface.cs
├── FluidSharp.Views.Forms
├── FluidSharp.Views.Forms.Android
│ ├── FluidSharp.Views.Forms.Android.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ └── Resource.designer.cs
│ └── TouchEffect.cs
├── FluidSharp.Views.Forms.UWP
│ ├── FluidSharp.Views.Forms.UWP.csproj
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── SkiaSharp.FlowUI.Views.Forms.UWP.rd.xml
│ └── TouchEffect.cs
└── FluidSharp.Views.Forms.iOS
│ ├── FluidSharp.Views.Forms.iOS.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── TouchEffect.cs
│ └── TouchRecognizer.cs
├── FluidSharp.Views
├── FluidSharp.Views.Android
│ ├── AndroidFluidWidgetView.cs
│ ├── FluidSharp.Views.Android.csproj
│ ├── FluidSharp.Views.Android.nuspec
│ ├── FluidUIActivity.cs
│ ├── FluidWidgetCanvasView.cs
│ ├── FluidWidgetGLView.cs
│ ├── License.txt
│ ├── NativeViewManager.cs
│ ├── NativeViews
│ │ ├── FontExtensions.cs
│ │ ├── KeyboardExtensions.cs
│ │ ├── NativeTextboxImpl.cs
│ │ └── NativeViewExtensions.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.designer.cs
│ │ └── values
│ │ │ └── strings.xml
│ ├── SkiaView.cs
│ ├── SkiaViews.cs
│ └── nuget instructions.txt
├── FluidSharp.Views.Forms.UWP
│ ├── FluidSharp.Views.Forms.UWP.csproj
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── SkiaSharp.FlowUI.Views.Forms.UWP.rd.xml
│ └── TouchEffect.cs
├── FluidSharp.Views.Forms.iOS
│ ├── FluidSharp.Views.Forms.iOS.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TouchEffect.cs
│ └── TouchRecognizer.cs
├── FluidSharp.Views.Forms
│ ├── FluidSharp.Views.Forms.csproj
│ ├── FluidWidgetView2.cs
│ ├── NativeViewManager.cs
│ ├── NativeViews
│ │ └── NativeTextboxImpl.cs
│ ├── SkiaView.cs
│ └── XamarinExtensions.cs
├── FluidSharp.Views.Maui
│ ├── FluidSharp.Views.Maui.csproj
│ ├── License.txt
│ └── Platforms
│ │ ├── Android
│ │ ├── AndroidFluidWidgetView.cs
│ │ ├── FluidSharp.Views.Android.nuspec
│ │ ├── FluidUIActivity.cs
│ │ ├── FluidWidgetCanvasView.cs
│ │ ├── FluidWidgetGLView.cs
│ │ ├── License.txt
│ │ ├── NativeViewManager.cs
│ │ ├── NativeViews
│ │ │ ├── FontExtensions.cs
│ │ │ ├── KeyboardExtensions.cs
│ │ │ ├── NativeTextboxImpl.cs
│ │ │ └── NativeViewExtensions.cs
│ │ ├── Resources
│ │ │ └── values
│ │ │ │ └── strings.xml
│ │ ├── SkiaView.cs
│ │ ├── SkiaViews.cs
│ │ └── nuget instructions.txt
│ │ └── iOS
│ │ ├── FluidSharp.Views.iOS.nuspec
│ │ ├── FluidUICanvasViewController.cs
│ │ ├── FluidUIGLViewController.cs
│ │ ├── FluidWidgetCanvasView.cs
│ │ ├── FluidWidgetGLView.cs
│ │ ├── License.txt
│ │ ├── NativeViewManager.cs
│ │ ├── NativeViews
│ │ ├── INativeTextboxImpl.cs
│ │ ├── NativeMultiLineTextboxImpl.cs
│ │ ├── NativeSingleLineTextboxImpl.cs
│ │ └── NativeViewExtensions.cs
│ │ ├── Services
│ │ └── KeyboardTracker.cs
│ │ ├── SkiaView.cs
│ │ ├── SkiaViews.cs
│ │ ├── TouchRecognizer.cs
│ │ └── nuget instructions.txt
├── FluidSharp.Views.Shared
│ └── FluidWidgetView.cs
├── FluidSharp.Views.WindowsForms.Core
│ ├── FluidSharp.Views.WindowsForms.Core.csproj
│ ├── FluidWidgetView.resx
│ ├── License.txt
│ ├── NativeViews
│ │ ├── NativeTextboxImpl.cs
│ │ └── NativeViewExtensions.cs
│ └── SkiaView.resx
├── FluidSharp.Views.WindowsForms
│ ├── FluidSharp.Views.WindowsForms.csproj
│ ├── NativeViewManager.cs
│ ├── NativeViews
│ │ └── NativeTextboxImpl.cs
│ ├── OpenTK.dll.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SkiaView.cs
│ ├── SkiaView.resx
│ ├── app.config
│ └── packages.config
├── FluidSharp.Views.iOS
│ ├── FluidSharp.Views.iOS.csproj
│ ├── FluidSharp.Views.iOS.nuspec
│ ├── FluidUICanvasViewController.cs
│ ├── FluidUIGLViewController.cs
│ ├── FluidWidgetCanvasView.cs
│ ├── FluidWidgetGLView.cs
│ ├── License.txt
│ ├── NativeViewManager.cs
│ ├── NativeViews
│ │ ├── INativeTextboxImpl.cs
│ │ ├── NativeMultiLineTextboxImpl.cs
│ │ ├── NativeSingleLineTextboxImpl.cs
│ │ └── NativeViewExtensions.cs
│ ├── Services
│ │ └── KeyboardTracker.cs
│ ├── SkiaView.cs
│ ├── SkiaViews.cs
│ ├── TouchRecognizer.cs
│ └── nuget instructions.txt
├── Ref
│ └── SkiaSharp.Views.Android.dll
└── SkiaSharp.Views.Forms
│ ├── SkiaSharp.Views.Forms.Android
│ ├── SKCanvasViewRenderer.cs
│ ├── SKGLViewRenderer.cs
│ ├── SKImageSourceHandler.cs
│ ├── SKTouchHandler.cs
│ └── SkiaSharp.Views.Forms.Android.csproj
│ ├── SkiaSharp.Views.Forms.Native.Shared
│ ├── Registrar.cs
│ ├── SKCanvasViewRendererBase.cs
│ └── SKGLViewRendererBase.cs
│ ├── SkiaSharp.Views.Forms.Shared
│ ├── Extensions.cs
│ ├── RendererTypes.cs
│ ├── SKCanvasView.cs
│ ├── SKGLView.cs
│ ├── SKImageSource.cs
│ ├── SKPaintGLSurfaceEventArgs.cs
│ ├── SKPaintSurfaceEventArgs.cs
│ └── SKTouchEventArgs.cs
│ ├── SkiaSharp.Views.Forms.iOS
│ ├── SKCanvasViewRenderer.cs
│ ├── SKGLViewRenderer.cs
│ ├── SKImageSourceHandler.cs
│ ├── SKTouchHandler.cs
│ └── SkiaSharp.Views.Forms.iOS.csproj
│ ├── SkiaSharp.Views.Forms.sln
│ └── SkiaSharp.Views.Forms
│ ├── SKCanvasViewRenderer.cs
│ ├── SKGLViewRenderer.cs
│ ├── SkiaSharp.Views.Forms.csproj
│ └── nuget
│ └── build
│ └── net462
│ └── SkiaSharp.Views.Forms.targets
├── FluidSharp.sln
├── FluidSharp
├── Animations
│ ├── AlignAnimation.cs
│ ├── Animation.cs
│ ├── DynamicAnimatedWidget.cs
│ ├── DynamicAnimation.cs
│ ├── DynamicFrame.cs
│ ├── Easing.cs
│ ├── Frame.cs
│ ├── IAnimation.cs
│ ├── OptionalAnimatedWidget.cs
│ ├── StandardAnimation.cs
│ ├── State.cs
│ └── StateAnimation.cs
├── Engine
│ ├── EngineException.cs
│ ├── FluidWidgetViewImplementation.cs
│ ├── MakeWidgetException.cs
│ ├── MeasureException.cs
│ ├── PaintException.cs
│ ├── PerformanceTracker.cs
│ └── TapHandlerException.cs
├── FluidSharp.csproj
├── Interfaces
│ ├── IBackgroundColorSource.cs
│ ├── IFluidWidgetView.cs
│ ├── ISkiaView.cs
│ └── IWidgetSource.cs
├── Interop
│ ├── INativeView.cs
│ ├── INativeViewManager.cs
│ ├── NativeViewManagerBase.cs
│ └── ScaledNativeViewManager.cs
├── Layouts
│ ├── Device.cs
│ ├── LayoutSize.cs
│ ├── LayoutSurface.cs
│ ├── Margins.cs
│ ├── MeasureCache.cs
│ ├── PlatformStyle.cs
│ └── SKRectExtensions.cs
├── License.txt
├── Navigation
│ ├── HeroPageTransition.cs
│ ├── IPage.cs
│ ├── IPageTransition.cs
│ ├── NavigationContainer.cs
│ ├── NavigationTop.cs
│ ├── NavigationTransitionState.cs
│ ├── OverlayPageTransition.cs
│ ├── PopupPageTransition.cs
│ └── PushPageTransition.cs
├── Paint
│ ├── FluidSharpStyle.cs
│ ├── Images
│ │ ├── FileImageSource.cs
│ │ ├── ImageCache.cs
│ │ ├── ImageSource.cs
│ │ ├── ResourceImageSource.cs
│ │ └── ResourcePictureSource.cs
│ ├── PaintCache.cs
│ ├── PaintSurfaceEventArgs.cs
│ ├── SKPaintExtensions.cs
│ └── ScreenshotLayoutSurface.cs
├── SkiaSharp.FlowUI.sln
├── State
│ ├── CarouselState.cs
│ ├── LastTapped.cs
│ ├── OptionBarState.cs
│ ├── ScrollState.cs
│ ├── SlideOverState.cs
│ ├── SliderState.cs
│ ├── SlidingCellState.cs
│ ├── SwitchState.cs
│ ├── TransitionState.cs
│ ├── TypedContext.cs
│ └── VisualState.cs
├── Touch
│ ├── EditTarget.cs
│ ├── GestureArena.cs
│ ├── HitTestHit.cs
│ ├── HitTestLayoutSurface.cs
│ ├── HitTestStop.cs
│ ├── TouchActionEventArgs.cs
│ ├── TouchActionType.cs
│ └── TouchTarget.cs
└── Widgets
│ ├── Align.cs
│ ├── Animations
│ ├── AnimatedRectangle.cs
│ ├── AnimatedWidgets.cs
│ ├── FadeInElement.cs
│ ├── FadeInPicture.cs
│ ├── HeightTransition.cs
│ ├── IncrementalAnimationContainer.cs
│ ├── OriginTranslationWidget.cs
│ ├── SlideInAnimation.cs
│ └── SlideUpAnimation.cs
│ ├── AutoCacheWidget.cs
│ ├── Blur.cs
│ ├── Caching
│ ├── CachedWidget.cs
│ └── WidgetCache.cs
│ ├── Carousel.cs
│ ├── Center.cs
│ ├── CenterHorizontal.cs
│ ├── CenterRotate.cs
│ ├── Checkbox.cs
│ ├── Circle.cs
│ ├── Column.cs
│ ├── ColumnPool.cs
│ ├── Container.cs
│ ├── CrossPlatform
│ ├── Button.cs
│ ├── CrossButton.cs
│ ├── DeletableCell.cs
│ ├── SelectableButtonWidget.cs
│ └── ShortList.cs
│ ├── Cupertino
│ └── CupertinoApp.cs
│ ├── Debugging
│ ├── FrameCounter.cs
│ └── PerformanceChart.cs
│ ├── Field.cs
│ ├── FlatButton.cs
│ ├── Flow.cs
│ ├── GestureDetector.cs
│ ├── Hero.cs
│ ├── HeroTransition.cs
│ ├── HorizontalAlignment.cs
│ ├── HorizontalGradient.cs
│ ├── Image.cs
│ ├── Layout.cs
│ ├── LayoutCell.cs
│ ├── LongList.cs
│ ├── LongListContents.cs
│ ├── Material
│ └── InkWell.cs
│ ├── Members
│ └── FixableList.cs
│ ├── Native
│ ├── INativeViewImpl.cs
│ ├── Keyboard.cs
│ ├── NativeTextboxWidget.cs
│ ├── NativeViewWidget.cs
│ ├── ReturnType.cs
│ └── ReturnTypeInfo.cs
│ ├── Navigation
│ └── SlideBackNavigation.cs
│ ├── NearAndFar.cs
│ ├── NearAndFarWithMargin.cs
│ ├── Opacity.cs
│ ├── OptionBar.cs
│ ├── OptionalWidget.cs
│ ├── OverscrollBehavior.cs
│ ├── Picture.cs
│ ├── ProgressIndicator.cs
│ ├── Rectangle.cs
│ ├── RelativeMargin.cs
│ ├── RichText.cs
│ ├── RichText
│ ├── CircleSpan.cs
│ └── PictureSpan.cs
│ ├── RoundedRectangle.cs
│ ├── Row.cs
│ ├── Scale.cs
│ ├── ScaleMode.cs
│ ├── Scrollable.cs
│ ├── Shape.cs
│ ├── ShapeAsFontGlyph.cs
│ ├── ShapeBidirectional.cs
│ ├── Slidable.cs
│ ├── SlideOverContainer.cs
│ ├── SlideTransition.cs
│ ├── Slider.cs
│ ├── SlidingCell.cs
│ ├── Spacing.cs
│ ├── SplitContainerBottom.cs
│ ├── SplitContainerFar.cs
│ ├── SplitContainerNear.cs
│ ├── Stateful
│ └── TwoStateWidget.cs
│ ├── StatefulSlideTransition.cs
│ ├── Text.cs
│ ├── Translate.cs
│ ├── VerticalAlignment.cs
│ ├── VerticalGradient.cs
│ └── Widget.cs
├── README.md
└── Samples
├── FluidSharp.Samples.All
├── Basic
│ ├── HelloWorld.cs
│ └── Rectangle.cs
├── FluidSharp.Samples.All.csproj
├── LayoutSamples
│ ├── AlignSample.cs
│ ├── FlowSample.cs
│ ├── LayoutSample.cs
│ └── ShapesSample.cs
├── Sample.cs
└── SampleApp.cs
├── FluidSharp.Samples.Screenshots
├── FluidSharp.Samples.Screenshots.csproj
└── Program.cs
├── FluidSharp.Samples.WindowsFormsCore
├── FluidSharp.Samples.WindowsFormsCore.csproj
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
└── Program.cs
├── FluidSharp.Samples.iOS
├── AppDelegate.cs
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon1024.png
│ │ ├── Icon120.png
│ │ ├── Icon152.png
│ │ ├── Icon167.png
│ │ ├── Icon180.png
│ │ ├── Icon20.png
│ │ ├── Icon29.png
│ │ ├── Icon40.png
│ │ ├── Icon58.png
│ │ ├── Icon60.png
│ │ ├── Icon76.png
│ │ ├── Icon80.png
│ │ └── Icon87.png
├── Entitlements.plist
├── FluidSharp.Samples.iOS.csproj
├── Info.plist
├── LaunchScreen.storyboard
├── Main.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ └── LaunchScreen.xib
└── SceneDelegate.cs
├── FluidSharp.Samples.sln
└── Screenshots
├── Align.png
├── Background Color.png
├── Flow.png
├── Hello world.png
├── Layout.png
└── Shapes.png
/FluidSharp.Video.Recorder/FluidSharp.Video.Recorder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0
5 |
6 |
7 |
8 | true
9 |
10 |
11 |
12 | true
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/FluidSharp.Views.Forms/FluidSharp.Views.Forms.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("FluidSharp.Views.Forms.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("FluidSharp.Views.Forms.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2018")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/FluidSharp.Views.Forms/FluidSharp.Views.Forms.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FluidSharp.Views.Forms.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FluidSharp.Views.Forms.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/FluidSharp.Views.Forms/FluidSharp.Views.Forms.UWP/Properties/SkiaSharp.FlowUI.Views.Forms.UWP.rd.xml:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/FluidSharp.Views.Forms/FluidSharp.Views.Forms.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FluidSharp.Views.Forms.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FluidSharp.Views.Forms.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/FluidSharp.Views.Forms/FluidSharp.Views.Forms.iOS/TouchEffect.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | using Xamarin.Forms;
5 | using Xamarin.Forms.Platform.iOS;
6 |
7 | using UIKit;
8 | using TouchTracking = FluidSharp.Views.Forms;
9 |
10 |
11 | [assembly: ResolutionGroupName("FluidSharp")]
12 | [assembly: ExportEffect(typeof(FluidSharp.iOS.TouchEffect), "TouchEffect")]
13 | namespace FluidSharp.iOS
14 | {
15 | public class TouchEffect : PlatformEffect
16 | {
17 | UIView view;
18 | TouchRecognizer touchRecognizer;
19 |
20 | protected override void OnAttached()
21 | {
22 | // Get the iOS UIView corresponding to the Element that the effect is attached to
23 | view = Control == null ? Container : Control;
24 |
25 | // Get access to the TouchEffect class in the .NET Standard library
26 | TouchTracking.TouchEffect effect = (TouchTracking.TouchEffect)Element.Effects.FirstOrDefault(e => e is TouchTracking.TouchEffect);
27 |
28 | if (effect != null && view != null)
29 | {
30 | // Create a TouchRecognizer for this UIView
31 | touchRecognizer = new TouchRecognizer(Element, view, effect);
32 | view.AddGestureRecognizer(touchRecognizer);
33 | }
34 | }
35 |
36 | protected override void OnDetached()
37 | {
38 | if (touchRecognizer != null)
39 | {
40 | // Clean up the TouchRecognizer object
41 | touchRecognizer.Detach();
42 |
43 | // Remove the TouchRecognizer from the UIView
44 | view.RemoveGestureRecognizer(touchRecognizer);
45 | }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/AndroidFluidWidgetView.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content;
3 | using Android.OS;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using FluidSharp.State;
8 | using SkiaSharp;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.Linq;
12 | using System.Text;
13 |
14 | namespace FluidSharp.Views.Android
15 | {
16 | public abstract class AndroidFluidWidgetView : RelativeLayout
17 | {
18 |
19 | public abstract SKSize PlatformScale { get; }
20 | public abstract VisualState VisualState { get; }
21 |
22 | protected AndroidFluidWidgetView(Context context) : base(context)
23 | {
24 | }
25 |
26 | public void AddOnMainThread(View childview)
27 | {
28 |
29 | ((Activity)Context).RunOnUiThread(() =>
30 | {
31 | if (childview.Parent != null)
32 | ((ViewGroup)childview.Parent).RemoveView(childview);
33 | AddView(childview);
34 | });
35 |
36 | }
37 |
38 | }
39 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/FluidSharp.Views.Android.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | FluidSharp.Views.Android
5 | 1.3.5-alpha
6 | $title$
7 | Wouter Steenbergen
8 | My Daily Bits LLC
9 | true
10 | License.txt
11 | FluidSharp is a high performance mobile first multi-platform UI layout framework based on Skia.
12 | Initial release
13 | 2022-2023 Wouter Steenbergen
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2022-2024 Wouter Steenbergen
2 |
3 | Licensed for evaluation ("internal development") only.
4 | Not licenced to be distributed as part of a commercially available product.
5 |
6 | You may not use this file except in compliance with the License.
7 |
8 | Unless required by applicable law or agreed to in writing, software
9 | distributed under the License is distributed on an "AS IS" BASIS,
10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/NativeViews/NativeViewExtensions.cs:
--------------------------------------------------------------------------------
1 | using SkiaSharp;
2 | using SkiaSharp.TextBlocks;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using AColor = Android.Graphics.Color;
8 |
9 | namespace FluidSharp.Views.Android.NativeViews
10 | {
11 | public static class NativeViewExtensions
12 | {
13 |
14 |
15 | public static AColor ToAndroid(this SKColor self)
16 | {
17 | return new AColor(self.Red, self.Green, self.Blue, self.Alpha);
18 | }
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.xml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.xml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Hello World, Click Me!
3 | FluidSharp.Views.Android
4 |
5 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Android/nuget instructions.txt:
--------------------------------------------------------------------------------
1 |
2 | cd C:\wouterst79\FluidSharp\source\FluidSharp.Views\FluidSharp.Views.Android
3 | c:\wouterst79\nuget.exe pack FluidSharp.Views.Android.nuspec
4 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FluidSharp.Views.Forms.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FluidSharp.Views.Forms.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms.UWP/Properties/SkiaSharp.FlowUI.Views.Forms.UWP.rd.xml:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FluidSharp.Views.Forms.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FluidSharp.Views.Forms.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms.iOS/TouchEffect.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | using Xamarin.Forms;
5 | using Xamarin.Forms.Platform.iOS;
6 |
7 | using UIKit;
8 | using TouchTracking = FluidSharp.Views.Forms;
9 |
10 |
11 | [assembly: ResolutionGroupName("FluidSharp")]
12 | [assembly: ExportEffect(typeof(FluidSharp.iOS.TouchEffect), "TouchEffect")]
13 | namespace FluidSharp.iOS
14 | {
15 | public class TouchEffect : PlatformEffect
16 | {
17 | UIView view;
18 | TouchRecognizer touchRecognizer;
19 |
20 | protected override void OnAttached()
21 | {
22 | // Get the iOS UIView corresponding to the Element that the effect is attached to
23 | view = Control == null ? Container : Control;
24 |
25 | // Get access to the TouchEffect class in the .NET Standard library
26 | TouchTracking.TouchEffect effect = (TouchTracking.TouchEffect)Element.Effects.FirstOrDefault(e => e is TouchTracking.TouchEffect);
27 |
28 | if (effect != null && view != null)
29 | {
30 | // Create a TouchRecognizer for this UIView
31 | touchRecognizer = new TouchRecognizer(Element, view, effect);
32 | view.AddGestureRecognizer(touchRecognizer);
33 | }
34 | }
35 |
36 | protected override void OnDetached()
37 | {
38 | if (touchRecognizer != null)
39 | {
40 | // Clean up the TouchRecognizer object
41 | touchRecognizer.Detach();
42 |
43 | // Remove the TouchRecognizer from the UIView
44 | view.RemoveGestureRecognizer(touchRecognizer);
45 | }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms/FluidSharp.Views.Forms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-android;net7.0-ios
5 |
6 | true
7 | Wouter Steenbergen
8 | 1.4.0-alpha
9 | My Daily Bits LLC
10 | Xamarin Forms Views for FluidSharp (all platforms)
11 | 2022-2023 Wouter Steenbergen
12 | MIT
13 |
14 |
15 |
16 | TRACE;__FORMS__
17 |
18 |
19 |
20 | TRACE;__FORMS__
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Component
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms/NativeViewManager.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Interop;
2 | using FluidSharp.Widgets.Native;
3 | using SkiaSharp;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using Xamarin.Forms;
10 |
11 | namespace FluidSharp.Views.Forms
12 | {
13 |
14 | public class NativeViewManager : NativeViewManagerBase
15 | {
16 |
17 | public SkiaView View;
18 |
19 | public NativeViewManager(SkiaView view)
20 | {
21 | View = view;
22 | }
23 |
24 | public override IEnumerable GetChildren() => View.GetViews();
25 |
26 | public override SKSize GetControlSize(View control) => new SKSize((float)control.Bounds.Width, (float)control.Bounds.Height);
27 |
28 | public override void RegisterNewControl(View newControl) => View.Children.Add(newControl);
29 |
30 | public override void SetControlVisible(View control, bool visible)
31 | {
32 | if (control.IsVisible != visible) control.IsVisible = visible;
33 | }
34 |
35 | public override void UpdateControl(View control, NativeViewWidget nativeViewWidget, SKRect rect, SKRect original)
36 | {
37 | var bounds = new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height);
38 | if (control.Bounds != bounds)
39 | {
40 | AbsoluteLayout.SetLayoutBounds(control, bounds);
41 | System.Diagnostics.Debug.WriteLine("setting bounds");
42 | }
43 | }
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms/NativeViews/NativeTextboxImpl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xamarin.Forms;
7 |
8 | namespace FluidSharp.Views.Forms.NativeViews
9 | {
10 | public class NativeTextboxImpl : Entry
11 | {
12 |
13 | public object Context;
14 |
15 | private Func RequestRedraw;
16 |
17 | public NativeTextboxImpl(Func requestRedraw)
18 | {
19 | RequestRedraw = requestRedraw;
20 | // BackColor = Color.Red;
21 | // Height = 100;
22 | // this.Click += NativeAdViewImpl_Click;
23 | }
24 |
25 | //private void NativeAdViewImpl_Click(object sender, EventArgs e)
26 | //{
27 | // this.Height = Height == 100 ? 150 : 100;
28 | // Task.Run(RequestRedraw);
29 | //}
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Forms/XamarinExtensions.cs:
--------------------------------------------------------------------------------
1 | using SkiaSharp;
2 | using SkiaSharp.Views.Forms;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 | using Xamarin.Forms;
7 |
8 | namespace FluidSharp.Views.Forms
9 | {
10 | public static class XamarinExtensions
11 | {
12 |
13 | public static SKColor SKColor(this ResourceDictionary resourceDictionary, string ResourceName)
14 | {
15 | var c = resourceDictionary[ResourceName];
16 | Color color;
17 | if (c is OnPlatform opc)
18 | color = opc;
19 | else
20 | color = (Color)c;
21 | return color.ToSKColor();
22 | }
23 |
24 | public static SKColor ColorFromResources(string ResourceName) => Application.Current.Resources.SKColor(ResourceName);
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2022-2024 Wouter Steenbergen
2 |
3 | Licensed for evaluation ("internal development") only.
4 | Not licenced to be distributed as part of a commercially available product.
5 |
6 | You may not use this file except in compliance with the License.
7 |
8 | Unless required by applicable law or agreed to in writing, software
9 | distributed under the License is distributed on an "AS IS" BASIS,
10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/Android/AndroidFluidWidgetView.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content;
3 | using Android.OS;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using FluidSharp.State;
8 | using SkiaSharp;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.Linq;
12 | using System.Text;
13 |
14 | namespace FluidSharp.Views.Android
15 | {
16 | public abstract class AndroidFluidWidgetView : RelativeLayout
17 | {
18 |
19 | public abstract SKSize PlatformScale { get; }
20 | public abstract VisualState VisualState { get; }
21 |
22 | protected AndroidFluidWidgetView(Context context) : base(context)
23 | {
24 | }
25 |
26 | public void AddOnMainThread(View childview)
27 | {
28 |
29 | ((Activity)Context).RunOnUiThread(() =>
30 | {
31 | if (childview.Parent == this) return;
32 | if (childview.Parent != null)
33 | ((ViewGroup)childview.Parent).RemoveView(childview);
34 | AddView(childview);
35 | });
36 |
37 | }
38 |
39 | }
40 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/Android/FluidSharp.Views.Android.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | FluidSharp.Views.Android
5 | 1.3.5-alpha
6 | $title$
7 | Wouter Steenbergen
8 | My Daily Bits LLC
9 | true
10 | License.txt
11 | FluidSharp is a high performance mobile first multi-platform UI layout framework based on Skia.
12 | Initial release
13 | 2022-2023 Wouter Steenbergen
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/Android/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2022 - 2024 - Wouter Steenbergen
2 |
3 | Licensed for evaluation ("internal development") only.
4 | Not licenced to be distributed as part of a commercially available product.
5 |
6 | You may not use this file except in compliance with the License.
7 |
8 | Unless required by applicable law or agreed to in writing, software
9 | distributed under the License is distributed on an "AS IS" BASIS,
10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/Android/NativeViews/NativeViewExtensions.cs:
--------------------------------------------------------------------------------
1 | using SkiaSharp;
2 | using SkiaSharp.TextBlocks;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using AColor = Android.Graphics.Color;
8 |
9 | namespace FluidSharp.Views.Android.NativeViews
10 | {
11 | public static class NativeViewExtensions
12 | {
13 |
14 |
15 | public static AColor ToAndroid(this SKColor self)
16 | {
17 | return new AColor(self.Red, self.Green, self.Blue, self.Alpha);
18 | }
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/Android/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Hello World, Click Me!
3 | FluidSharp.Views.Android
4 |
5 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/Android/nuget instructions.txt:
--------------------------------------------------------------------------------
1 |
2 | cd C:\wouterst79\FluidSharp\source\FluidSharp.Views\FluidSharp.Views.Android
3 | c:\wouterst79\nuget.exe pack FluidSharp.Views.Android.nuspec
4 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/iOS/FluidSharp.Views.iOS.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | FluidSharp.Views.iOS
5 | 1.3.3-alpha
6 | $title$
7 | Wouter Steenbergen
8 | My Daily Bits LLC
9 | true
10 | License.txt
11 | FluidSharp is a high performance mobile first multi-platform UI layout framework based on Skia.
12 | Initial release
13 | 2022-2023 Wouter Steenbergen
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/iOS/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2022 - Wouter Steenbergen
2 |
3 | Licensed for evaluation ("internal development") only.
4 | Not licenced to be distributed as part of a commercially available product.
5 |
6 | You may not use this file except in compliance with the License.
7 |
8 | Unless required by applicable law or agreed to in writing, software
9 | distributed under the License is distributed on an "AS IS" BASIS,
10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/iOS/NativeViews/INativeTextboxImpl.cs:
--------------------------------------------------------------------------------
1 | #if DEBUG
2 | #define PRINTEVENTS
3 | #endif
4 |
5 | namespace FluidSharp.Views.iOS.NativeViews
6 | {
7 | public interface INativeTextboxImpl
8 | {
9 | object Context { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/iOS/NativeViews/NativeViewExtensions.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Widgets.Native;
2 | using Foundation;
3 | using SkiaSharp;
4 | using SkiaSharp.TextBlocks;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using UIKit;
10 |
11 | namespace FluidSharp.Views.iOS.NativeViews
12 | {
13 | public static class NativeViewExtensions
14 | {
15 |
16 | public static UIFont ToUIFont(this Font font)
17 | {
18 | UIFont result;
19 | if (font.FontStyle.Weight == 600)//SKFontStyleWeight.SemiBold)
20 | {
21 | result = UIFont.FromName(font.Name + " Semibold", font.TextSize);
22 | if (result != null) return result;
23 | }
24 | result = UIFont.FromName(font.Name, font.TextSize);
25 | return result;
26 | }
27 |
28 | public static UIColor ToUIColor(this SKColor color)
29 | {
30 | return new UIColor(color.Red / 255f, color.Green / 255f, color.Blue / 255f, color.Alpha / 255f);
31 | }
32 |
33 | internal static UIReturnKeyType ToUIReturnKeyType(this ReturnType returnType)
34 | {
35 | switch (returnType)
36 | {
37 | case ReturnType.Go:
38 | return UIReturnKeyType.Go;
39 | case ReturnType.Next:
40 | return UIReturnKeyType.Next;
41 | case ReturnType.Send:
42 | return UIReturnKeyType.Send;
43 | case ReturnType.Search:
44 | return UIReturnKeyType.Search;
45 | case ReturnType.Done:
46 | return UIReturnKeyType.Done;
47 | case ReturnType.Default:
48 | return UIReturnKeyType.Default;
49 | default:
50 | throw new System.NotImplementedException($"ReturnType {returnType} not supported");
51 | }
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.Maui/Platforms/iOS/nuget instructions.txt:
--------------------------------------------------------------------------------
1 |
2 | cd C:\wouterst79\FluidSharp\source\FluidSharp.Views\FluidSharp.Views.iOS
3 | c:\wouterst79\nuget.exe pack FluidSharp.Views.iOS.nuspec
4 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms.Core/FluidSharp.Views.WindowsForms.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0-windows
5 | true
6 |
7 | true
8 | Wouter Steenbergen
9 | My Daily Bits LLC
10 | WindowdForms Views for FluidSharp (net9.0)
11 | 2020-2025 Wouter Steenbergen
12 |
13 | 3.0.0-alpha
14 | enable
15 | true
16 | License.txt
17 |
18 |
19 |
20 |
21 | TRACE;__WINDOWSFORMS__
22 |
23 |
24 |
25 | TRACE;__WINDOWSFORMS__
26 |
27 |
28 |
29 |
30 |
31 | True
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Component
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms.Core/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2022-2024 Wouter Steenbergen
2 |
3 | Licensed for evaluation ("internal development") only.
4 | Not licenced to be distributed as part of a commercially available product.
5 |
6 | You may not use this file except in compliance with the License.
7 |
8 | Unless required by applicable law or agreed to in writing, software
9 | distributed under the License is distributed on an "AS IS" BASIS,
10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms.Core/NativeViews/NativeViewExtensions.cs:
--------------------------------------------------------------------------------
1 | using SkiaSharp;
2 | using SkiaSharp.TextBlocks;
3 | using UWPFont = System.Drawing.Font;
4 | using UWPColor = System.Drawing.Color;
5 |
6 | namespace FluidSharp.Views.WindowsForms.Core.NativeViews
7 | {
8 | public static class NativeViewExtensions
9 | {
10 |
11 | public static UWPFont ToUWPFont(this Font font)
12 | {
13 | return new UWPFont(font.Name, font.TextSize / 2);
14 | }
15 |
16 | public static UWPColor ToUWPColor(this SKColor color)
17 | {
18 | return UWPColor.FromArgb(color.Alpha, color.Red, color.Green, color.Blue);
19 | }
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms/NativeViews/NativeTextboxImpl.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Widgets.Native;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 |
9 | namespace FluidSharp.Views.WindowsForms.NativeViews
10 | {
11 | public class NativeTextboxImpl : TextBox, INativeViewImpl
12 | {
13 |
14 | public object Context;
15 |
16 | private Func RequestRedraw;
17 | private Func SetText;
18 |
19 | public NativeTextboxImpl(Func requestRedraw)
20 | {
21 | RequestRedraw = requestRedraw;
22 | // BackColor = Color.Red;
23 | // Height = 100;
24 | // this.Click += NativeAdViewImpl_Click;
25 | }
26 |
27 | public void UpdateControl(NativeViewWidget nativeViewWidget)
28 | {
29 | var widget = (NativeTextboxWidget)nativeViewWidget;
30 | if (Text != widget.Text)
31 | {
32 | Text = widget.Text;
33 | }
34 | SetText = widget.SetText;
35 | }
36 |
37 | //private void NativeAdViewImpl_Click(object sender, EventArgs e)
38 | //{
39 | // this.Height = Height == 100 ? 150 : 100;
40 | // Task.Run(RequestRedraw);
41 | //}
42 |
43 | protected override void OnTextChanged(EventArgs e)
44 | {
45 | base.OnTextChanged(e);
46 | Task.Run(() => SetText(Text));
47 | }
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms/OpenTK.dll.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FluidSharp.WindowsForms.NetFramework")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FluidSharp.WindowsForms.NetFramework")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72b7f87e-5f47-4064-bec3-ac411c08e308")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.WindowsForms/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.iOS/FluidSharp.Views.iOS.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | FluidSharp.Views.iOS
5 | 1.3.3-alpha
6 | $title$
7 | Wouter Steenbergen
8 | My Daily Bits LLC
9 | true
10 | License.txt
11 | FluidSharp is a high performance mobile first multi-platform UI layout framework based on Skia.
12 | Initial release
13 | 2022-2023 Wouter Steenbergen
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.iOS/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2022-2024 Wouter Steenbergen
2 |
3 | Licensed for evaluation ("internal development") only.
4 | Not licenced to be distributed as part of a commercially available product.
5 |
6 | You may not use this file except in compliance with the License.
7 |
8 | Unless required by applicable law or agreed to in writing, software
9 | distributed under the License is distributed on an "AS IS" BASIS,
10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.iOS/NativeViews/INativeTextboxImpl.cs:
--------------------------------------------------------------------------------
1 | #if DEBUG
2 | #define PRINTEVENTS
3 | #endif
4 |
5 | namespace FluidSharp.Views.iOS.NativeViews
6 | {
7 | public interface INativeTextboxImpl
8 | {
9 | object Context { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.iOS/NativeViews/NativeViewExtensions.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Widgets.Native;
2 | using Foundation;
3 | using SkiaSharp;
4 | using SkiaSharp.TextBlocks;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using UIKit;
10 |
11 | namespace FluidSharp.Views.iOS.NativeViews
12 | {
13 | public static class NativeViewExtensions
14 | {
15 |
16 | public static UIFont ToUIFont(this Font font)
17 | {
18 | UIFont result;
19 | if (font.FontStyle.Weight == 600)//SKFontStyleWeight.SemiBold)
20 | {
21 | result = UIFont.FromName(font.Name + " Semibold", font.TextSize);
22 | if (result != null) return result;
23 | }
24 | result = UIFont.FromName(font.Name, font.TextSize);
25 | return result;
26 | }
27 |
28 | public static UIColor ToUIColor(this SKColor color)
29 | {
30 | return new UIColor(color.Red / 255f, color.Green / 255f, color.Blue / 255f, color.Alpha / 255f);
31 | }
32 |
33 | internal static UIReturnKeyType ToUIReturnKeyType(this ReturnType returnType)
34 | {
35 | switch (returnType)
36 | {
37 | case ReturnType.Go:
38 | return UIReturnKeyType.Go;
39 | case ReturnType.Next:
40 | return UIReturnKeyType.Next;
41 | case ReturnType.Send:
42 | return UIReturnKeyType.Send;
43 | case ReturnType.Search:
44 | return UIReturnKeyType.Search;
45 | case ReturnType.Done:
46 | return UIReturnKeyType.Done;
47 | case ReturnType.Default:
48 | return UIReturnKeyType.Default;
49 | default:
50 | throw new System.NotImplementedException($"ReturnType {returnType} not supported");
51 | }
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.iOS/Services/KeyboardTracker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using Foundation;
7 | using UIKit;
8 |
9 | namespace FluidSharp.Views.iOS.Services
10 | {
11 |
12 |
13 | // https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
14 |
15 | // https://docs.microsoft.com/en-us/dotnet/api/uikit.uikeyboard.notifications.observedidshow?view=xamarin-ios-sdk-12
16 |
17 | public class KeyboardTracker
18 | {
19 |
20 | NSObject _keyboardShowObserver;
21 | NSObject _keyboardHideObserver;
22 | NSObject _keyboardChangeObserver;
23 |
24 | Action OnKeyboardHeightChanged;
25 |
26 | public KeyboardTracker(Action onKeyboardHeightChanged)
27 | {
28 | OnKeyboardHeightChanged = onKeyboardHeightChanged;
29 | }
30 |
31 | public void RegisterForKeyboardNotifications()
32 | {
33 | _keyboardShowObserver = UIKeyboard.Notifications.ObserveWillShow((s, e) => OnKeyboardShow(e));
34 | _keyboardChangeObserver = UIKeyboard.Notifications.ObserveWillChangeFrame((s, e) => OnKeyboardShow(e));
35 | _keyboardHideObserver = UIKeyboard.Notifications.ObserveWillHide((s, e) => OnKeyboardHide(e));
36 | }
37 |
38 | public void UnregisterForKeyboardNotifications()
39 | {
40 | if (_keyboardShowObserver != null)
41 | {
42 | _keyboardShowObserver.Dispose();
43 | _keyboardShowObserver = null;
44 | }
45 |
46 | if (_keyboardChangeObserver != null)
47 | {
48 | _keyboardChangeObserver.Dispose();
49 | _keyboardChangeObserver = null;
50 | }
51 |
52 | if (_keyboardHideObserver != null)
53 | {
54 | _keyboardHideObserver.Dispose();
55 | _keyboardHideObserver = null;
56 | }
57 |
58 | }
59 |
60 | protected virtual void OnKeyboardShow(UIKeyboardEventArgs notification)
61 | {
62 | OnKeyboardHeightChanged(notification.FrameEnd.Height);
63 | }
64 |
65 | private void OnKeyboardHide(UIKeyboardEventArgs notification)
66 | {
67 | OnKeyboardHeightChanged(0);
68 | }
69 |
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/FluidSharp.Views/FluidSharp.Views.iOS/nuget instructions.txt:
--------------------------------------------------------------------------------
1 |
2 | cd C:\wouterst79\FluidSharp\source\FluidSharp.Views\FluidSharp.Views.iOS
3 | c:\wouterst79\nuget.exe pack FluidSharp.Views.iOS.nuspec
4 |
--------------------------------------------------------------------------------
/FluidSharp.Views/Ref/SkiaSharp.Views.Android.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wouterst79/FluidSharp/3de7c73adf7e3b662b183a453d766cb7aaa2ff9a/FluidSharp.Views/Ref/SkiaSharp.Views.Android.dll
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Android/SKCanvasViewRenderer.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 |
3 | #if __MAUI__
4 | using SKFormsView = SkiaSharp.Views.Maui.Controls.SKCanvasView;
5 | using SKNativeView = SkiaSharp.Views.Android.SKCanvasView;
6 | #else
7 | using Xamarin.Forms;
8 |
9 | using SKFormsView = SkiaSharp.Views.Forms.SKCanvasView;
10 | using SKNativeView = SkiaSharp.Views.Android.SKCanvasView;
11 |
12 | [assembly: ExportRenderer(typeof(SKFormsView), typeof(SkiaSharp.Views.Forms.SKCanvasViewRenderer))]
13 | #endif
14 |
15 | #if __MAUI__
16 | namespace SkiaSharp.Views.Maui.Controls.Compatibility
17 | #else
18 | namespace SkiaSharp.Views.Forms
19 | #endif
20 | {
21 | public class SKCanvasViewRenderer : SKCanvasViewRendererBase
22 | {
23 | public SKCanvasViewRenderer(Context context)
24 | : base(context)
25 | {
26 | }
27 |
28 | protected override SKNativeView CreateNativeControl() =>
29 | GetType() == typeof(SKCanvasViewRenderer)
30 | ? new SKNativeView(Context)
31 | : base.CreateNativeControl();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Android/SKGLViewRenderer.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 | using Android.Opengl;
3 |
4 | #if __MAUI__
5 | using SKFormsView = SkiaSharp.Views.Maui.Controls.SKGLView;
6 | using SKNativeView = SkiaSharp.Views.Android.SKGLTextureView;
7 | #else
8 | using Xamarin.Forms;
9 |
10 | using SKFormsView = SkiaSharp.Views.Forms.SKGLView;
11 | using SKNativeView = SkiaSharp.Views.Android.SKGLTextureView;
12 |
13 | [assembly: ExportRenderer(typeof(SKFormsView), typeof(SkiaSharp.Views.Forms.SKGLViewRenderer))]
14 | #endif
15 |
16 | #if __MAUI__
17 | namespace SkiaSharp.Views.Maui.Controls.Compatibility
18 | #else
19 | namespace SkiaSharp.Views.Forms
20 | #endif
21 | {
22 | public class SKGLViewRenderer : SKGLViewRendererBase
23 | {
24 | public SKGLViewRenderer(Context context)
25 | : base(context)
26 | {
27 | }
28 |
29 | protected override void SetupRenderLoop(bool oneShot)
30 | {
31 | if (oneShot)
32 | {
33 | Control.RequestRender();
34 | }
35 |
36 | Control.RenderMode = Element.HasRenderLoop
37 | ? Rendermode.Continuously
38 | : Rendermode.WhenDirty;
39 | }
40 |
41 | protected override SKNativeView CreateNativeControl()
42 | {
43 | var view = GetType() == typeof(SKGLViewRenderer)
44 | ? new SKNativeView(Context)
45 | : base.CreateNativeControl();
46 |
47 | // Force the opacity to false for consistency with the other platforms
48 | view.SetOpaque(false);
49 |
50 | return view;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Android/SKImageSourceHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using Android.Content;
4 | using Android.Graphics;
5 |
6 | using SkiaSharp.Views.Android;
7 |
8 | #if __MAUI__
9 | using Microsoft.Maui.Controls;
10 | using Microsoft.Maui.Controls.Compatibility.Platform.Android;
11 | #else
12 | using Xamarin.Forms;
13 | using Xamarin.Forms.Platform.Android;
14 |
15 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKImageImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
16 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKBitmapImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
17 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKPixmapImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
18 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKPictureImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
19 | #endif
20 |
21 | #if __MAUI__
22 | namespace SkiaSharp.Views.Maui.Controls.Compatibility
23 | #else
24 | namespace SkiaSharp.Views.Forms
25 | #endif
26 | {
27 | public sealed class SKImageSourceHandler : IImageSourceHandler
28 | {
29 | public Task LoadImageAsync(ImageSource imagesource, Context context, CancellationToken cancelationToken = default(CancellationToken))
30 | {
31 | Bitmap bitmap = null;
32 |
33 | var imageImageSource = imagesource as SKImageImageSource;
34 | if (imageImageSource != null)
35 | {
36 | bitmap = imageImageSource.Image?.ToBitmap();
37 | }
38 |
39 | var bitmapImageSource = imagesource as SKBitmapImageSource;
40 | if (bitmapImageSource != null)
41 | {
42 | bitmap = bitmapImageSource.Bitmap?.ToBitmap();
43 | }
44 |
45 | var pixmapImageSource = imagesource as SKPixmapImageSource;
46 | if (pixmapImageSource != null)
47 | {
48 | bitmap = pixmapImageSource.Pixmap?.ToBitmap();
49 | }
50 |
51 | var pictureImageSource = imagesource as SKPictureImageSource;
52 | if (pictureImageSource != null)
53 | {
54 | bitmap = pictureImageSource.Picture?.ToBitmap(pictureImageSource.Dimensions);
55 | }
56 |
57 | return Task.FromResult(bitmap);
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Android/SkiaSharp.Views.Forms.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-android
5 | SkiaSharp.Views.Forms
6 | SkiaSharp.Views.Forms
7 | false
8 | SkiaSharp.Views.Forms
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Native.Shared/Registrar.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SkiaSharp.Views.Forms
4 | {
5 | internal class Registrar
6 | {
7 | internal static void EnsureRegistered(Type type, Type handler)
8 | {
9 | var registered = Xamarin.Forms.Internals.Registrar.Registered;
10 | if (registered.GetHandlerType(type) != null)
11 | return;
12 | registered.Register(type, handler);
13 | }
14 | }
15 |
16 | public sealed partial class SKImageImageSource
17 | {
18 | static SKImageImageSource() =>
19 | Registrar.EnsureRegistered(typeof(SKImageImageSource), typeof(SKImageSourceHandler));
20 | }
21 |
22 | public sealed partial class SKBitmapImageSource
23 | {
24 | static SKBitmapImageSource() =>
25 | Registrar.EnsureRegistered(typeof(SKBitmapImageSource), typeof(SKImageSourceHandler));
26 | }
27 |
28 | public sealed partial class SKPixmapImageSource
29 | {
30 | static SKPixmapImageSource() =>
31 | Registrar.EnsureRegistered(typeof(SKPixmapImageSource), typeof(SKImageSourceHandler));
32 | }
33 |
34 | public sealed partial class SKPictureImageSource
35 | {
36 | static SKPictureImageSource() =>
37 | Registrar.EnsureRegistered(typeof(SKPictureImageSource), typeof(SKImageSourceHandler));
38 | }
39 |
40 | public partial class SKCanvasView
41 | {
42 | static SKCanvasView() =>
43 | Registrar.EnsureRegistered(typeof(SKCanvasView), typeof(SKCanvasViewRenderer));
44 | }
45 |
46 | public partial class SKGLView
47 | {
48 | static SKGLView() =>
49 | Registrar.EnsureRegistered(typeof(SKGLView), typeof(SKGLViewRenderer));
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/Extensions.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms;
2 |
3 | namespace SkiaSharp.Views.Forms
4 | {
5 | public static class Extensions
6 | {
7 | public static Point ToFormsPoint(this SKPointI point)
8 | {
9 | return new Point(point.X, point.Y);
10 | }
11 |
12 | public static Point ToFormsPoint(this SKPoint point)
13 | {
14 | return new Point(point.X, point.Y);
15 | }
16 |
17 | public static SKPoint ToSKPoint(this Point point)
18 | {
19 | return new SKPoint((float)point.X, (float)point.Y);
20 | }
21 |
22 | // Xamarin.Forms.Point
23 |
24 | public static Size ToFormsSize(this SKSizeI size)
25 | {
26 | return new Size(size.Width, size.Height);
27 | }
28 |
29 | public static Size ToFormsSize(this SKSize size)
30 | {
31 | return new Size(size.Width, size.Height);
32 | }
33 |
34 | public static SKSize ToSKSize(this Size size)
35 | {
36 | return new SKSize((float)size.Width, (float)size.Height);
37 | }
38 |
39 | // Xamarin.Forms.Size
40 |
41 | public static Rectangle ToFormsRect(this SKRectI rect)
42 | {
43 | return new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height);
44 | }
45 |
46 | public static Rectangle ToFormsRect(this SKRect rect)
47 | {
48 | return new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height);
49 | }
50 |
51 | public static SKRect ToSKRect(this Rectangle rect)
52 | {
53 | return new SKRect((float)rect.Left, (float)rect.Top, (float)rect.Right, (float)rect.Bottom);
54 | }
55 |
56 | // Xamarin.Forms.Color
57 |
58 | public static Color ToFormsColor(this SKColor color) =>
59 | new Color(color.Red / 255.0, color.Green / 255.0, color.Blue / 255.0, color.Alpha / 255.0);
60 |
61 | public static Color ToFormsColor(this SKColorF color) =>
62 | new Color(color.Red, color.Green, color.Blue, color.Alpha);
63 |
64 | public static SKColor ToSKColor(this Color color) =>
65 | new SKColor((byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255), (byte)(color.A * 255));
66 |
67 | public static SKColorF ToSKColorF(this Color color) =>
68 | new SKColorF((float)color.R, (float)color.G, (float)color.B, (float)color.A);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/RendererTypes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if __MAUI__
4 | using Microsoft.Maui;
5 | using Microsoft.Maui.Controls;
6 | #else
7 | using Xamarin.Forms;
8 | #endif
9 |
10 | #if __MAUI__
11 | namespace SkiaSharp.Views.Maui.Controls
12 | #else
13 | namespace SkiaSharp.Views.Forms
14 | #endif
15 | {
16 | public class GetPropertyValueEventArgs : EventArgs
17 | {
18 | public T Value { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/SKPaintSurfaceEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | #if __MAUI__
4 | using Microsoft.Maui;
5 | #else
6 | using Xamarin.Forms;
7 | #endif
8 |
9 | #if __MAUI__
10 | namespace SkiaSharp.Views.Maui
11 | #else
12 | namespace SkiaSharp.Views.Forms
13 | #endif
14 | {
15 | public class SKPaintSurfaceEventArgs : EventArgs
16 | {
17 | public SKPaintSurfaceEventArgs(SKSurface surface, SKImageInfo info)
18 | : this(surface, info, info)
19 | {
20 | }
21 |
22 | public SKPaintSurfaceEventArgs(SKSurface surface, SKImageInfo info, SKImageInfo rawInfo)
23 | {
24 | Surface = surface;
25 | Info = info;
26 | RawInfo = rawInfo;
27 | }
28 |
29 | public SKSurface Surface { get; }
30 |
31 | public SKImageInfo Info { get; }
32 |
33 | public SKImageInfo RawInfo { get; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.iOS/SKCanvasViewRenderer.cs:
--------------------------------------------------------------------------------
1 | #if __MAUI__
2 | using SKFormsView = SkiaSharp.Views.Maui.Controls.SKCanvasView;
3 | using SKNativeView = SkiaSharp.Views.iOS.SKCanvasView;
4 | #else
5 | using Xamarin.Forms;
6 |
7 | using SKFormsView = SkiaSharp.Views.Forms.SKCanvasView;
8 | using SKNativeView = SkiaSharp.Views.iOS.SKCanvasView;
9 |
10 | [assembly: ExportRenderer(typeof(SKFormsView), typeof(SkiaSharp.Views.Forms.SKCanvasViewRenderer))]
11 | #endif
12 |
13 | #if __MAUI__
14 | namespace SkiaSharp.Views.Maui.Controls.Compatibility
15 | #else
16 | namespace SkiaSharp.Views.Forms
17 | #endif
18 | {
19 | public class SKCanvasViewRenderer : SKCanvasViewRendererBase
20 | {
21 | public SKCanvasViewRenderer()
22 | {
23 | SetDisablesUserInteraction(true);
24 | }
25 |
26 | protected override SKNativeView CreateNativeControl()
27 | {
28 | var view = GetType() == typeof(SKCanvasViewRenderer)
29 | ? new SKNativeView()
30 | : base.CreateNativeControl();
31 |
32 | // Force the opacity to false for consistency with the other platforms
33 | view.Opaque = false;
34 |
35 | return view;
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.iOS/SKImageSourceHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using UIKit;
4 |
5 | using SkiaSharp.Views.iOS;
6 |
7 | #if __MAUI__
8 | using Microsoft.Maui.Controls;
9 | using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
10 | #else
11 | using Xamarin.Forms;
12 | using Xamarin.Forms.Platform.iOS;
13 |
14 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKImageImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
15 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKBitmapImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
16 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKPixmapImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
17 | [assembly: ExportImageSourceHandler(typeof(SkiaSharp.Views.Forms.SKPictureImageSource), typeof(SkiaSharp.Views.Forms.SKImageSourceHandler))]
18 | #endif
19 |
20 | #if __MAUI__
21 | namespace SkiaSharp.Views.Maui.Controls.Compatibility
22 | #else
23 | namespace SkiaSharp.Views.Forms
24 | #endif
25 | {
26 | public sealed class SKImageSourceHandler : IImageSourceHandler
27 | {
28 | public Task LoadImageAsync(ImageSource imagesource, CancellationToken cancelationToken = default(CancellationToken), float scale = 1f)
29 | {
30 | UIImage image = null;
31 |
32 | var imageImageSource = imagesource as SKImageImageSource;
33 | if (imageImageSource != null)
34 | {
35 | image = imageImageSource.Image?.ToUIImage();
36 | }
37 |
38 | var bitmapImageSource = imagesource as SKBitmapImageSource;
39 | if (bitmapImageSource != null)
40 | {
41 | image = bitmapImageSource.Bitmap?.ToUIImage();
42 | }
43 |
44 | var pixmapImageSource = imagesource as SKPixmapImageSource;
45 | if (pixmapImageSource != null)
46 | {
47 | image = pixmapImageSource.Pixmap?.ToUIImage();
48 | }
49 |
50 | var pictureImageSource = imagesource as SKPictureImageSource;
51 | if (pictureImageSource != null)
52 | {
53 | image = pictureImageSource.Picture?.ToUIImage(pictureImageSource.Dimensions);
54 | }
55 |
56 | return Task.FromResult(image);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.iOS/SkiaSharp.Views.Forms.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-ios
5 | SkiaSharp.Views.Forms
6 | SkiaSharp.Views.Forms
7 | false
8 | SkiaSharp.Views.Forms
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.4.33213.308
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp.Views.Forms", "SkiaSharp.Views.Forms\SkiaSharp.Views.Forms.csproj", "{42595E7C-0F4A-4987-97C3-2D071E2B895E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {42595E7C-0F4A-4987-97C3-2D071E2B895E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {42595E7C-0F4A-4987-97C3-2D071E2B895E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {42595E7C-0F4A-4987-97C3-2D071E2B895E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {42595E7C-0F4A-4987-97C3-2D071E2B895E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C15E64CB-EE77-48B1-A3BF-FB0BA24C0BE8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/SKCanvasViewRenderer.cs:
--------------------------------------------------------------------------------
1 | namespace SkiaSharp.Views.Forms
2 | {
3 | internal class SKCanvasViewRenderer
4 | {
5 | public SKCanvasViewRenderer()
6 | {
7 | throw new System.PlatformNotSupportedException("SKCanvasView is not yet supported on this platform.");
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/SKGLViewRenderer.cs:
--------------------------------------------------------------------------------
1 | namespace SkiaSharp.Views.Forms
2 | {
3 | internal class SKGLViewRenderer
4 | {
5 | public SKGLViewRenderer()
6 | {
7 | throw new System.PlatformNotSupportedException("SKGLView is not yet supported on this platform.");
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-ios;net7.0-android
5 | SkiaSharp.Views.Forms
6 | SkiaSharp.Views.Forms
7 | false
8 | SkiaSharp.Views.Forms
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/FluidSharp.Views/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/nuget/build/net462/SkiaSharp.Views.Forms.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | True
7 |
8 |
9 |
10 |
11 |
12 |
13 | <_RequiredWPFReferences Include="@(ReferencePath)" Condition="'%(Filename)' == 'PresentationCore'" />
14 | <_RequiredWPFReferences Include="@(ReferencePath)" Condition="'%(Filename)' == 'PresentationFramework'" />
15 | <_RequiredWPFReferences Include="@(ReferencePath)" Condition="'%(Filename)' == 'WindowsBase'" />
16 |
17 |
20 |
21 |
22 |
23 | <_RequiredGTKReferences Include="@(ReferencePath)" Condition="'%(Filename)' == 'gtk-sharp'" />
24 |
25 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/AlignAnimation.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Layouts;
2 | using FluidSharp.Widgets;
3 | using SkiaSharp;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace FluidSharp.Animations
9 | {
10 | public class AlignAnimation : Widget
11 | {
12 |
13 | public Align A;
14 | public Align B;
15 |
16 | public float Percentage;
17 |
18 | public AlignAnimation(Align a, Align b, float percentage)
19 | {
20 | A = a ?? throw new ArgumentNullException(nameof(a));
21 | B = b ?? throw new ArgumentNullException(nameof(b));
22 | Percentage = percentage;
23 | }
24 |
25 | public static Widget Make(Align a, Align b, float pct)
26 | {
27 | if (pct <= 0) return a;
28 | if (pct >= 1) return b;
29 | return new AlignAnimation(a, b, pct);
30 | }
31 |
32 | public override SKSize Measure(MeasureCache measureCache, SKSize boundaries)
33 | {
34 | if (A.Child == B.Child) return A.Measure(measureCache, boundaries);
35 | var sa = A.Measure(measureCache, boundaries);
36 | var sb = B.Measure(measureCache, boundaries);
37 | var pcta = (1 - Percentage);
38 | var pctb = Percentage;
39 | return new SKSize(sa.Width * pcta + sb.Width * pctb, sa.Height * pcta + sb.Height * pctb);
40 | }
41 |
42 | public override SKRect PaintInternal(LayoutSurface layoutsurface, SKRect rect)
43 | {
44 | var recta = A.GetChildRect(layoutsurface, rect);
45 | var rectb = B.GetChildRect(layoutsurface, rect);
46 |
47 | var pcta = (1 - Percentage);
48 | var pctb = Percentage;
49 |
50 | var childrect = new SKRect(recta.Left * pcta + rectb.Left * pctb,
51 | recta.Top * pcta + rectb.Top * pctb,
52 | recta.Right * pcta + rectb.Right * pctb,
53 | recta.Bottom * pcta + rectb.Bottom * pctb);
54 |
55 | layoutsurface.Paint(A.Child, childrect);
56 |
57 | return childrect;
58 | }
59 |
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/DynamicAnimation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FluidSharp.Animations
6 | {
7 | public class DynamicAnimation : IAnimation
8 | {
9 |
10 | public Animation Animation;
11 |
12 | public DynamicAnimation(Animation animation)
13 | {
14 | Animation = animation;
15 | }
16 |
17 | public float GetValue() => Animation.GetValue();
18 | public bool Completed => Animation.Completed;
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/DynamicFrame.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FluidSharp.Animations
6 | {
7 | public class DynamicFrame : IAnimation
8 | {
9 |
10 | public Frame Frame;
11 |
12 | public DynamicFrame(Frame animation)
13 | {
14 | Frame = animation;
15 | }
16 |
17 | public float GetValue() => Frame.GetValue();
18 | public bool Completed => Frame.Completed;
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/Frame.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FluidSharp.Animations
4 | {
5 | public class Frame : Animation
6 | {
7 |
8 | // Frame
9 | public string Name { get; set; }
10 | public TimeSpan FrameStart { get; set; }
11 | public TimeSpan FrameEnd => FrameStart + Duration;
12 |
13 | public TimeSpan GetDurationPct(float pct) => FrameStart + Duration * pct;
14 |
15 | public Frame(string name, float durationMS, Easing? easing = null)
16 | : this(Speed, name, TimeSpan.Zero, TimeSpan.FromMilliseconds(durationMS), easing)
17 | { }
18 |
19 | public Frame(string name, float startMS, float durationMS, Easing? easing = null)
20 | : this(Speed, name, TimeSpan.FromMilliseconds(startMS), TimeSpan.FromMilliseconds(durationMS), easing)
21 | { }
22 |
23 | public Frame(string name, TimeSpan start, TimeSpan duration, Easing? easing = null)
24 | : this(Speed, name, start, duration, easing)
25 | {
26 | }
27 |
28 | private Frame(float speed, string name, TimeSpan start, TimeSpan duration, Easing? easing = null)
29 | {
30 | Name = name ?? throw new ArgumentNullException(nameof(name));
31 | FrameStart = start * speed;
32 | Duration = duration * speed;
33 | Easing = easing;
34 | }
35 |
36 | public Frame Reverse()
37 | {
38 | StartValue = 1; EndValue = 0;
39 | return this;
40 | }
41 |
42 | public Frame SetStartEnd(float start, float end)
43 | {
44 | StartValue = start;
45 | EndValue = end;
46 | return this;
47 | }
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/IAnimation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FluidSharp.Animations
6 | {
7 | public interface IAnimation
8 | {
9 |
10 | bool Completed { get; }
11 |
12 | public float GetValue();
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/OptionalAnimatedWidget.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Layouts;
2 | using FluidSharp.Widgets;
3 | using SkiaSharp;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Text;
7 |
8 | namespace FluidSharp.Animations
9 | {
10 | public class OptionalAnimatedWidget : Widget
11 | {
12 |
13 | public Func Animation;
14 | public Func MakeWidget;
15 |
16 | public OptionalAnimatedWidget(Func animation, Func makeWidget)
17 | {
18 | Animation = animation ?? throw new ArgumentNullException(nameof(animation));
19 | MakeWidget = makeWidget ?? throw new ArgumentNullException(nameof(makeWidget));
20 | }
21 |
22 | private Animation? LastAnimation;
23 | private Widget? Widget;
24 |
25 | private Widget? GetWidget()
26 | {
27 | var a = Animation();
28 | if (LastAnimation != a)
29 | {
30 | Widget = MakeWidget(a);
31 | LastAnimation = a;
32 | }
33 | return Widget;
34 | }
35 |
36 | public override SKSize Measure(MeasureCache measureCache, SKSize boundaries) => GetWidget()?.Measure(measureCache, boundaries) ?? new SKSize();
37 | public override SKRect PaintInternal(LayoutSurface layoutsurface, SKRect rect)
38 | {
39 | var widget = GetWidget();
40 | if (widget != null)
41 | return layoutsurface.Paint(widget, rect);
42 | else
43 | return rect.WithHeight(0);
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/State.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FluidSharp.Animations
4 | {
5 | public class State
6 | {
7 |
8 | public string Name { get; set; }
9 |
10 | public Animation.Coordinated Animation = new Animation.Coordinated(DateTime.UtcNow);
11 |
12 | public State(string name) => Name = name;
13 |
14 | public bool Started { get; set; }
15 | public bool Completed => Started && Animation.Completed;
16 |
17 | public Animation.Coordinated? AnimationIfStarted => Started ? Animation : null;
18 |
19 | public void Reset()
20 | {
21 | Started = false;
22 | }
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FluidSharp/Animations/StateAnimation.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FluidSharp.Animations
4 | {
5 | public class StateAnimation : Animation
6 | {
7 |
8 | public List States { get; set; } = new List();
9 |
10 | public State? CurrentState { get; private set; }
11 |
12 | public State Add(State state)
13 | {
14 | States.Add(state);
15 | return state;
16 | }
17 |
18 | public void StartState(State state)
19 | {
20 | state.Animation.Start();
21 | CurrentState = state;
22 | state.Started = true;
23 | }
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FluidSharp/Engine/EngineException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FluidSharp.Engine
6 | {
7 | public class EngineException : Exception
8 | {
9 | public EngineException(string message) : base(message)
10 | {
11 | }
12 | public EngineException(string message, Exception innerException) : base(message, innerException)
13 | {
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FluidSharp/Engine/MakeWidgetException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace FluidSharp.Engine
7 | {
8 | public class MakeWidgetException : Exception
9 | {
10 |
11 | private IDictionary Details;
12 | public override IDictionary Data => Details;
13 |
14 | public MakeWidgetException(string message, Exception innerException) : base(message, innerException)
15 | {
16 | Details = innerException?.Data;
17 | }
18 |
19 | public MakeWidgetException(string message, Exception innerException, Dictionary details) : base(message, innerException)
20 | {
21 | Details = details ?? innerException?.Data;
22 | }
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FluidSharp/Engine/MeasureException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace FluidSharp.Engine
7 | {
8 | public class MeasureException : Exception
9 | {
10 |
11 | private Dictionary Details;
12 | public override IDictionary Data => Details;
13 |
14 | public MeasureException(string message, Exception innerException, Dictionary details) : base(message, innerException)
15 | {
16 | Details = details;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FluidSharp/Engine/PaintException.cs:
--------------------------------------------------------------------------------
1 | using FluidSharp.Widgets;
2 | using System;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace FluidSharp.Engine
8 | {
9 | public class PaintException : Exception
10 | {
11 |
12 |
13 | public Widget Widget { get; set; }
14 |
15 | private IDictionary? Details;
16 | public override IDictionary Data => Details ?? new Dictionary();
17 |
18 | public PaintException(string message, Widget widget, Exception innerException) : base(message, innerException)
19 | {
20 | Widget = widget;
21 | Details = innerException?.Data;
22 | }
23 |
24 | public PaintException(string message, Widget widget, Exception innerException, Dictionary? details) : base(message, innerException)
25 | {
26 | Widget = widget;
27 | Details = details ?? innerException?.Data;
28 | }
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/FluidSharp/Engine/TapHandlerException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace FluidSharp.Engine
7 | {
8 | public class TapHandlerException : Exception
9 | {
10 |
11 | private IDictionary Details;
12 | public override IDictionary Data => Details;
13 |
14 | public TapHandlerException(string message, object context, Exception innerException) : base(message, innerException)
15 | {
16 | Details = innerException?.Data ?? new Dictionary