diff --git a/ncalendar/src/main/java/com/necer/view/BaseCalendarView.java b/ncalendar/src/main/java/com/necer/view/BaseCalendarView.java index d2302315..6a5b1781 100644 --- a/ncalendar/src/main/java/com/necer/view/BaseCalendarView.java +++ b/ncalendar/src/main/java/com/necer/view/BaseCalendarView.java @@ -104,7 +104,7 @@ protected void onDraw(Canvas canvas) { drawHolidays(canvas, centerX, centerY, false, date); } else { - drawSolar(canvas, centerX, centerY, mAttrs.solarTextColor, date.getDayOfMonth() + ""); + drawSolar(canvas, rect.centerX(), rect.centerY(), mAttrs.solarTextColor, date.getDayOfMonth() + ""); //农历 drawLunar(canvas, centerX, centerY, false, true, nDate); //绘制圆点 @@ -114,7 +114,7 @@ protected void onDraw(Canvas canvas) { } else { //公历 - drawSolar(canvas, centerX, centerY, mAttrs.hintColor, date.getDayOfMonth() + ""); + drawSolar(canvas, rect.centerX(), rect.centerY(), mAttrs.hintColor, date.getDayOfMonth() + ""); //农历 drawLunar(canvas, centerX, centerY, false, false, nDate); //绘制圆点 @@ -169,7 +169,7 @@ private void drawSolidCircle(Canvas canvas, int centerX, int centerY) { private void drawSolar(Canvas canvas, int centerX, int centerY, int color, String solar) { mTextPaint.setColor(color); mTextPaint.setTextSize(mAttrs.solarTextSize); - canvas.drawText(solar, centerX, centerY, mTextPaint); + canvas.drawText(solar, centerX, centerY-(getSolarTexyCenterY(centerY)-centerY), mTextPaint); } //绘制圆点 @@ -206,7 +206,7 @@ private void drawLunar(Canvas canvas, int centerX, int centerY, boolean isWhite, mTextPaint.setColor(isWhite ? Color.WHITE : mAttrs.lunarTextColor); } - canvas.drawText(lunarString, centerX, centerY + mAttrs.lunarDistance, mTextPaint); +// canvas.drawText(lunarString, centerX, centerY + mAttrs.lunarDistance, mTextPaint); } }