Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

MAUI: first steps #241

Closed
wants to merge 14 commits into from
Closed

MAUI: first steps #241

wants to merge 14 commits into from

Conversation

webwarrior-ws
Copy link
Contributor

@webwarrior-ws webwarrior-ws commented Nov 22, 2023

Supersedes #199

@knocte knocte changed the title Rebase MAUI branch on current master MAUI: first steps Nov 22, 2023
@knocte knocte mentioned this pull request Nov 22, 2023
@knocte
Copy link
Member

knocte commented Nov 23, 2023

@webwarrior-ws 2 things:

  • Can you squash 24baa4d commit with the previous one (but mentioning in commit msg), in the same way that we didn't have a single commit for its addition.
  • In the commit that introduces the JDK at CI, please add the URL https://stackoverflow.com/a/77519085/544947 to the commit msg for reference.

parhamsaremi and others added 14 commits November 23, 2023 10:48
Used the template in [1] for Maui.

Install JDK 11 to fix error "Java SDK 11.0 or above is required
when using .NET 6 or higher" when building MAUI Android
frontend [2].

[1] https://github.com/fabulous-dev/FSharp.Mobile.Templates/tree/stable-net6.0/templates/Maui
[2] https://stackoverflow.com/a/77519085/544947
This way we don't have to implement everything from the
beginning, and we can reuse old codes.

Remove "Install JDK 21" step as it's no longer needed.
Workaround for `"RuntimeConfigParserTask" task was not found`
error when building and deploying Android frontend using
Visual Studio 2022.
We use our own fork of maui for building maui-gtk since we
fixed some things.

Maui: added as submodule. Gtk workload: as automatic workload
manifest detection doesn't work for some reason, download and
uzip mainfest file so .NET knows about gtk workload.

Because of new versions of manifest, we got the following
error. So by skipping manifest update we make sure that
we don't get unwanted updates.
```
Workload installation failed: Failed to install manifest gtksharp.net.sdk.gtk version 3.24.24-rev.87-develop: gtksharp.net.sdk.gtk.manifest-6.0.300::3.24.24-rev.87-develop is not found in NuGet feeds https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-531f715f/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3f6c45a2/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3f6c45a2-1/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json;https://pkgs.dev.azure.com/xamarin/public/_packaging/SkiaSharp/nuget/v3/index.json;https://nuget.pkg.github.com/GtkSharp/index.json"..
```

Co-authored-by: webwarrior <[email protected]>
Initial window size was too thin so we tried to resize
the window once it's created.

Co-authored-by: webwarrior <[email protected]>
Use Grid instead of StackLayout so that Maui layout is fixed.

Co-authored-by: webwarrior-ws <[email protected]>
Add WelcomePage2 .xaml and .xaml.fs files. Enable navigation
to WelcomePage2 in MAUI version of WelcomePage. Fix navigation
by referencing Initialization.fs from Frontend.XF and using
it to set main page like it is done in Frontend.XF project.
Use Grid instead of StackLayout so that Maui layout is fixed.

Co-authored-by: Parham <[email protected]>
Change launchSettings.json so debugging is possible in Linux
using JetBrains Rider.
Added LoadingPage.

Abstracted StartTimer function to work on both Xamarin.Forms
and Maui (Device.StartTimer is deprecated in Maui).

Add mappers for BorderColor and CornerRadius for Frame
elements so they can now have borders.

Use Grid instead of StackLayout so that Maui layout is fixed.

Co-authored-by: Parham <[email protected]>
Add BalancesPage.

Fixed and simplified layout of BalancesPage.

Fix layout of currency balances on balances page in Maui.

Fix circle chart rendering in Maui.

Use Launcher from Maui.Essentials on Maui instead of one from
Xamarin.Essentials.

Made click event handlers work for Gtk. Had to wrap footer label
in a Frame for this.

LogoImg had wrong size and it had to be resized based on the
layout size. The reason is that Aspect for Image is not working
in Maui/Gtk and should be fixed later.

Also added #nowarn 44 and #nowarn 1182 in BalancesPage,
CircleChartView, and FrontendHelpers because of the following
warnings:

```
BalancesPage.xaml.fs(503, 13): [FS1182] The value 'tapper' is unused
BalancesPage.xaml.fs(443, 13): [FS1182] The value 'currentChartView' is unused
BalancesPage.xaml.fs(443, 30): [FS1182] The value 'otherChartView' is unused
BalancesPage.xaml.fs(439, 41): [FS1182] The value 'totalOtherFiatAmountFrame' is unused
BalancesPage.xaml.fs(437, 13): [FS1182] The value 'switchingToReadOnly' is unused
CircleChartView.fs(181, 35): [FS0044] This construct is deprecated. The StackLayout expansion options are deprecated; please use a Grid instead.
BalancesPage.xaml.fs(53, 19): [FS1182] The value 'currencyImages' is unused
CircleChartView.fs(180, 37): [FS0044] This construct is deprecated. The StackLayout expansion options are deprecated; please use a Grid instead.
FrontendHelpers.fs(425, 60): [FS0044] This construct is deprecated. The StackLayout expansion options are deprecated; please use a Grid instead.
```

Co-authored-by: Parham <[email protected]>
Add ZXing.Net.Maui library for barcode gerneration/reading.
It is successor to ZXing.Net.Mobile, which is used in XF
project.

Use CrossMaui version of ZXing.Net.Maui libraryon Gtk.
Reference projects directly instead of using nuget packages.
Added PairingToPage, PairingFromPage, Send, Receive pages.

Made PairingFrom page work on Maui by moving configuration
of barcode view from .xaml file to code. Use Grid instead
of StackLayout so that Maui layout is fixed. Upgrade SendPage
layout so that Maui and Xamarin look like each other.

Abstracted creation of barcode scanner page to
FrontendHelpers.GetBarcodeScannerPage function. Moved platform
checking logic to one place (canScanBarcode variable).
This removes code duplication between XF and Maui.

If QR code is invalid, show alert to the user instead of
crashing the app.

Fix crash after scanning barcode by checking if modal stack
is not empty before calling PopModalAsync().

Co-authored-by: Parham <[email protected]>
Save previous assigned color and use instead of Color.Default.
This is needed because maui doesn't have Color.Default [1]. And
this commit is workaround for that.

[1] dotnet/Microsoft.Maui.Graphics#57
Use nuget source instead of Github packages so that there is
no need for authentication anymore.

Update maui submodule to point to CrossMaui/new branch.
knocte pushed a commit that referenced this pull request Mar 20, 2024
Use Grid instead of StackLayout so that our upcoming Maui app's
layout is fixed. See [1] for more info.

This commit was extracted from the MAUI PR [2].

[1] https://github.com/dotnet/maui/wiki/Xamarin.Forms----MAUI.Controls-Layout-Differences#stacklayout
[2] #241

Co-authored-by: webwarrior-ws <[email protected]>
knocte pushed a commit that referenced this pull request Mar 20, 2024
Use Grid instead of StackLayout so that our upcoming Maui app's
layout is fixed. See [1] for more info.

This commit was extracted from the MAUI PR [2].

[1] https://github.com/dotnet/maui/wiki/Xamarin.Forms----MAUI.Controls-Layout-Differences#stacklayout
[2] #241

Co-authored-by: webwarrior-ws <[email protected]>
knocte pushed a commit that referenced this pull request Mar 20, 2024
Use Grid instead of StackLayout so that our upcoming Maui app's
layout is fixed. See [1] for more info.

This commit was extracted from the MAUI PR [2].

[1] https://github.com/dotnet/maui/wiki/Xamarin.Forms----MAUI.Controls-Layout-Differences#stacklayout
[2] #241

Co-authored-by: webwarrior-ws <[email protected]>
knocte added a commit that referenced this pull request Mar 22, 2024
Refactoring (for DRY) taken from the MAUI PR:
#241
knocte added a commit that referenced this pull request Apr 11, 2024
Extracted some things from MAUI PR:
#241
@webwarrior-ws webwarrior-ws mentioned this pull request Apr 18, 2024
@knocte knocte force-pushed the master branch 2 times, most recently from b841302 to ccb1641 Compare May 8, 2024 09:18
@knocte
Copy link
Member

knocte commented May 23, 2024

Superseded by #274

@knocte knocte closed this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants