question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rotating any view 180 degrees causes shadow to disappear completely

See original GitHub issue

Hello,

I know I am fighting against a massive corporation, but I have tried my best to get at least someone that works with Skia/MaterialComponents to fix this annoying issue which has destroyed my codebase.

I am working on a paint app, and in this app, the user has the option to rotate the canvas, this feature can be useful in some scenarios.

The problem I am having, is that when I rotate the MaterialCardView, which hosts the canvas/bitmap, 180 degrees – the drop shadow (card elevation) disappears. I do not get this problem when I rotate the MaterialCardView any angle but 180 degrees, only 180 degrees.

Below are some examples:

0 degrees:

image

180 degrees:

image

My app is greatly suffering because of this bug as I’ve had to resort to quite frankly terrible workarounds – such as setting the rotation as 179.9.

Upon doing more research I discovered that this issue was reported twice in IssueTracker:

https://issuetracker.google.com/issues/173730323

https://issuetracker.google.com/issues/137454913

To my shock, it was marked as resolved.

This issue is NOT resolved in Android at least, and is easily reproducible when creating a new project in Android Studio Dolphin. With all due respect, it’s just absolutely insane that this bug still exists, and I have had to deal with at least 5 bugs because of the workaround that someone helped me come up with. I also have to delay the release of my next app’s version because of all the bugs because of this issue.

My codebase is also greatly suffering because of the workaround. It’s almost as if you guys don’t care about developers and are just sweeping this issue under the rug. Release after release after release and absolutely no comment in regards to this issue.

Can you please patch this bug?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
drchencommented, Sep 7, 2022
  1. It’s an Android framework issue, not a Material library issue. A fix definitely won’t reside on the library end, and we really don’t have the expertise to fix it either.
  2. Per what issue tracker said, this should be fixed on Android R+. Did you try this on Android R or S?
  3. Issue tracker is the best way to reach out to the relevant framework team, even for us it’s the same. So if this is a huge blocker to your app/work, please file a new issue to the issue tracker and highlight that you think this has not been fixed.
0reactions
patzlycommented, Sep 7, 2022

That might be the case, but in general for 180 degrees there always is the workaround I said. It’s a more or less rare case that a view with elevation has to be rotated 180 degrees in my opinion and it would be unnecessarily much internal work on shadow rendering or rendering in general only to fix this rare case.

Just pack your views inside of a FrameView and rotate this FrameView instead of the container CardView, then you no longer have any issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android MaterialCardView's drop shadow/elevation ...
As you can see, no drop shadow when it's rotated 180 degrees (when the origin is 0 degrees). This problem is not major...
Read more >
Why drop shadow disappears according to rotation settings?
The first and biggest problem that I see is the direction of the shadow. The light is coming from the upper right side...
Read more >
How to use Android 12's clever new auto-rotate system
With Android 12, Google has introduced a smarter way to control when your screen switches between its vertical and horizontal orientations.
Read more >
Rebuttals to Eric Dubay's “200 Proofs Earth is not a Spinning ...
1 “The horizon always appears perfectly flat 360 degrees around the observer regardless of altitude. All amateur balloon, rocket, plane and drone footage ......
Read more >
ASS Tags - Aegisub 手册
Rotating on it (with positive values) causes the text to rotate in 2D, counterclockwise (as standard for degrees). The rotation amount is given...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found