|
|
@@ -34,6 +34,7 @@ public class OACalendarView extends View implements View.OnTouchListener {
|
|
|
//装饰物 decorat
|
|
|
private String decoratDays;
|
|
|
private int maxDay;//当月有多少天
|
|
|
+ private int[] workWeeks={2,3,4,5,6};
|
|
|
|
|
|
|
|
|
private Calendar calendar;
|
|
|
@@ -205,9 +206,7 @@ public class OACalendarView extends View implements View.OnTouchListener {
|
|
|
//使文字垂直居中
|
|
|
Paint.FontMetrics fontMetrics = surface.hineDatePaint.getFontMetrics();
|
|
|
float fontHeight = fontMetrics.bottom - fontMetrics.top;
|
|
|
-// float dayTextY = surface.weekHeight +(surface.cellHeight +surface.dateTaxtSize) / 2;
|
|
|
float dayTextY = surface.weekHeight + (surface.cellHeight + fontHeight) / 2 - fontMetrics.bottom;
|
|
|
-
|
|
|
for (int i = 0; i < startIndex; i++) {
|
|
|
float dayTextX = i * surface.cellWidth + (surface.cellWidth - surface.hineDatePaint.measureText("今")) / 2f;
|
|
|
canvas.drawText(calendar.get(Calendar.DAY_OF_MONTH) + "", dayTextX, dayTextY, surface.hineDatePaint);
|