From: Amith Kumar Mahale Date: Fri, 13 Sep 2013 13:30:49 +0000 (+0530) Subject: Fix for N_SE-52218 N_SE-52137 N_SE-51981 N_SE-52184 X-Git-Tag: 2.2.1_release~32^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01d5ce890c6205e3b1b667b97f950ddab8c2f546;p=apps%2Fosp%2FCalendar.git Fix for N_SE-52218 N_SE-52137 N_SE-51981 N_SE-52184 Change-Id: I162f45f18da1c555428e22ca9b2a510f40866f51 Signed-off-by: Amith Kumar Mahale --- diff --git a/inc/ClListPanel.h b/inc/ClListPanel.h index 4f6c9e0..b5e6af2 100644 --- a/inc/ClListPanel.h +++ b/inc/ClListPanel.h @@ -90,6 +90,7 @@ public: private: result Update(void); + void RefreshGroups(int groupIndex); private: EventListPresentationModel* __pPm; diff --git a/inc/ClReminderForm.h b/inc/ClReminderForm.h index eba3500..f034891 100644 --- a/inc/ClReminderForm.h +++ b/inc/ClReminderForm.h @@ -111,6 +111,8 @@ private: Tizen::Base::String __customReminderTimeUnitText; Tizen::Base::String __customReminderTimeOffset; int __index; + bool __isKeypadOpen; + bool __showContextMenu; }; // ReminderForm #endif // _CL_REMINDER_FORM_H_ diff --git a/src/ClEventEditorForm.cpp b/src/ClEventEditorForm.cpp index 499cc3d..2d13be1 100644 --- a/src/ClEventEditorForm.cpp +++ b/src/ClEventEditorForm.cpp @@ -852,11 +852,11 @@ EventEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId __pPm->SetEndTime(end); SetStyle(EDIT_EVENT_FORM_STYLE_CREATE); - - if (__pEditFieldTitle) + //Fix for N_SE-52137 + /*if (__pEditFieldTitle) { __pEditFieldTitle->SetFocus(); - } + }*/ } } } diff --git a/src/ClEventPresentationModel.cpp b/src/ClEventPresentationModel.cpp index 049794b..18aaf66 100644 --- a/src/ClEventPresentationModel.cpp +++ b/src/ClEventPresentationModel.cpp @@ -881,11 +881,11 @@ EventPresentationModel::Update(void) } break; case FREQ_MONTHLY: - __pRecurrence->SetDayOfMonth(startUtcTime.GetDay()); + __pRecurrence->SetDayOfMonth(__startDateTime.GetDay()); break; case FREQ_YEARLY: - __pRecurrence->SetDayOfMonth(startUtcTime.GetDay()); - __pRecurrence->SetMonthOfYear(startUtcTime.GetMonth()); + __pRecurrence->SetDayOfMonth(__startDateTime.GetDay()); + __pRecurrence->SetMonthOfYear(__startDateTime.GetMonth()); break; default: break; diff --git a/src/ClListPanel.cpp b/src/ClListPanel.cpp index 6dde875..9cc9148 100644 --- a/src/ClListPanel.cpp +++ b/src/ClListPanel.cpp @@ -498,37 +498,12 @@ ListPanel::OnGroupedListViewItemStateChanged(GroupedListView& listView, if (groupIndex == 0) { - DateTime minRange = __pPm->GetViewMinRange(); - minRange.AddMonths(PREVIOUS_DATE); - DateTime minDateTime = Calendarbook::GetMinDateTime(); - minDateTime.AddYears(1); - if (minRange < minDateTime) - { - minRange = minDateTime; - } - - __pPm->SetViewType(VIEW_TYPE_LIST); - __pPm->SetViewRange(minRange, __pPm->GetViewMaxRange()); - - Update(); + RefreshGroups(groupIndex); return; } else if (groupIndex == lastGroupIndex) { - DateTime maxRange = __pPm->GetViewMaxRange(); - maxRange.AddMonths(NEXT_DATE); - DateTime maxDateTime = Calendarbook::GetMaxDateTime(); - maxDateTime.AddYears(-1); - if (maxRange > maxDateTime) - { - maxRange = maxDateTime; - } - - __pPm->SetViewType(VIEW_TYPE_LIST); - __pPm->SetViewRange(__pPm->GetViewMinRange(), maxRange); - - Update(); - + RefreshGroups(groupIndex); listView.ScrollToItem(listView.GetGroupCount() - 1, 0); listView.Invalidate(false); return; @@ -707,13 +682,7 @@ ListPanel::OnCurrentDateChanged(const DateTime& currentDate, const DateTime& pre result ListPanel::Update(void) { - int initialcount = __pGroupedListViewEventsList->GetGroupCount(); result r = __pGroupedListViewEventsList->UpdateList(); - int finalcount = __pGroupedListViewEventsList->GetGroupCount(); - if (initialcount != finalcount) - { - __pGroupedListViewEventsList->ExpandAllGroups(); - } if (r == E_SUCCESS) { @@ -725,3 +694,60 @@ ListPanel::Update(void) return r; } + +void +ListPanel::RefreshGroups(int groupIndex) +{ + if (groupIndex == 0) + { + DateTime startDate = __pPm->GetDateTimeFromGroupIndex(0); + DateTime minRange = __pPm->GetViewMinRange(); + minRange.AddMonths(PREVIOUS_DATE); + DateTime minDateTime = Calendarbook::GetMinDateTime(); + minDateTime.AddYears(1); + if (minRange < minDateTime) + { + minRange = minDateTime; + } + + __pPm->SetViewType(VIEW_TYPE_LIST); + __pPm->SetViewRange(minRange, __pPm->GetViewMaxRange()); + int addedGroupCount = __pPm->GetGroupIndex(startDate); + + __pGroupedListViewEventsList->RefreshList(0, 0, LIST_REFRESH_TYPE_ITEM_MODIFY); + for (int i = 0; i < addedGroupCount; ++i) + { + __pGroupedListViewEventsList->RefreshList(i + TOP_BOTTOM_ITEM_COUNT, -1, LIST_REFRESH_TYPE_ITEM_ADD); + } + if (__pGroupedListViewEventsList->IsGroupExpanded(GetGroupCount() - 1) == false) + { + __pGroupedListViewEventsList->ExpandGroup(GetGroupCount() - 1); + } + return; + } + else + { + int prevGroupCount = __pPm->GetWholeDayCount(); + DateTime maxRange = __pPm->GetViewMaxRange(); + maxRange.AddMonths(NEXT_DATE); + DateTime maxDateTime = Calendarbook::GetMaxDateTime(); + maxDateTime.AddYears(-1); + if (maxRange > maxDateTime) + { + maxRange = maxDateTime; + } + + __pPm->SetViewType(VIEW_TYPE_LIST); + __pPm->SetViewRange(__pPm->GetViewMinRange(), maxRange); + + int groupCount = __pPm->GetWholeDayCount(); + + for (int i = prevGroupCount; i < groupCount; ++i) + { + __pGroupedListViewEventsList->RefreshList(i + TOP_BOTTOM_ITEM_COUNT, -1, LIST_REFRESH_TYPE_ITEM_ADD); + } + __pGroupedListViewEventsList->RefreshList(__pGroupedListViewEventsList->GetGroupCount() - 1, 0, LIST_REFRESH_TYPE_ITEM_MODIFY); + + return; + } +} diff --git a/src/ClReminderForm.cpp b/src/ClReminderForm.cpp index b46f201..2e07c0f 100644 --- a/src/ClReminderForm.cpp +++ b/src/ClReminderForm.cpp @@ -61,6 +61,8 @@ ReminderForm::ReminderForm(void) , __customReminderTimeUnit(REMINDER_TIME_UNIT_MINUTE) , __customReminderTimeUnitText(ResourceManager::GetString(IDS_TMR_OPT_MIN_LC_ABB)) , __index(0) + ,__isKeypadOpen(false) + ,__showContextMenu(false) { } @@ -587,11 +589,20 @@ ReminderForm::OnActionPerformed(const Control& source, int actionId) { case IDA_REMINDER_FORM_TIME_UNIT: { - Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition()); - point.x -= __pButtonReminderTimeUnit->GetWidth(); - __pContextMenuTimeUnitSelector->SetAnchorPosition(point); - __pContextMenuTimeUnitSelector->SetShowState(true); - __pContextMenuTimeUnitSelector->Show(); + if(__isKeypadOpen == true) + { + //should wait till it is closed + __showContextMenu = true; + SetFocus(); + } + else + { + Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition()); + point.x -= __pButtonReminderTimeUnit->GetWidth(); + __pContextMenuTimeUnitSelector->SetAnchorPosition(point); + __pContextMenuTimeUnitSelector->SetShowState(true); + __pContextMenuTimeUnitSelector->Show(); + } break; } case REMINDER_TIME_UNIT_MINUTE: @@ -639,23 +650,20 @@ ReminderForm::OnKeypadWillOpen(Tizen::Ui::Control& source) void ReminderForm::OnKeypadOpened(Tizen::Ui::Control& source) { - if (__pButtonReminderTimeUnit->IsVisible()) - { - Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition()); - point.x -= __pButtonReminderTimeUnit->GetWidth(); - __pContextMenuTimeUnitSelector->SetAnchorPosition(point); - __pContextMenuTimeUnitSelector->Invalidate(false); - } + __isKeypadOpen = true; } void ReminderForm::OnKeypadClosed(Tizen::Ui::Control& source) { - if (__pButtonReminderTimeUnit->IsVisible()) + __isKeypadOpen = false; + if(__showContextMenu == true) { Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition()); point.x -= __pButtonReminderTimeUnit->GetWidth(); __pContextMenuTimeUnitSelector->SetAnchorPosition(point); - __pContextMenuTimeUnitSelector->Invalidate(false); + __pContextMenuTimeUnitSelector->SetShowState(true); + __pContextMenuTimeUnitSelector->Show(); + __showContextMenu = false; } } void