dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

Shadow not rendering properly[Android] #20518

Open MohanrajSF3559 opened 8 months ago

MohanrajSF3559 commented 8 months ago

Description

The shadow was not applied to the right and bottom of all the layouts (I have added a sample grid). I have attached the sample for that. With clip sample below:

public class CustomView : Grid
{
    public CustomView()
    {
        this.HeightRequest = 300;
        this.WidthRequest = 300;
        this.BackgroundColor = Colors.Lavender;
        this.Shadow = new Shadow()
        {
            Brush = Brush.Red,
            Opacity = 5,
            Offset = new Point(1, 1),
        };
        this.Clip = new RoundRectangleGeometry(new CornerRadius(20), new Rect(0, 0, 300, 300));
    }
}

You can see the differences between.NET MAUI 7 and 8 below. In Android With Clip output in.NET MAUI 7: image

In Android With Clip output in.NET MAUI 8: image

Without Clip Sample below:

public class CustomView : Grid
{
    public CustomView()
    {
        this.HeightRequest = 300;
        this.WidthRequest = 300;
        this.BackgroundColor = Colors.Lavender;
        this.Shadow = new Shadow()
        {
            Brush = Brush.Red,
            Opacity = 5,
            Offset = new Point(1, 1),
        };
    }
}

You can see the differences between.NET MAUI 7 and 8 below. In Android Without Clip output in.NET MAUI 7: image

In Android Without Clip output in.NET MAUI 8: image

In the above with and without clip sample in.NET MAUI 7 and 8, the shadow was applied properly, like in the below image.

Windows output without clip in.NET 7 and 8. image

Windows output with clip-in.NET MAUI 7 and 8. image

Steps to Reproduce

  1. Run the sample in Android.
  2. You can see the output.

Link to public reproduction project repository

https://github.com/dotnet/maui/files/14238936/Shadoweffect.zip

Version with bug

Unknown/Other

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

No response

Relevant log output

No response

PureWeen commented 8 months ago

Duplicate of #15023

ghost commented 8 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

MohanrajSF3559 commented 8 months ago

Hi, @PureWeen ,

If you have any workarounds for this issue,. If you know, please let me know.