Skip to content

Commit

Permalink
add version judgment
Browse files Browse the repository at this point in the history
  • Loading branch information
solartcc committed Sep 17, 2016
1 parent 6ce9f61 commit 26afab9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ WaveSideBar project
===================

一个快速跳跃分组的侧边栏控件,示例中配合RecyclerView实现。
因为控件中使用了`path.op`,所以level>=19,如在项目中使用,请自行修改该处实现以兼容更低版本。

<img src="./preview/simple.gif">

Expand Down
5 changes: 4 additions & 1 deletion wave/src/main/java/cc/solart/wave/WaveSideBarView.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
Expand Down Expand Up @@ -293,7 +294,9 @@ private void drawBallPath(Canvas canvas) {

mBallPath.reset();
mBallPath.addCircle(mBallCentreX, mCenterY, mBallRadius, Path.Direction.CW);
mBallPath.op(mWavePath, Path.Op.DIFFERENCE);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT) {
mBallPath.op(mWavePath, Path.Op.DIFFERENCE);
}

mBallPath.close();
canvas.drawPath(mBallPath, mWavePaint);
Expand Down

0 comments on commit 26afab9

Please sign in to comment.