Fabulous icon indicating copy to clipboard operation
Fabulous copied to clipboard

Add support for MAUI

Open TimLariviere opened this issue 2 years ago • 14 comments

Now that MAUI Release Candidate 1 is released, I'm taking a stab at supporting it.

IDE support on macOS is completely absent but running via command line works.

// iOS
dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=59F2133A-63ED-4791-A795-8F23C61E678B

// Android
dotnet build -t:Run -f net6.0-android

// Mac Catalyst
dotnet build -t:Run -f net6.0-maccatalyst

TimLariviere avatar Apr 13 '22 14:04 TimLariviere

@edgarfgp If you want to play with it, this branch is ready for experimentations You'll have to open Fabulous-Maui.sln. The main sln doesn't seem Maui friendly

TimLariviere avatar Jun 21 '22 14:06 TimLariviere

Thanks so much . I will play a long and see if we can make some progress . :)

edgarfgp avatar Jun 21 '22 14:06 edgarfgp

Managed to get the label displayed

TimLariviere avatar Jul 01 '22 15:07 TimLariviere

Trying to make some progress on the Maui support. Getting closer to get a running sample, but still quite far from having anything usable.

Current state: I can display a Label and a Button inside a Window. The button sends the events correctly but Maui isn't updating the UI despite calling handler.UpdateValue("Text"). Also, VStack/HStack are not displaying anything.

TimLariviere avatar Aug 12 '22 21:08 TimLariviere

... and the IDEs crashing when I'm debugging aren't making anything easier.

TimLariviere avatar Aug 12 '22 21:08 TimLariviere

Was missing the synchronization with the main thread. Now it's working 🎉

TimLariviere avatar Aug 13 '22 06:08 TimLariviere

Nice . Let me know if there is any thing I can help ?

edgarfgp avatar Aug 13 '22 06:08 edgarfgp

While adding support for Maui . Could we review the Light and Dark support for text images , maybe also the styling ?

edgarfgp avatar Aug 14 '22 07:08 edgarfgp

Nice . Let me know if there is any thing I can help ?

Thanks for asking :) Right now, I'm still struggling to understand how controls work in Maui. If you feel like it, I can use another brain to reverse-engineer Maui to get the Hello World sample running 😄

This commented code is the sample I want to get working: https://github.com/fsprojects/Fabulous/pull/919/files#diff-d7b680c6fd70cff6508141ef3a2b3414f496d8f4ef5101b06910b120fb585c47R62-R91

While adding support for Maui . Could we review the Light and Dark support for text images , maybe also the styling ?

Sure. Do you have an idea how you would do it differently?

TimLariviere avatar Aug 15 '22 06:08 TimLariviere

Small update: got StackLayout to work 🎉

TimLariviere avatar Aug 19 '22 13:08 TimLariviere

image

TimLariviere avatar Aug 19 '22 14:08 TimLariviere

https://github.com/dotnet/maui/issues/5835

TimLariviere avatar Aug 20 '22 09:08 TimLariviere

Still have some layout issues, but I made some progress

TimLariviere avatar Aug 22 '22 09:08 TimLariviere

I ported the TicTacToe sample. It's not exactly the same than the XF one because Maui.Core lacks some features: OnSizeAllocated and RequestedThemeChanged.

TimLariviere avatar Aug 27 '22 10:08 TimLariviere

The direct support for Maui (without Maui.Controls & XAML) has been moved to https://github.com/fsharp-mobile/Fabulous.Maui

TimLariviere avatar Nov 25 '22 20:11 TimLariviere