Skip to content

Invalid Region.Op - only INTERSECT and DIFFERENCE  #7

Description

@Yaque

I use it in android 9.0. something happened
Process: com.aiocw.termsinnocent, PID: 5980
java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:789)
at android.graphics.Canvas.clipRect(Canvas.java:836)
at com.jpardogo.android.flabbylistview.lib.FlabbyLayout.onDraw(FlabbyLayout.java:59)
at android.view.View.draw(View.java:20226)
at android.view.View.updateDisplayListIfDirty(View.java:19101)
at android.view.View.draw(View.java:19954)

about this erro. FlabbyLayout.java
@Override protected void onDraw(final Canvas canvas) { if (mWidth == 0) mWidth = getWidth(); if (mHeight == 0) mHeight = getHeight(); mRect = canvas.getClipBounds(); mRect.inset(0, -mHeight / 2); canvas.clipRect(mRect, Region.Op.REPLACE); float startX1;

use this
if(Build.VERSION.SDK_INT >= 28){ canvas.clipPath(mPath0); }else { canvas.clipPath(mPath0, Region.Op.XOR); }
to replace

could you fix this problem?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions