static const int IDA_EVENT_DETAILS_FORM_DELETE = 60002;
static const int IDA_EVENT_DETAILS_FORM_SHARE = 60003;
static const int IDA_EVENT_DETAILS_FORM_ADD_TO_CALENDAR = 60004;
-static const int IDA_DETAIL_FORM_FOOTER_SUB_MENU = 60010;
static const int H_ITEM = 140;
static const int H_MAIN_ITEM = 313;
static const int Y_MAIN_ITEM_SUBJECT = 18;
-static const int H_MAIN_ITEM_SUBJECT = 136;
static const int W_MAIN_ITEM_SUBJECT_MARGIN = 40;
static const int H_MAIN_ITEM_SUBJECT_MARGIN = 32;
static const int X_MAIN_ITEM_ALARM = 0;
static const int Y_MAIN_ITEM_ALARM02 = 73;
static const int H_MAIN_ITEM_ALARM01 = 54;
static const int H_MAIN_ITEM_ALARM02 = 54;
-static const int W_REMINDER_ITEM_MARGIN = 16;
-static const int H_REMINDER_ITEM = 112;
-static const int H_REMINDER_ITEM_REMINDER = 48;
-static const int H_REMINDER_ITEM_MARGIN = 40;
-static const int W_REPEAT_ITEM_MARGIN = 16;
-static const int H_REPEAT_ITEM = 112;
static const int Y_DESCRIPTION_ITEM_DESCRIPTION = 22;
static const int H_DESCRIPTION_ITEM_DESCRIPTION = 42;
static const int Y_DESCRIPTION_ITEM_CONTENT = 64;
-static const int H_DESCRIPTION_ITEM_CONTENT = 54;
static const int W_DESCRIPTION_ITEM_MARGIN = 32;
static const int H_DESCRIPTION_ITEM_MARGIN = 44;
static const int Y_LOCATION_ITEM_LOCATION = 22;
static const int H_LOCATION_ITEM_LOCATION = 42;
static const int Y_LOCATION_ITEM_CONTENT = 54;
-static const int H_LOCATION_ITEM_CONTENT = 54;
static const int W_LOCATION_ITEM_MARGIN = 32;
static const int H_LOCATION_ITEM_MARGIN = 44;
-static const int H_SAVE_TO_ITEM = 140;
static const int Y_SAVE_TO_ITEM_CALENDAR_NAME = 22;
static const int H_SAVE_TO_ITEM_CALENDAR_NAME = 42;
static const int Y_SAVE_TO_ITEM_CALENDAR_ADDRESS = 64;
-static const int H_SAVE_TO_ITEM_CALENDAR_ADDRESS = 54;
-static const int FONT_SIZE_DETAIL01 = 56;
-static const unsigned int COLOR_DETAIL01 = Color32<59, 115, 182>::Value;
static const int FONT_SIZE_DETAIL02 = 44;
-static const unsigned int COLOR_DETAIL02 = Color32<0, 0, 0>::Value;
static const int FONT_SIZE_DETAIL03 = 32;
static const unsigned int COLOR_DETAIL03 = Color32<128, 128, 128>::Value;
static const int X_ITEM_SAVE_TO_ICON = 16;
-static const int Y_ITEM_SAVE_TO_ICON = 38;
static const int W_ITEM_SAVE_TO_ICON = 64;
static const int H_ITEM_SAVE_TO_ICON = 64;
static const int MAX_TITLE_TEXT = 20;
-static const int W_SUB_MENU_MARGIN = 64;
-static const int H_SUB_MENU_HALF_BUTTON = 36;
+static const float H_FONT_SCALE = 1.3;
EventDetailsForm::EventDetailsForm(void)
: __pPm(null)
, __pSharePopup(null)
, __pThreeButtonPopup(null)
, __pTwoButtonPopup(null)
+ , __fontSize(44.f)
+ , __itemHeight(112.f)
{
}
result
EventDetailsForm::OnInitializing(void)
{
+ String fontSizeString;
+ Tizen::System::SettingInfo::GetValue(L"http://tizen.org/setting/font.size", fontSizeString);
+
+ AppLogDebug("fontSize: %ls", fontSizeString.GetPointer());
+ if (fontSizeString == L"small")
+ {
+ __fontSize = 36.f;
+ __itemHeight = 120.f;
+ }
+ else if (fontSizeString == L"medium")
+ {
+ __fontSize = 44.f;
+ __itemHeight = 140.f;
+ }
+ else if (fontSizeString == L"large")
+ {
+ __fontSize = 64.f;
+ __itemHeight = 157.f;
+ }
+ else if (fontSizeString == L"huge")
+ {
+ __fontSize = 81.f;
+ __itemHeight = 176.f;
+ }
+ else if (fontSizeString == L"giant")
+ {
+ __fontSize = 106.f;
+ __itemHeight = 205.f;
+ }
+
+
__pPm = new (std::nothrow) EventPresentationModel();
__pPm->Construct();
SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
}
+float
+EventDetailsForm::GetSavetoItemHeight() const
+{
+ return (__itemHeight - (Y_SAVE_TO_ITEM_CALENDAR_NAME*2) - H_SAVE_TO_ITEM_CALENDAR_NAME);
+}
+
int
EventDetailsForm::GetSectionCount(void)
{
TextElement* pElement = new (std::nothrow) TextElement();
pElement->Construct(title);
Font font;
- font.Construct(FONT_STYLE_PLAIN, FONT_SIZE_DETAIL01);
+ font.Construct(FONT_STYLE_PLAIN, __fontSize*H_FONT_SCALE);
pElement->SetFont(font);
titleText.Add(*pElement);
int actualHeight = titleText.GetTextExtent().height + H_MAIN_ITEM_SUBJECT_MARGIN;
Label* pLabelSubject = new (std::nothrow) Label();
pLabelSubject->Construct(Rectangle(0, 0, itemWidth, actualHeight), title);
pItem->AddControl(pLabelSubject);
- pLabelSubject->SetTextConfig(FONT_SIZE_DETAIL01, LABEL_TEXT_STYLE_NORMAL);
+ pLabelSubject->SetTextConfig(__fontSize*H_FONT_SCALE, LABEL_TEXT_STYLE_NORMAL);
pLabelSubject->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
y = actualHeight;
pItem->SetSize(itemWidth, y + H_MAIN_ITEM_ALARM);
{
strTitle = ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE);
}
+ EnrichedText titleText;
+ titleText.Construct(Dimension(itemWidth, H_MAIN_ITEM));
+ titleText.SetTextWrapStyle(TEXT_WRAP_WORD_WRAP);
+ titleText.SetTextAbbreviationEnabled(false);
+
+ TextElement* pElement = new (std::nothrow) TextElement();
+ pElement->Construct(strTitle);
+ Font font;
+ font.Construct(FONT_STYLE_PLAIN, __fontSize*H_FONT_SCALE);
+ pElement->SetFont(font);
+ titleText.Add(*pElement);
+ int actualHeight = titleText.GetTotalLineHeight() + H_MAIN_ITEM_SUBJECT_MARGIN;
+ titleText.RemoveAll(true);
+
Label* pLabelSubject = new (std::nothrow) Label();
- pLabelSubject->Construct(Rectangle(0, y, itemWidth, H_MAIN_ITEM_SUBJECT), strTitle);
+ pLabelSubject->Construct(Rectangle(0, y, itemWidth, actualHeight), strTitle);
pItem->AddControl(pLabelSubject);
- pLabelSubject->SetTextConfig(FONT_SIZE_DETAIL01, LABEL_TEXT_STYLE_NORMAL);
+ pLabelSubject->SetTextConfig(__fontSize*H_FONT_SCALE, LABEL_TEXT_STYLE_NORMAL);
pLabelSubject->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
- y += H_MAIN_ITEM_SUBJECT;
+ y = actualHeight;
+ pItem->SetSize(itemWidth, y + H_MAIN_ITEM_ALARM);
+ //y += H_MAIN_ITEM_SUBJECT;
}
if (start.GetYear() == end.GetYear() && start.GetMonth() == end.GetMonth() && start.GetDay() == end.GetDay())
itemWidth - X_MAIN_ITEM_ALARM, H_MAIN_ITEM_ALARM01), __pPm->GetDateString(start));
pItem->AddControl(pLabelAlarm01);
pLabelAlarm01->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelAlarm01->SetTextColor(Color(COLOR_DETAIL02));
pLabelAlarm01->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
if (__pPm->IsAllDayEvent() == false)
textExtent.width + W_MAIN_ITEM_ALARM_MARGIN, H_MAIN_ITEM_ALARM01), startDateText);
pItem->AddControl(pLabelAlarmStartDate);
pLabelAlarmStartDate->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelAlarmStartDate->SetTextColor(Color(COLOR_DETAIL02));
pLabelAlarmStartDate->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
if (__pPm->IsAllDayEvent() == false)
textExtent.width + W_MAIN_ITEM_ALARM_MARGIN, H_MAIN_ITEM_ALARM02), endDateText);
pItem->AddControl(pLabelAlarmEndDate);
pLabelAlarmEndDate->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelAlarmEndDate->SetTextColor(Color(COLOR_DETAIL02));
pLabelAlarmEndDate->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
if (__pPm->IsAllDayEvent() == false)
TextElement* pElement = new (std::nothrow) TextElement();
pElement->Construct(description);
Font font;
- font.Construct(FONT_STYLE_PLAIN, FONT_SIZE_DETAIL02);
+ font.Construct(FONT_STYLE_PLAIN, __fontSize);
pElement->SetFont(font);
text.Add(*pElement);
- int descriptionHeight = text.GetTextExtent().height;
+ int descriptionHeight = text.GetTotalLineHeight();
text.RemoveAll(true);
int itemHeight = descriptionHeight + H_DESCRIPTION_ITEM_MARGIN + H_DESCRIPTION_ITEM_DESCRIPTION;
- if (itemHeight < H_ITEM)
+ /*if (itemHeight < H_ITEM)
{
itemHeight = H_ITEM;
}
{
descriptionHeight = H_DESCRIPTION_ITEM_CONTENT;
}
-
+ */
pItem->Construct(Dimension(itemWidth, itemHeight));
pItem->SetEnabled(false);
Label* pLabelContent = new (std::nothrow) Label();
pLabelContent->Construct(Rectangle(0, Y_DESCRIPTION_ITEM_CONTENT, itemWidth, descriptionHeight), description);
pItem->AddControl(pLabelContent);
- pLabelContent->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelContent->SetTextColor(Color(COLOR_DETAIL02));
+ pLabelContent->SetTextConfig(__fontSize, LABEL_TEXT_STYLE_NORMAL);
pLabelContent->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
}
else
TextElement* pElement = new (std::nothrow) TextElement();
pElement->Construct(location);
Font font;
- font.Construct(FONT_STYLE_PLAIN, FONT_SIZE_DETAIL02);
+ font.Construct(FONT_STYLE_PLAIN, __fontSize);
pElement->SetFont(font);
text.Add(*pElement);
- int locationHeight = text.GetTextExtent().height;
+ int locationHeight = text.GetTotalLineHeight();
text.RemoveAll(true);
int itemHeight = locationHeight + H_LOCATION_ITEM_MARGIN + H_LOCATION_ITEM_LOCATION;
- if (itemHeight < H_ITEM)
+ /*if (itemHeight < H_ITEM)
{
itemHeight = H_ITEM;
}
{
locationHeight = H_LOCATION_ITEM_CONTENT;
}
+ */
pItem->Construct(Dimension(itemWidth, itemHeight));
pItem->SetEnabled(false);
Label* pLabelContent = new (std::nothrow) Label();
pLabelContent->Construct(Rectangle(0, Y_LOCATION_ITEM_CONTENT, itemWidth, locationHeight), location);
- pLabelContent->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelContent->SetTextColor(Color(COLOR_DETAIL02));
+ pLabelContent->SetTextConfig(__fontSize, LABEL_TEXT_STYLE_NORMAL);
pLabelContent->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
pItem->AddControl(pLabelContent);
}
EventDetailsForm::CreateReminderItemN(int itemWidth)
{
int countReminder = (__pPm->GetCountReminder() > 1) ? __pPm->GetCountReminder() : 1;
- int height = (countReminder > 1) ? H_REMINDER_ITEM_REMINDER * countReminder + H_REMINDER_ITEM_MARGIN : H_REMINDER_ITEM;
+
+ String reminderContents;
+ for (int i = 0; i < countReminder; ++i)
+ {
+ reminderContents.Append(__pPm->GetReminderString(i));
+ if (i < countReminder-1)
+ {
+ reminderContents.Append(L"\n");
+ }
+ }
+
+ Font mainFont;
+ mainFont.Construct(FONT_STYLE_PLAIN, __fontSize);
+ Font subFont;
+ subFont.Construct(FONT_STYLE_PLAIN, 32);
+
+ TextElement textElement;
+ textElement.Construct(L" ");
+ textElement.SetFont(mainFont);
+
+ EnrichedText enrichedText;
+ enrichedText.Construct(FloatDimension(itemWidth, 1.f));
+ enrichedText.Add(textElement);
+
+ float mainHeight = enrichedText.GetTotalLineHeightF();
+
+ textElement.SetText(reminderContents);
+ textElement.SetFont(subFont);
+
+ enrichedText.RemoveAll(false);
+ enrichedText.Add(textElement);
+
+ float subHeight = enrichedText.GetTotalLineHeightF();
+
+ float height = mainHeight < subHeight ? subHeight : mainHeight;
+ height += 32.f;
+
+ RelativeLayout layout;
+ layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(Dimension(itemWidth, height));
+ pItem->Construct(layout, FloatDimension(itemWidth, height));
pItem->SetEnabled(false);
- Label* pLabelReminder = new (std::nothrow) Label();
- pLabelReminder->Construct(Rectangle(0, 0, itemWidth, height),
- ResourceManager::GetString(IDS_CLD_BODY_REMINDER));
- pItem->AddControl(pLabelReminder);
- pLabelReminder->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelReminder->SetTextColor(Color(COLOR_DETAIL02));
- pLabelReminder->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
- pLabelReminder->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
-
- int yPos = (height - (H_REMINDER_ITEM_REMINDER * countReminder)) / 2;
- for (int i = 0; i < countReminder; i++)
- {
- Label* pLabelReminderContent = new (std::nothrow) Label();
- pLabelReminderContent->Construct(Rectangle(0, yPos, itemWidth - W_REMINDER_ITEM_MARGIN, H_REMINDER_ITEM_REMINDER), L"");
- pLabelReminderContent->SetText(__pPm->GetReminderString(i));
- pLabelReminderContent->SetTextConfig(FONT_SIZE_DETAIL03, LABEL_TEXT_STYLE_NORMAL);
- pLabelReminderContent->SetTextColor(Color(COLOR_DETAIL03));
- pLabelReminderContent->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
- pLabelReminderContent->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
- pItem->AddControl(pLabelReminderContent);
- yPos += H_REMINDER_ITEM_REMINDER;
- }
+ Panel* pPanel = new (std::nothrow) Panel();
+ pPanel->Construct(L"IDL_PANEL_1_LINE_SUB_ITEM");
+
+ Label* pLabelReminder = static_cast<Label*>(pPanel->GetControl(L"IDC_LABEL_MAIN"));
+ pLabelReminder->SetText(ResourceManager::GetString(IDS_CLD_BODY_REMINDER));
+ pLabelReminder->SetTextConfig(__fontSize, LABEL_TEXT_STYLE_NORMAL);
+
+ Label* pLabelReminderContent = static_cast<Label*>(pPanel->GetControl(L"IDC_LABEL_SUB"));
+ pLabelReminderContent->SetText(reminderContents);
+
+ pItem->AddControl(pPanel);
+
+ layout.SetHorizontalFitPolicy(*pPanel, FIT_POLICY_PARENT);
+ layout.SetVerticalFitPolicy(*pPanel, FIT_POLICY_PARENT);
return pItem;
}
TableViewItem*
EventDetailsForm::CreateRepeatItemN(int itemWidth, const String& repeat)
{
+ Font font;
+ font.Construct(FONT_STYLE_PLAIN, __fontSize);
+
+ TextElement textElement;
+ textElement.Construct(L" ");
+ textElement.SetFont(font);
+
+ EnrichedText enrichedText;
+ enrichedText.Construct(FloatDimension(itemWidth, 1.f));
+ enrichedText.Add(textElement);
+
+ RelativeLayout layout;
+ layout.Construct();
+
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(Dimension(itemWidth, H_REPEAT_ITEM));
+ pItem->Construct(layout, FloatDimension(itemWidth, enrichedText.GetTotalLineHeightF() + 32.f));
pItem->SetEnabled(false);
- Label* pLabelRepeat = new (std::nothrow) Label();
- pLabelRepeat->Construct(Rectangle(0, 0, itemWidth, H_REPEAT_ITEM),
- ResourceManager::GetString(IDS_CLD_BODY_REPEAT));
- pItem->AddControl(pLabelRepeat);
- pLabelRepeat->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelRepeat->SetTextColor(Color(COLOR_DETAIL02));
- pLabelRepeat->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
- pLabelRepeat->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
-
- Label* pLabelRepeatContent = new (std::nothrow) Label();
- pLabelRepeatContent->Construct(Rectangle(0, 0, itemWidth - W_REPEAT_ITEM_MARGIN, H_REPEAT_ITEM), repeat);
- pItem->AddControl(pLabelRepeatContent);
- pLabelRepeatContent->SetTextConfig(FONT_SIZE_DETAIL03, LABEL_TEXT_STYLE_NORMAL);
- pLabelRepeatContent->SetTextColor(Color(COLOR_DETAIL03));
- pLabelRepeatContent->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
- pLabelRepeatContent->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+ Panel* pPanel = new (std::nothrow) Panel();
+ pPanel->Construct(L"IDL_PANEL_1_LINE_SUB_ITEM");
+
+ Label* pLabelRepeat = static_cast<Label*>(pPanel->GetControl(L"IDC_LABEL_MAIN"));
+ pLabelRepeat->SetText(ResourceManager::GetString(IDS_CLD_BODY_REPEAT));
+ pLabelRepeat->SetTextConfig(__fontSize, LABEL_TEXT_STYLE_NORMAL);
+
+ Label* pLabelRepeatContent = static_cast<Label*>(pPanel->GetControl(L"IDC_LABEL_SUB"));
+ pLabelRepeatContent->SetText(repeat);
+
+ pItem->AddControl(pPanel);
+
+ layout.SetHorizontalFitPolicy(*pPanel, FIT_POLICY_PARENT);
+ layout.SetVerticalFitPolicy(*pPanel, FIT_POLICY_PARENT);
+
return pItem;
}
EventDetailsForm::CreateSaveToItemN(int itemWidth, const String& accountName, const String& calendarName, const Bitmap* pCalendarIcon)
{
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(Dimension(itemWidth, H_SAVE_TO_ITEM));
+ pItem->Construct(Dimension(itemWidth, __itemHeight));
pItem->SetEnabled(false);
int x = 0;
if (pCalendarIcon != null)
{
Label* pIconLabel = new (std::nothrow) Label();
- pIconLabel->Construct(Rectangle(X_ITEM_SAVE_TO_ICON, Y_ITEM_SAVE_TO_ICON,
- W_ITEM_SAVE_TO_ICON, H_ITEM_SAVE_TO_ICON), L"");
+ pIconLabel->Construct(Rectangle(X_ITEM_SAVE_TO_ICON, (__itemHeight - H_ITEM_SAVE_TO_ICON)/2,
+ W_ITEM_SAVE_TO_ICON, H_ITEM_SAVE_TO_ICON), L"");
pIconLabel->SetBackgroundBitmap(*pCalendarIcon);
pItem->AddControl(pIconLabel);
x += X_ITEM_SAVE_TO_ICON + W_ITEM_SAVE_TO_ICON;
pLabelCalendarName->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
Label* pLabelCalendarAddress = new (std::nothrow) Label();
- pLabelCalendarAddress->Construct(Rectangle(x, Y_SAVE_TO_ITEM_CALENDAR_ADDRESS, itemWidth - x, H_SAVE_TO_ITEM_CALENDAR_ADDRESS), calendarName);
+ pLabelCalendarAddress->Construct(Rectangle(x, Y_SAVE_TO_ITEM_CALENDAR_ADDRESS, itemWidth - x, GetSavetoItemHeight()), calendarName);
pItem->AddControl(pLabelCalendarAddress);
- pLabelCalendarAddress->SetTextConfig(FONT_SIZE_DETAIL02, LABEL_TEXT_STYLE_NORMAL);
- pLabelCalendarAddress->SetTextColor(Color(COLOR_DETAIL02));
+ pLabelCalendarAddress->SetTextConfig(__fontSize, LABEL_TEXT_STYLE_NORMAL);
pLabelCalendarAddress->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
return pItem;