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

Closed
wants to merge 25 commits into from
Closed

MAUI: first steps #274

wants to merge 25 commits into from

Commits on May 14, 2024

  1. Add Maui base project

    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
    parhamsaremi authored and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    5eb9cb8 View commit details
    Browse the repository at this point in the history
  2. Frontend.Maui: use XF xaml files for building proj

    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.
    parhamsaremi authored and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    558aa0f View commit details
    Browse the repository at this point in the history
  3. Frontend.Maui: workaround for build fail in VS22

    Workaround for `"RuntimeConfigParserTask" task was not found`
    error when building and deploying Android frontend using
    Visual Studio 2022.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    fd8cef9 View commit details
    Browse the repository at this point in the history
  4. Frontend.Maui: build Maui on linux using GTK

    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 <reg@webwarrior.ws>
    parhamsaremi and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    5d5fbb8 View commit details
    Browse the repository at this point in the history
  5. CI: build Maui (non-GTK) frontend

    Build Maui Android frontend in macOS--dotnet6-and-mono CI lane.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    714a0a9 View commit details
    Browse the repository at this point in the history
  6. Frontend.Maui: fix window size for gtk

    Initial window size was too thin so we tried to resize
    the window once it's created.
    
    Also extracted default window size to a constant in
    FrontendHelpers to prevent code duplication.
    
    Co-authored-by: webwarrior <reg@webwarrior.ws>
    parhamsaremi and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    fabfff0 View commit details
    Browse the repository at this point in the history
  7. Frontend.MAUI: add WelcomePage2

    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 <parhaamsaremi@gmail.com>
    webwarrior-ws and parhamsaremi committed May 14, 2024
    Configuration menu
    Copy the full SHA
    bb18fbe View commit details
    Browse the repository at this point in the history
  8. Frontend.Maui: make possible debugging in Linux

    Change launchSettings.json so debugging is possible in Linux
    using JetBrains Rider.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    4b18c4b View commit details
    Browse the repository at this point in the history
  9. Frontend.Maui: add LoadingPage

    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 <parhaamsaremi@gmail.com>
    webwarrior-ws and parhamsaremi committed May 14, 2024
    Configuration menu
    Copy the full SHA
    3275199 View commit details
    Browse the repository at this point in the history
  10. Frontend.Maui: add BalancesPage

    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 <parhaamsaremi@gmail.com>
    webwarrior-ws and parhamsaremi committed May 14, 2024
    Configuration menu
    Copy the full SHA
    46425f4 View commit details
    Browse the repository at this point in the history
  11. Frontend.Maui: add ZXing.Net.Maui library

    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.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    cdac9ba View commit details
    Browse the repository at this point in the history
  12. Frontend(XF,Maui): added remaining pages

    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 <parhaamsaremi@gmail.com>
    webwarrior-ws and parhamsaremi committed May 14, 2024
    Configuration menu
    Copy the full SHA
    f55443c View commit details
    Browse the repository at this point in the history
  13. Frontend.Maui: Color.Default equivalent for maui

    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
    parhamsaremi authored and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    a294fd0 View commit details
    Browse the repository at this point in the history
  14. GithubCI: use nuget source instead of Github

    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.
    parhamsaremi authored and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    7928017 View commit details
    Browse the repository at this point in the history
  15. CI: upoad APK as CI artifact

    Added stepsto upload generated APK file as CI artifact.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    28a69ab View commit details
    Browse the repository at this point in the history
  16. sln,Frontend.Maui: allow proj be built in VS4Mac

    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.
    knocte authored and webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    cb20b99 View commit details
    Browse the repository at this point in the history
  17. WIP: show navigation bar on Android

    Currently crashes the app if using back arrow.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    c686390 View commit details
    Browse the repository at this point in the history
  18. CI,Scripts,Frontend.Maui: build MAUI snap

    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.
    webwarrior-ws committed May 14, 2024
    Configuration menu
    Copy the full SHA
    f33d633 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Snap: use dotnet runtime from packages

    As a workaround to [1].
    
    [1] canonical/dotnet-snap#14
    webwarrior-ws committed May 22, 2024
    Configuration menu
    Copy the full SHA
    eb6c79b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fab2ea2 View commit details
    Browse the repository at this point in the history
  3. Frontend.Maui: switch to .NET8

    Switch to .NET8 to fix bug in Android when using back button
    in navigation bar crashes the app. Continue using .NET6 for
    GTK.
    webwarrior-ws committed May 22, 2024
    Configuration menu
    Copy the full SHA
    fce76f0 View commit details
    Browse the repository at this point in the history
  4. Dependencies: update Maui dependency

    To include latest changes regarding Gtk application id. Use
    default MauiGtkApplication.Name derived from executable name.
    webwarrior-ws committed May 22, 2024
    Configuration menu
    Copy the full SHA
    e7b1376 View commit details
    Browse the repository at this point in the history
  5. CI,Scripts: upload MAUI snap to snap store

    Upload alpha (MAUI) snap package to snap store.
    webwarrior-ws committed May 22, 2024
    Configuration menu
    Copy the full SHA
    5612640 View commit details
    Browse the repository at this point in the history
  6. Frontend.Maui: show nav toolbar after page load

    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.
    webwarrior-ws committed May 22, 2024
    Configuration menu
    Copy the full SHA
    edc6006 View commit details
    Browse the repository at this point in the history
  7. Frontend.Maui: update Maui dependency

    To latest version that uses NonUnique flag for Gtk.Application.
    This removes need for DBus communication, so removed DBus slot
    from snapcraft.yaml.
    webwarrior-ws committed May 22, 2024
    Configuration menu
    Copy the full SHA
    150dcce View commit details
    Browse the repository at this point in the history