diff --git a/res/layout-sw600dp/full_month_header.xml b/res/layout-sw600dp/full_month_header.xml
index fb6cee51ff8fc9b3127762d9ac229135c770fc68..31985a34e6202e2918a33c22f9f01e5fdcd4de88 100644
--- a/res/layout-sw600dp/full_month_header.xml
+++ b/res/layout-sw600dp/full_month_header.xml
@@ -15,6 +15,7 @@
-->
-
-
-
-
-
-
-
diff --git a/res/layout/full_month_header.xml b/res/layout/full_month_header.xml
index 1c47db98530927c799611676a2817f047942ff8a..e4106b7e15310330b24e29cf93770f5b38770cae 100644
--- a/res/layout/full_month_header.xml
+++ b/res/layout/full_month_header.xml
@@ -15,70 +15,79 @@
-->
-
-
-
-
-
-
-
-
diff --git a/res/layout/mini_month_header.xml b/res/layout/mini_month_header.xml
index 9c30995506c1b2b9f63183a7f8e8202d05d7b6df..2f9c74f9d127f364f047a0e86a0a692efe137ed8 100644
--- a/res/layout/mini_month_header.xml
+++ b/res/layout/mini_month_header.xml
@@ -15,6 +15,7 @@
-->
diff --git a/res/values-w600dp-h879dp/dimens.xml b/res/values-w600dp-h879dp/dimens.xml
index 26130deaf5fe90c4816133fc6546253e5795cdac..2786d5ab9a8ed3cd5f08d34d7611ec2e26f9a1a6 100644
--- a/res/values-w600dp-h879dp/dimens.xml
+++ b/res/values-w600dp-h879dp/dimens.xml
@@ -15,7 +15,8 @@
-->
- 14sp
+ 16sp
+ 16sp
10dip
0dip
6dip
diff --git a/res/values-w960dp-h527dp/dimens.xml b/res/values-w960dp-h527dp/dimens.xml
index 74da6a97abd2aeea8aa5987d36bcd27df7a35875..09e4a0f95d7cdec6ac2b24d8a0677fd0572915a4 100644
--- a/res/values-w960dp-h527dp/dimens.xml
+++ b/res/values-w960dp-h527dp/dimens.xml
@@ -15,7 +15,8 @@
-->
- 14sp
+ 16sp
+ 16sp
10dip
0dip
6dip
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 68e8f61953dee0ba56ea5291207ff876b4fc7cbf..7d8f93edbaadd9bd85f5aaf8c47f2028e158d4d6 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -14,7 +14,9 @@
limitations under the License.
-->
- 11sp
+ 16sp
+ 16sp
+ 8dp
8dip
0dip
4dip
@@ -56,7 +58,7 @@
300dp
16dp
- 14dp
+ 15dp
15dp
12dp
5dp
diff --git a/res/values/styles.xml b/res/values/styles.xml
index e0469620ed677a8c4a46cd368b07daf0abf3246f..a0431e9e7ea41f267da124cb7e8aeb64d2f53390 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -78,7 +78,6 @@
diff --git a/src/com/android/calendar/month/MonthWeekEventsView.java b/src/com/android/calendar/month/MonthWeekEventsView.java
index 97cf6899cab884279b97b08d623b60fc1a331b72..7d4eb9962f22eac29ff54cfc83ee90f0ba60d16d 100644
--- a/src/com/android/calendar/month/MonthWeekEventsView.java
+++ b/src/com/android/calendar/month/MonthWeekEventsView.java
@@ -501,7 +501,6 @@ public class MonthWeekEventsView extends SimpleWeekView {
lines[i++] = mWidth;
lines[i++] = 0;
-
p.setColor(mDaySeparatorInnerColor);
p.setStrokeWidth(mDaySeparatorInnerWidth * 4);
canvas.drawLines(lines, 0, lines.length, p);
@@ -512,7 +511,6 @@ public class MonthWeekEventsView extends SimpleWeekView {
// There are mNumDays - 1 vertical lines and 1 horizontal, so the total is mNumDays
float[] lines = new float[mNumDays * coordinatesPerLine];
int i = 0;
-
int y0 = 0;
int y1 = mHeight;
@@ -627,12 +625,14 @@ public class MonthWeekEventsView extends SimpleWeekView {
Time time = new Time(mTimeZone);
time.setJulianDay(julianMonday);
- int current_date_text_x=getResources().getDimensionPixelSize(R.dimen.current_date_text_x);
- int current_date_text_y=getResources().getDimensionPixelSize(R.dimen.current_date_text_y);
- int current_date_event_margin=getResources().getDimensionPixelSize(R.dimen.current_date_text_event_margin);
+ int todayTextY = getResources().getDimensionPixelSize(R.dimen.current_date_text_y);
+ int todayEventMargin = getResources().getDimensionPixelSize(R.dimen.current_date_text_event_margin);
for (; i < numCount; i++) {
x = computeDayLeftPosition(i - offset) - (mSidePaddingMonthNumber);
+
+ final float monthNumberTextX = getMonthNumberTextX(x);
+
if (mHasToday && todayIndex == i) {
mMonthNumPaint.setFakeBoldText(isBold = false);
if (i + 1 < numCount) {
@@ -641,28 +641,29 @@ public class MonthWeekEventsView extends SimpleWeekView {
isFocusMonth = !mFocusDay[i + 1];
}
mMonthNumPaint.setColor(getContext().getResources().getColor(R.color.colorAccent));
- int current_date_bg_size=getResources().getDimensionPixelSize(R.dimen.current_date_bg_size);
+ final int todayCircleRadius = getResources().getDimensionPixelSize(R.dimen.current_date_bg_size);
//check text width & height to calculate circle cx and cy values
Rect bounds = new Rect();
mMonthNumPaint.getTextBounds(mDayNumbers[i], 0, mDayNumbers[i].length(), bounds);
- int text_height = bounds.height();
- int text_width = bounds.width();
+ int textHeight = bounds.height();
+ final int todayCircleCenterY = y + todayTextY - (textHeight / 2) - todayEventMargin;
- canvas.drawCircle(x - current_date_text_x - (text_width / 2),
- y + current_date_text_y - (text_height / 2) - current_date_event_margin,
- current_date_bg_size, mMonthNumPaint);
+ canvas.drawCircle(monthNumberTextX,
+ todayCircleCenterY,
+ todayCircleRadius, mMonthNumPaint);
mMonthNumPaint.setColor(mMonthNumTodayColor);
} else if (mFocusDay[i] != isFocusMonth) {
isFocusMonth = mFocusDay[i];
mMonthNumPaint.setColor(isFocusMonth ? mMonthNumColor : mMonthNumOtherColor);
}
- double relation = Math.sqrt(canvas.getWidth() * canvas.getHeight());
- mMonthNumPaint.setTextSize((int)relation / 12);
- canvas.drawText(mDayNumbers[i], x-current_date_text_x,
- y+current_date_text_y - current_date_event_margin, mMonthNumPaint);
+ mMonthNumPaint.setTextSize(getResources().getDimensionPixelSize(R.dimen.day_number_text_size));
+ mMonthNumPaint.setTextAlign(Align.CENTER);
+
+ canvas.drawText(mDayNumbers[i], monthNumberTextX,
+ y + todayTextY - todayEventMargin, mMonthNumPaint);
if (isBold) {
mMonthNumPaint.setFakeBoldText(isBold = false);
}
@@ -725,6 +726,21 @@ public class MonthWeekEventsView extends SimpleWeekView {
}
}
+ private float getMonthNumberTextX(int x) {
+ final float monthNumberMarginEnd;
+ if (mShowWeekNum) {
+ monthNumberMarginEnd = getMonthNumberMarginEnd();
+ } else {
+ monthNumberMarginEnd = 0;
+ }
+
+ return x - (((float) mWidth / mNumDays) / 2f) + mSidePaddingMonthNumber + monthNumberMarginEnd;
+ }
+
+ private float getMonthNumberMarginEnd() {
+ return getResources().getDimensionPixelSize(R.dimen.day_number_margin_end);
+ }
+
protected void drawEvents(Canvas canvas) {
if (mEvents == null || mEvents.isEmpty()) {
return;