DragLayer.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:FlickLauncher 作者:
@Override
protected void dispatchDraw(Canvas canvas) {
    // Draw the background below children.
    if (mBackgroundAlpha > 0.0f) {
        // Update the scroll position first to ensure scrim cutout is in the right place.
        mLauncher.getWorkspace().computeScrollWithoutInvalidation();

        int alpha = (int) (mBackgroundAlpha * 255);
        CellLayout currCellLayout = mLauncher.getWorkspace().getCurrentDragOverlappingLayout();
        canvas.save();
        if (currCellLayout != null && currCellLayout != mLauncher.getHotseat().getLayout()) {
            // Cut a hole in the darkening scrim on the page that should be highlighted, if any.
            getDescendantRectRelativeToSelf(currCellLayout, mHighlightRect);
            canvas.clipRect(mHighlightRect, Region.Op.DIFFERENCE);
        }
        canvas.drawColor((alpha << 24) | SCRIM_COLOR);
        canvas.restore();
    }

    mFocusIndicatorHelper.draw(canvas);
    super.dispatchDraw(canvas);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号