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 #299

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

webwarrior-ws
Copy link
Contributor

Supersedes #279

@webwarrior-ws webwarrior-ws mentioned this pull request Nov 26, 2024
@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch 2 times, most recently from 96eedb1 to ae54cc8 Compare November 26, 2024 12:42
@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch from ae54cc8 to 5d13d4b Compare November 26, 2024 12:55
@webwarrior-ws webwarrior-ws reopened this Nov 26, 2024
@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch 7 times, most recently from 1a4f693 to b622bfe Compare December 4, 2024 13:18
@knocte
Copy link
Member

knocte commented Dec 4, 2024

There's no reason for not squashing the commit that switches to Mali and the commit that removes the submodule?

BTW CI is failing, I think it's master branch?, let's create a PR to fix it.

@webwarrior-ws
Copy link
Contributor Author

CI is failing with error GitHub Actions has encountered an internal error when running your job..
So I think it's temporary problem.

@knocte
Copy link
Member

knocte commented Dec 4, 2024

Did you have a look at the recent scheduled CI runs of geewallet repo?

@webwarrior-ws
Copy link
Contributor Author

Did you have a look at the recent scheduled CI runs of geewallet repo?

The last CI run on master has the same strange error.

@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch from d1933a1 to 2251ed7 Compare December 4, 2024 13:34
@webwarrior-ws
Copy link
Contributor Author

Maybe we need to update our MacOS version in workflow.

@knocte
Copy link
Member

knocte commented Dec 4, 2024

Maybe we need to update our MacOS version in workflow.

Maybe, please have a look.

@webwarrior-ws
Copy link
Contributor Author

It is indeed a problem with MacOS version. I switched to version 13 here, but now these MacOS jobs are red.

@knocte
Copy link
Member

knocte commented Dec 9, 2024

Let's rebase this when you have time @webwarrior-ws (lower priority task).

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].

Disable checking of out-of-support workloads in
Frontend.Maui.fsproj so that project can be built because it
still uses .NET6 workloads.

[1] https://github.com/fabulous-dev/FSharp.Mobile.Templates/tree/stable-net6.0/templates/Maui
[2] https://stackoverflow.com/a/77519085/544947
@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch 4 times, most recently from e54ff2a to a8bc181 Compare December 11, 2024 13:41
parhamsaremi and others added 3 commits December 12, 2024 14:19
This way we don't have to implement everything from the
beginning, and we can reuse existing code.

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]>
webwarrior-ws and others added 22 commits December 12, 2024 14:20
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.
Added stepsto upload generated APK file as CI artifact.
The new MAUI project was not included in the solution so you
could not build it in VS4Mac. After trying it, it was giving
a clang compiler error, that we avoid with a workaorund in
the project file.
Currently crashes the app if using back arrow.
Build MAUI snap (snap_alpha job) in addition to XF snaps.

Temporarily remove CI snap_aplha job dependencies.

Make MAUI/Gtk app process console args, and if it's
"--version", print version and exit without launching UI.

Ignore Frontend.Maui in FindOffendingPrintfUsage function as
it's not relevant for new .NET versions used by MAUI.

Change app name on Gtk so that name can be used in dbus
slots declaration in snap.

Use snapcraft 7.x for MAUI and continue using snapcraft 6.x
for XF.
Since dotnet-runtime-6.0 causes the following error when
running snap:
```
Error: [/snap/gee-maui-preview/x1/usr/share/dotnet/host/fxr] does not exist
```
Switch to .NET8 to fix bug in Android when using back button
in navigation bar crashes the app. Continue using .NET6 for
GTK.
To include latest changes regarding Gtk application id. Use
default MauiGtkApplication.Name derived from executable name.
Show navigation toolbar only after page is loaded in MAUI.
Otherwise, navigation toolbar would show up briefly on old page
(BalancesPage in our case) before switching to new page.
To latest version that uses NonUnique flag for Gtk.Application.
This removes need for DBus communication, so removed DBus slot
from snapcraft.yaml.
Change Maui submodule to track Mali repository since this is
what CrossMaui was renamed to.
Fix window title on Gtk platform.
Show navigation bar on ReceivePage after navigating to it as
a result of sending transaction.
Set padding for buttons on Gtk to be consistent with other
platforms as they have padding around buttons by default.
Determine frontend to be built in configure script and build it
in make script.

Have 2 variants of global.json (one for MAUI/Gtk with .NET6
and one for other MAUI platfoprms with .NET8) and choose
appropriate one in configure script.
Fix spacing after "Amount" label in SendPage on Gtk platform
so that it is the same as on other platforms.
Extracted installation of gtk workload and adding Maui nuget
source to separate script to remove code duplication.

Renamed DotNetVersion to DotNetVersionForMauiGtk and made it
and GtkSharpVersion workflow-level env vars in CI.yml.
Fix WelcomePage layout on MAUI/Gtk by using Mali commit that
has better approximation for Label desired size on Gtk.
@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch from 7254346 to 6cff6cd Compare December 12, 2024 13:23
Switch to using .NET 8 for all frontends. Use Maui 8 on Gtk.
This unifies .NET versions and gets rid of .NET 6, which is
nearing end of suport anyway.

Update Microsoft.Extensions.DependencyInjection to v 8.0.0.
This iss needed to avoid error:
```
error NU1605: Warning As Error: Detected package downgrade:
Microsoft.Extensions.DependencyInjection from 8.0.0 to 6.0.0. Reference
the package directly from the project to select a different version.
```

Install maui workloads on windows--dotnet8-* lanes so that
Maui/Android can be built.

Call fsxc with DOTNET_ROLL_FORWARD=Major to allow it to run
under newer .NET version (we use .NET8 now, and fsxc is
compiled for .NET6).
Fix layout regressions in BalancesPage on Maui/Gtk after
upgrading to Maui 8.
Implemented workaround for incorrect width of some buttons on
Gtk (which were stretched to window width) by introducing
3 columns to grids in ReceivePage and SendPage. Buttons are
placed in central column, while other grid children span all
3 columns.
Fixed layout of date picker in WelcomePage on Maui/Gtk. It was
way too tall, now it has height of about one line of text, like
on other platforms.
Upload alpha (MAUI) snap package to snap store.
Reference Mali nuget packages instead of projects in maui
submodule.

Remove maui submodule that is no longer used.
@webwarrior-ws webwarrior-ws force-pushed the maui-conversion-rebased branch from 4a64604 to 6812f2c Compare December 16, 2024 09:18
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