WeekView.java 文件源码

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

项目:Android-Week-View 作者:
private void drawTimeColumnAndAxes(Canvas canvas) {
    // Draw the background color for the header column.
    canvas.drawRect(0, mHeaderTextHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight(), mHeaderColumnBackgroundPaint);

    // Clip to paint in left column only.
    canvas.clipRect(0, mHeaderTextHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight(), Region.Op.REPLACE);

    for (int i = 0; i < 24; i++) {
        float top = mHeaderTextHeight + mHeaderRowPadding * 2 + mCurrentOrigin.y + mHourHeight * i + mHeaderMarginBottom;

        // Draw the text if its y position is not outside of the visible area. The pivot point of the text is the point at the bottom-right corner.
        String time = getDateTimeInterpreter().interpretTime(i);
        if (time == null)
            throw new IllegalStateException("A DateTimeInterpreter must not return null time");
        if (top < getHeight()) canvas.drawText(time, mTimeTextWidth + mHeaderColumnPadding, top + mTimeTextHeight, mTimeTextPaint);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号