summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2014-11-11 17:55:27 -0800
committerSteve Kondik <steve@cyngn.com>2015-10-18 13:52:41 -0700
commit668e2119f7c0392647de36bae0c7872596744a04 (patch)
treebf7f19c7cbc78e409dcfe22174a22b6878af0d3f /src
parent085e5be955aa5fdaa49f5701d0f7883aefc0e141 (diff)
downloadandroid_packages_apps_Calendar-668e2119f7c0392647de36bae0c7872596744a04.tar.gz
android_packages_apps_Calendar-668e2119f7c0392647de36bae0c7872596744a04.tar.bz2
android_packages_apps_Calendar-668e2119f7c0392647de36bae0c7872596744a04.zip
Revert "Calendar: To display the complex lunar info."
This reverts commit 3dc108642c87bc85085e7b5dd40d0a227ead24ff.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/calendar/CalendarViewAdapter.java12
-rw-r--r--src/com/android/calendar/DayView.java9
-rw-r--r--src/com/android/calendar/month/MonthWeekEventsView.java39
-rw-r--r--src/com/android/lunar/ILunarService.aidl26
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);
}