Grial-UI-Kit-Support icon indicating copy to clipboard operation
Grial-UI-Kit-Support copied to clipboard

FloatingMenu error application crash

Open marketdevsoft opened this issue 2 years ago • 0 comments

When test Floating menu, my application crash .

Description

I test the floating menu following documentation example here: https://docs.grialkit.com/controls/floating_menu/ Now i try with .NET 7 in android simulator with api 30, and "UXDivers.GrialMaui" Version="4.0.66-RC". When i push into plus button, the application crash ... and i find this error in device-logger:

pixel_5_-api_30 Error 21582 MessageQueue-JNI android.runtime.JavaProxyThrowable: System.InvalidCastException: Arg_InvalidCastException at UXDivers.Grial.ScreenHelper.GetScreenCoordinates(VisualElement view) at UXDivers.Grial.FloatingMenu.AddCloseButton() at UXDivers.Grial.FloatingMenu.FloatingMenuTapped(Object sender, EventArgs e) at Microsoft.Maui.Controls.TapGestureRecognizer.SendTapped(View sender, Func`2 getPosition) at Microsoft.Maui.Controls.Platform.TapGestureHandler.OnTap(Int32 count, MotionEvent e) at Microsoft.Maui.Controls.Platform.InnerGestureListener.Android.Views.GestureDetector.IOnGestureListener.OnSingleTapUp(MotionEvent e) at Android.Views.GestureDetector.IOnGestureListenerInvoker.n_OnSingleTapUp_Landroid_view_MotionEvent(IntPtr , IntPtr , IntPtr ) at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_Z(_JniMarshal_PPL_Z , IntPtr , IntPtr , IntPtr )

Steps to Reproduce

This is the simple page that i use for my test:

<ContentPage.Resources>
    
    <!-- FLOATING MENU BUTTON TEMPLATE -->
    <ControlTemplate x:Key="FloatingMenu_ControlTemplate">
        <grial:CardView
            CornerRadius="25"
            HeightRequest="50"
            WidthRequest="50"
            ShadowOpacity="0.2"
            ShadowSize="15"
            grial:Effects.ShadowIOSOffset="10"
            BackgroundColor="{ DynamicResource BasePageColor }"
            Padding="0">
            <Label
                HorizontalOptions="Center"
                VerticalOptions="Center"
                FontSize="30"
                FontFamily="{ StaticResource IconsFontFamily }"
                Text="{ x:Static local:GrialIconsFont.Plus }"
                TextColor="{ DynamicResource AccentColor }"
            />
        </grial:CardView>
    </ControlTemplate>

    <!-- FLOATING MENU CLOSE BUTTON TEMPLATE -->
    <ControlTemplate x:Key="FloatingMenu_CloseButtonControlTemplate">
        <Grid
            grial:Effects.CornerRadius="25"
            HeightRequest="50"
            WidthRequest="50"
            BackgroundColor="{ DynamicResource AccentColor }"
            Padding="0">
            <Label
                HorizontalOptions="Center"
                VerticalOptions="Center"
                FontSize="30"
                FontFamily="{ StaticResource IconsFontFamily }"
                Text="{ x:Static local:GrialIconsFont.Close }"
                TextColor="{ DynamicResource OverDarkTextColor }"
            />
        </Grid>
    </ControlTemplate>
    
</ContentPage.Resources>


<ContentPage.Content>

    <Grid ColumnDefinitions="*,*,*"
          RowDefinitions="*,*,Auto">


        <grial:FloatingMenu
            Grid.Row="1"
            ItemsAlignment="End"
            Spacing="30"
            ControlTemplate="{ StaticResource FloatingMenu_ControlTemplate }"
            CloseButtonTemplate="{ StaticResource FloatingMenu_CloseButtonControlTemplate }"
            >
            <grial:FloatingMenu.ItemControlTemplate>
                <ControlTemplate>
                    <grial:ExtendedGrid
                        Padding="5"
                        grial:Effects.CornerRadius="20"
                        BackgroundColor="{ DynamicResource AccentColor }"
                        >
                        <!-- BG -->
                        <BoxView
                            CornerRadius="15"
                            BackgroundColor="{ DynamicResource BasePageColor }"
                        />

                        <!-- TEXT -->
                        <Label
                            Margin="10,0"
                            Text="{ TemplateBinding Text }"
                            VerticalOptions="Center"
                            HorizontalOptions="Center"
                        />
                    </grial:ExtendedGrid>
                </ControlTemplate>
            </grial:FloatingMenu.ItemControlTemplate>

            <grial:FloatingMenuItem
                Text="Option 1"
                />

            <grial:FloatingMenuItem
                Text="Option 2"
                />

            <grial:FloatingMenuItem
                Text="Option 3"
                />
        </grial:FloatingMenu>

    </Grid>

</ContentPage.Content>

Expected Behavior

Actual Behavior

Application crash when i push the "plus" action menu button ! Those are the android log information:

Ora Nome del dispositivo Tipo PID Tag Messaggio pixel_5_-api_30 Error 21582 MessageQueue-JNI android.runtime.JavaProxyThrowable: System.InvalidCastException: Arg_InvalidCastException at UXDivers.Grial.ScreenHelper.GetScreenCoordinates(VisualElement view) at UXDivers.Grial.FloatingMenu.AddCloseButton() at UXDivers.Grial.FloatingMenu.FloatingMenuTapped(Object sender, EventArgs e) at Microsoft.Maui.Controls.TapGestureRecognizer.SendTapped(View sender, Func`2 getPosition) at Microsoft.Maui.Controls.Platform.TapGestureHandler.OnTap(Int32 count, MotionEvent e) at Microsoft.Maui.Controls.Platform.InnerGestureListener.Android.Views.GestureDetector.IOnGestureListener.OnSingleTapUp(MotionEvent e) at Android.Views.GestureDetector.IOnGestureListenerInvoker.n_OnSingleTapUp_Landroid_view_MotionEvent(IntPtr , IntPtr , IntPtr ) at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_Z(_JniMarshal_PPL_Z , IntPtr , IntPtr , IntPtr )

Basic Information

  • Version with issue: 4.0.66-RC
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

marketdevsoft avatar Dec 02 '22 08:12 marketdevsoft