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

Fix use of Canvas.clipPath with hardware acceleration #130

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ allprojects {


ext {
minSDKVersion = 16
minSDKVersion = 15
targetSDKVersion = 25
compileSDKVersion = 25
buildToolsVersion = BUILD_TOOLS_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.graphics.Canvas;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
Expand All @@ -21,6 +22,11 @@ public RevealFrameLayout(Context context, AttributeSet attrs) {

public RevealFrameLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// https://developer.android.com/guide/topics/graphics/hardware-accel.html#unsupported
// in theory the first part of this if could be omitted, but I'll leave it there to make the version range clear
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR1) {
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

manager = new ViewRevealManager();
}
Expand Down