Viewoutlineprovider --View Contour
Setoutlineprovider--
You can use the View.setcliptooutline method to cut the outline area of a view.
Only rectangle,circle, and round rectangle outlines support cropping (the Outline.canclip method is used to determine whether it can be cropped)
New Viewoutlineprovider () { // @Override publicvoid Getoutline (view view, Outline Outline) { int size = getresources (). Getdimensionpixelsize ( r.dimen.fab_size); // truncate a view into a rounded rectangle Outline.setoval (0, 0, size, size); } }; // Fab.setoutlineprovider the profile provider with the view to be cropped (Viewoutlineprovider);
int margin = math.min (Clippedview.getwidth (), Clippedview.getheight ())/ten; New Outline (); - margin, -margin, margin/2); /* * /clippedview.setoutline (mclip) ; /* * /clippedview.setcliptooutline (true);
Android 5.0 new feature Learning-view outline