use of android.view.ViewOutlineProvider in project cardslib by gabrielemariotti.
the class LPreviewUtilsBase method setupCircleButton.
// ----------------------------------------------------------------------------
// Circle Button
// ----------------------------------------------------------------------------
public void setupCircleButton(ImageButton sourceButton) {
if (hasL()) {
if (sourceButton != null) {
final int size = mActivity.getResources().getDimensionPixelSize(R.dimen.hd_fab_size);
sourceButton.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
outline.setOval(0, 0, size, size);
}
});
sourceButton.setClipToOutline(true);
}
}
}
Aggregations