prat
prat

Reputation: 647

Floating Action Menu , Shadow cut by Square from Right and Bottom in Lollipop and above versions

I have problem similar to this linkbut reproducing only in lollipop and above versions.

Also am using the same tutorial for my implementation.

Somehow using the below code, i am able to remove the square shadow using below code:

Button fab = (Button) findViewById(R.id.fab);
//Outline outline = new Outline();
//outline.setOval(0, 0, size, size);
//fab.setOutline(outline);  
ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            // Or read size directly from the view's width/height
            int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
            outline.setOval(0, 0, size, size);
        }
    };
fab.setOutlineProvider(viewOutlineProvider);

But using above code, I am again getting a weird (half circle) shadow on the top of floating action button, like this:

enter image description here

Also the code is removing the shadow n I dont want to remove that.

Upvotes: 0

Views: 606

Answers (1)

Danniel Agus Wahyudi
Danniel Agus Wahyudi

Reputation: 112

I had the same problem as you and solved by adding this:

app:borderWidth="0dp"

Upvotes: 1

Related Questions