summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Fischer <enf@google.com>2009-07-10 15:34:15 -0700
committerEric Fischer <enf@google.com>2009-07-10 15:34:15 -0700
commit52b2d70115e88b408c994db0d2b1889c9fb48527 (patch)
tree032a65f64b93e07cf07064864c5e5446550bf944
parent028617f246f81eb2fe82df3597cf54c46a2592f1 (diff)
downloadCalendar-52b2d70115e88b408c994db0d2b1889c9fb48527.tar.gz
If the short weekday abbreviation is the same as medium, try the shortest too.
This is actually the case in most locales, and in some (like French and Polish), the short abbreviation isn't short enough to fit in the week view header in portrait orientation without the labels overlapping. The one-letter abbreviation should still be understandable, and will fit.
-rw-r--r--src/com/android/calendar/CalendarView.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/calendar/CalendarView.java b/src/com/android/calendar/CalendarView.java
index 38185a1c..a608386e 100644
--- a/src/com/android/calendar/CalendarView.java
+++ b/src/com/android/calendar/CalendarView.java
@@ -389,6 +389,12 @@ public class CalendarView extends View
mDayStrs[index + 7] = mDayStrs[index];
// e.g. Tu for Tuesday
mDayStrs2Letter[index] = DateUtils.getDayOfWeekString(i, DateUtils.LENGTH_SHORT);
+
+ // If we don't have 2-letter day strings, fall back to 1-letter.
+ if (mDayStrs2Letter[index].equals(mDayStrs[index])) {
+ mDayStrs2Letter[index] = DateUtils.getDayOfWeekString(i, DateUtils.LENGTH_SHORTEST);
+ }
+
mDayStrs2Letter[index + 7] = mDayStrs2Letter[index];
}