错误API 28如何修复代码?
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
boolean result;
final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);
if (mSlideableView != child) { // if main view
// Clip against the slider; no sense drawing what will immediately
// be covered,
// Unless the panel is set to overlay content
canvas.getClipBounds(mTmpRect);
if (!mOverlayContent) {
if (mIsSlidingUp) {
mTmpRect.bottom = Math.min(mTmpRect.bottom, mSlideableView.getTop());
} else {
mTmpRect.top = Math.max(mTmpRect.top, mSlideableView.getBottom());
}
}
if (mClipPanel) {
canvas.clipRect(mTmpRect);
}
result = super.drawChild(canvas, child, drawingTime);
if (mCoveredFadeColor != 0 && mSlideOffset > 0) {
final int baseAlpha = (mCoveredFadeColor & 0xff000000) >>> 24;
final int imag = (int) (baseAlpha * mSlideOffset);
final int color = imag << 24 | (mCoveredFadeColor & 0xffffff);
mCoveredFadePaint.setColor(color);
canvas.drawRect(mTmpRect, mCoveredFadePaint);
}
} else {
result = super.drawChild(canvas, child, drawingTime);
}
canvas.restoreToCount(save);
return result;
}
错误在给定的行中。 final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);
如何解决该错误? API28删除了此功能。我需要您的帮助进行修复。在编译时不会导致错误。谢谢