Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular cut with support 15 + versions #3

Open
netodevel opened this issue Jan 25, 2018 · 0 comments
Open

Circular cut with support 15 + versions #3

netodevel opened this issue Jan 25, 2018 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@netodevel
Copy link
Contributor

Problem:
The circular view cut only from the LOLLIPOP version upwards.

Tip:

class:
CircleVideoRecord

method:

 @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
 private void cropViews() {
    ViewOutlineProvider vop = new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
           outline.setOval(5, 5, view.getWidth() - 5, view.getHeight() - 5);
        }
    };

    this.progressFrameLayout.setOutlineProvider(vop);
    this.progressFrameLayout.setClipToOutline(true);

    ViewOutlineProvider vop2 = new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            outline.setOval(10, 10, progressFrameLayout.getWidth() - 10, progressFrameLayout.getHeight() - 10);
         }
    };

    mCameraView.setOutlineProvider(vop2);
    mCameraView.setClipToOutline(true);
}
@netodevel netodevel added the help wanted Extra attention is needed label Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant