|
|
@@ -61,7 +61,7 @@ public class CalendarMonthView extends MonthView {
|
|
|
protected void onDrawScheme(Canvas canvas, Calendar calendar, int x, int y) {
|
|
|
this.mSchemeBasicPaint.setColor(calendar.getSchemeColor());
|
|
|
// canvas.drawRect((float) (x + this.mPadding), (float) (y + this.mPadding), (float) (x + this.mItemWidth - this.mPadding), (float) (y + this.mItemHeight - this.mPadding), this.mSchemeBasicPaint);
|
|
|
- canvas.drawRect((float) (x), (float) (y - this.mPadding / 2), (float) (x + this.mItemWidth), (float) (y + this.mItemHeight - this.mPadding / 2), this.mSchemeBasicPaint);
|
|
|
+ canvas.drawRect((float) (x), y - this.mPadding / 2.0F, x + this.mItemWidth + (calendar.getWeek() == 0 ? this.mPadding : 0), y + this.mItemHeight - this.mPadding / 2.0F, this.mSchemeBasicPaint);
|
|
|
// canvas.drawRoundRect((float) (x + this.mPadding), (float) (y + this.mPadding), (float) (x + this.mItemWidth - this.mPadding), (float) (y + this.mItemHeight - this.mPadding), this.mSchemeBasicPaint);
|
|
|
// canvas.drawText(calendar.getScheme(), (float) (x + this.mItemWidth - this.mPadding) - this.mRadio / 2.0F - this.getTextWidth(calendar.getScheme()) / 2.0F, (float) (y + this.mPadding) + this.mSchemeBaseLine, this.mTextPaint);
|
|
|
}
|
|
|
@@ -105,7 +105,7 @@ public class CalendarMonthView extends MonthView {
|
|
|
//画当天背景
|
|
|
protected void onDrawCurDay(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme) {
|
|
|
this.mCurDayPaint.setStyle(Paint.Style.FILL);
|
|
|
- canvas.drawCircle((float) (x + this.mItemWidth / 2.0F), (float) (y - this.mPadding + this.mItemWidth / 2.0F), this.mItemWidth * 2 / 5, this.mCurDayPaint);
|
|
|
+ canvas.drawCircle(x + this.mItemWidth / 2.0F, y + this.mItemHeight / 2.0F, (Math.min(this.mItemHeight, this.mItemWidth) - this.mPadding) / 2.0F, this.mCurDayPaint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -115,8 +115,8 @@ public class CalendarMonthView extends MonthView {
|
|
|
* @param dpValue dp
|
|
|
* @return px
|
|
|
*/
|
|
|
- static float dipToPx(Context context, float dpValue) {
|
|
|
+ static int dipToPx(Context context, float dpValue) {
|
|
|
final float scale = context.getResources().getDisplayMetrics().density;
|
|
|
- return dpValue * scale + 0.5f;
|
|
|
+ return (int) (dpValue * scale + 0.5f);
|
|
|
}
|
|
|
}
|