I want to create background for my main View where topLeft
and bottomLeft
corners will be rounded but right corners will be normal.
I've done this for several times for my RecyclerView
layouts to make rounded corners for each View
, but now it caused render error as I use elevation
or translationZ
to make soft shadow around the View
.
Error: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed.
I found cause of this error. It seems like Android P has some issues with corner radius as it was stated here: java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE in Button background failure
Problem is that if I apply android:radius
it will change radius for all 4 corners what I don't want. Is there any way how to make it functional?
Here is my background xml:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/background_light"/>
<corners
android:topLeftRadius="7dp"
android:bottomLeftRadius="7dp"/>