Closed LinKav20 closed 1 year ago
It works. I wanted rounded corners and shadow.
I've tried to mixed it, but it failed.
Rounded cornes: (as readme) Background is rounded corners and no solid color and I set the elevation. Outline provider is ViewOutlineProvider.BACKGROUND In this variant I have a rounded corners shape and no shadow
Shadow: All the same as above but outline provider is ViewOutlineProvider.BOUNDS In this variant I have a rectangle shape and shadow
Unfortunatelly I have no idea how to mixed it
Right.
To work it around you can do something like this.
blurView.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
blurView.getBackground().getOutline(outline);
outline.setAlpha(1f);
}
});
I.e. it's still de-facto a BACKGROUND
provider, but it fixes the 0 alpha outline of the transparent background, which also affects the alpha of the elevation shadow
I also just pushed this example to the sample app
Thank you, everything worked out!
Pretty much the same way as with other Views. Add a background, and set elevation. If you don't want to add a background, setting the outline provider to
BOUNDS
should also work