diff options
author | Matt Garnes <matt@cyngn.com> | 2014-11-11 17:55:27 -0800 |
---|---|---|
committer | Matt Garnes <matt@cyngn.com> | 2014-11-13 16:20:18 -0800 |
commit | 47851abf10de03162f18eb0620650f1f0b0c4232 (patch) | |
tree | 445840854eb02714632243b5046c72a07c933110 | |
parent | 4f65ce8f7e3b63754b532fb4c87057b287f692fe (diff) | |
download | android_packages_apps_Calendar-47851abf10de03162f18eb0620650f1f0b0c4232.tar.gz android_packages_apps_Calendar-47851abf10de03162f18eb0620650f1f0b0c4232.tar.bz2 android_packages_apps_Calendar-47851abf10de03162f18eb0620650f1f0b0c4232.zip |
Revert "Calendar: To display the complex lunar info."
This reverts commit 3dc108642c87bc85085e7b5dd40d0a227ead24ff.
-rw-r--r-- | src/com/android/calendar/CalendarViewAdapter.java | 12 | ||||
-rw-r--r-- | src/com/android/calendar/DayView.java | 9 | ||||
-rw-r--r-- | src/com/android/calendar/month/MonthWeekEventsView.java | 39 | ||||
-rw-r--r-- | src/com/android/lunar/ILunarService.aidl | 26 |
4 files changed, 37 insertions, 49 deletions
diff --git a/src/com/android/calendar/CalendarViewAdapter.java b/src/com/android/calendar/CalendarViewAdapter.java index 9f5dc778..1e75d1fd 100644 --- a/src/com/android/calendar/CalendarViewAdapter.java +++ b/src/com/android/calendar/CalendarViewAdapter.java @@ -485,8 +485,8 @@ public class CalendarViewAdapter extends BaseAdapter { String date = Utils.formatDateRange(mContext, mMilliTime, mMilliTime, DateUtils.FORMAT_SHOW_DATE); if (!mLunarInfoMap.containsKey(date)) { - String lunarInfo = service.getComplexLunarInfo( - time.year, time.month, time.monthDay, true, false); + String lunarInfo = service.getLunarStringForDayView( + time.year, time.month, time.monthDay); mLunarInfoMap.put(date, lunarInfo); } @@ -496,8 +496,8 @@ public class CalendarViewAdapter extends BaseAdapter { date = Utils.formatDateRange(mContext, preMilliTime, preMilliTime, DateUtils.FORMAT_SHOW_DATE); if (!mLunarInfoMap.containsKey(date)) { - String lunarInfo = service.getComplexLunarInfo( - time.year, time.month, time.monthDay, true, false); + String lunarInfo = service.getLunarStringForDayView( + time.year, time.month, time.monthDay); mLunarInfoMap.put(date, lunarInfo); } @@ -507,8 +507,8 @@ public class CalendarViewAdapter extends BaseAdapter { date = Utils.formatDateRange(mContext, nextMilliTime, nextMilliTime, DateUtils.FORMAT_SHOW_DATE); if (!mLunarInfoMap.containsKey(date)) { - String lunarInfo = service.getComplexLunarInfo( - time.year, time.month, time.monthDay, true, false); + String lunarInfo = service.getLunarStringForDayView( + time.year, time.month, time.monthDay); mLunarInfoMap.put(date, lunarInfo); } } diff --git a/src/com/android/calendar/DayView.java b/src/com/android/calendar/DayView.java index 381ed0c6..7f6cbce6 100644 --- a/src/com/android/calendar/DayView.java +++ b/src/com/android/calendar/DayView.java @@ -2619,14 +2619,7 @@ public class DayView extends View implements View.OnCreateContextMenuListener, } try { - String[] lunarInfo = service.getLunarInfo(year, month, dateNum, true, false) - .split(service.getSeparationForMultiInfo()); - String display = null; - if (lunarInfo.length > 1) { - display = lunarInfo[0] + "*"; - } else { - display = lunarInfo[0]; - } + String display = service.getLunarDay(year, month, dateNum); if (!TextUtils.isEmpty(display)) { canvas.drawText(display, x, y + DAY_HEADER_FONT_SIZE + 2, p); } diff --git a/src/com/android/calendar/month/MonthWeekEventsView.java b/src/com/android/calendar/month/MonthWeekEventsView.java index 70b0d652..a5dd5dae 100644 --- a/src/com/android/calendar/month/MonthWeekEventsView.java +++ b/src/com/android/calendar/month/MonthWeekEventsView.java @@ -67,7 +67,7 @@ public class MonthWeekEventsView extends SimpleWeekView { /* NOTE: these are not constants, and may be multiplied by a scale factor */ private static int TEXT_SIZE_MONTH_NUMBER = 32; - private static int TEXT_SIZE_LUNAR = 20; + private static int TEXT_SIZE_LUNAR = 18; private static int TEXT_SIZE_EVENT = 12; private static int TEXT_SIZE_EVENT_TITLE = 14; private static int TEXT_SIZE_MORE_EVENTS = 12; @@ -93,7 +93,6 @@ public class MonthWeekEventsView extends SimpleWeekView { private static int DAY_SEPARATOR_VERTICAL_LENGTH = 53; private static int DAY_SEPARATOR_VERTICAL_LENGHT_PORTRAIT = 64; private static int MIN_WEEK_WIDTH = 50; - private static int LUNAR_PADDING_LUNAR = 2; private static int EVENT_X_OFFSET_LANDSCAPE = 38; private static int EVENT_Y_OFFSET_LANDSCAPE = 8; @@ -751,34 +750,22 @@ public class MonthWeekEventsView extends SimpleWeekView { } try { - String[] lunarInfo = service.getLunarInfo(year, month, monthDay, true, false) - .split(service.getSeparationForMultiInfo()); - - float originalTextSize = mMonthNumPaint.getTextSize(); - mMonthNumPaint.setTextSize(TEXT_SIZE_LUNAR); - Resources res = getResources(); - int mOrientation = res.getConfiguration().orientation; - - int num = 0; - for (int index = 0; index < lunarInfo.length; index++) { - String info = lunarInfo[index]; - if (TextUtils.isEmpty(info)) continue; - - int infoX = 0; - int infoY = 0; + String display = service.getLunarDay(year, month, monthDay); + if (!TextUtils.isEmpty(display)) { + float originalTextSize = mMonthNumPaint.getTextSize(); + mMonthNumPaint.setTextSize(TEXT_SIZE_LUNAR); + Resources res = getResources(); + int mOrientation = res.getConfiguration().orientation; if (mOrientation == Configuration.ORIENTATION_LANDSCAPE) { - infoX = x - mMonthNumHeight - TOP_PADDING_MONTH_NUMBER; - infoY = y + (mMonthNumHeight + LUNAR_PADDING_LUNAR) * num; + canvas.drawText(display, x - mMonthNumHeight - TOP_PADDING_MONTH_NUMBER, + y , mMonthNumPaint); } else { - infoX = x; - infoY = y + (mMonthNumHeight + LUNAR_PADDING_LUNAR) * (num + 1); + canvas.drawText(display, x, y + mMonthNumHeight + + TOP_PADDING_MONTH_NUMBER, mMonthNumPaint); } - canvas.drawText(info, infoX, infoY, mMonthNumPaint); - num = num + 1; + // restore the text size. + mMonthNumPaint.setTextSize(originalTextSize); } - - // restore the text size. - mMonthNumPaint.setTextSize(originalTextSize); } catch (RemoteException e) { Log.e(TAG, "RemoteException e:" + e.toString()); e.printStackTrace(); diff --git a/src/com/android/lunar/ILunarService.aidl b/src/com/android/lunar/ILunarService.aidl index 99702a1c..f5a24f32 100644 --- a/src/com/android/lunar/ILunarService.aidl +++ b/src/com/android/lunar/ILunarService.aidl @@ -30,13 +30,21 @@ package com.android.lunar; interface ILunarService { - String getLunarInfo(int year, int month, int monthDay, boolean multipleInfo, - boolean appendType); - String getComplexLunarInfo(int year, int month, int monthDay, boolean multipleInfo, - boolean appendType); - String[] getLunarInfoForMonth(int year, int month, boolean multipleInfo, boolean appendType); - String getSeparationForMultiInfo(); - String getSeparationForType(); - String getSpecialFlag(); - String getCommonFlag(); + String getTraditionalFestivalSimple(); + String getTraditionalFestival(int lunarYear, int lunarMonth, int lunarDay); + String getFestivalSimple(); + String getFestival(int year, int month, int day); + String getLunarSolarTerms(int year); + String getAnimalsYearSimple(); + String getAnimalsYear(int lunarYear); + String getChinaMonthStringSimple(); + String getChinaMonthString(int lunarMonth, boolean isLeapMonth); + String getChinaDayStringSimple(boolean isDisplayLunarMonthForFirstDay); + String getChinaDayString(int lunarMonth, int lunarDay, boolean isLeapMonth, + boolean isDisplayLunarMonthForFirstDay); + String getChinaYearStringSimple(); + String getChinaYearString(int lunarYear); + String getLunarCalendarInfo(); + String getLunarStringForDayView(int year, int month, int monthDay); + String getLunarDay(int year, int month, int monthDay); } |