From 13b582cc0f7998c85a493bbf8a12a96ecfaf70c7 Mon Sep 17 00:00:00 2001 From: Sreedeep Moulik Date: Fri, 6 Sep 2013 14:34:13 +0530 Subject: [PATCH] Fix for 51220 - setting flag for layout change in orientation Change-Id: I75d33f099cc22e2ef54e17ba58c9d797b5353f98 Signed-off-by: Sreedeep Moulik --- src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp | 5 +++++ src/ui/controls/FUiCtrl_ListViewImpl.cpp | 5 +++++ src/ui/controls/FUiCtrl_TableView.cpp | 6 ++++++ src/ui/controls/FUiCtrl_TableViewPresenter.cpp | 10 ++++++++++ src/ui/inc/FUiCtrl_TableView.h | 1 + src/ui/inc/FUiCtrl_TableViewPresenter.h | 2 ++ 6 files changed, 29 insertions(+) diff --git a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp index 2364539..0c15dd7 100644 --- a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp @@ -1938,6 +1938,11 @@ _GroupedListViewImpl::OnChangeLayout(_ControlOrientation orientation) { __isOrientationChanged = true; + if (GetCore().IsFocusModeStateEnabled()) + { + GetCore().SetFocusDuringOrientationChange(); + } + _ControlImpl::OnChangeLayout(orientation); } diff --git a/src/ui/controls/FUiCtrl_ListViewImpl.cpp b/src/ui/controls/FUiCtrl_ListViewImpl.cpp index 6bedcd6..f6354a9 100644 --- a/src/ui/controls/FUiCtrl_ListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListViewImpl.cpp @@ -1793,6 +1793,11 @@ _ListViewImpl::OnChangeLayout(_ControlOrientation orientation) { __isOrientationChanged = true; + if (GetCore().IsFocusModeStateEnabled()) + { + GetCore().SetFocusDuringOrientationChange(); + } + _ControlImpl::OnChangeLayout(orientation); } diff --git a/src/ui/controls/FUiCtrl_TableView.cpp b/src/ui/controls/FUiCtrl_TableView.cpp index 3c8fd73..b597d63 100644 --- a/src/ui/controls/FUiCtrl_TableView.cpp +++ b/src/ui/controls/FUiCtrl_TableView.cpp @@ -1428,6 +1428,12 @@ _TableView::GetVisualElementValueAnimation(const Tizen::Base::String& keyName) c return pAnimation; } +void +_TableView::SetFocusDuringOrientationChange(void) +{ + __pTableViewPresenter->SetFocusDuringOrientationChange(); +} + bool _TableView::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) { diff --git a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp index b3b1fe4..db04ae1 100644 --- a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp @@ -6079,6 +6079,7 @@ _TableViewPresenter::OnDrawFocus(void) void _TableViewPresenter::OnFocusModeStateChanged(void) { + __isFocusedDuringOrientationChange = false; __focusItemTag.groupIndex = -1; __focusItemTag.itemIndex = -1; __isRestoreFocus = false; @@ -6207,6 +6208,15 @@ _TableViewPresenter::FireItemTouchReleasedEventDuringPressing(int groupIndex, in } } +void +_TableViewPresenter::SetFocusDuringOrientationChange(void) +{ + if (__focusItemTag.groupIndex != -1) + { + __isFocusedDuringOrientationChange = true; + } +} + bool _TableViewSectionStringAlignment::operator== (const _TableViewSectionStringAlignment& rhs) const { diff --git a/src/ui/inc/FUiCtrl_TableView.h b/src/ui/inc/FUiCtrl_TableView.h index bd69de6..daabc48 100644 --- a/src/ui/inc/FUiCtrl_TableView.h +++ b/src/ui/inc/FUiCtrl_TableView.h @@ -238,6 +238,7 @@ public: virtual void OnChildDetached(const _Control& child); result SetTableViewStatusChanged(bool changed); + void SetFocusDuringOrientationChange(void); // VE Value Animation Tizen::Ui::Animations::VisualElementValueAnimation* GetVisualElementValueAnimation(const Tizen::Base::String& keyName) const; diff --git a/src/ui/inc/FUiCtrl_TableViewPresenter.h b/src/ui/inc/FUiCtrl_TableViewPresenter.h index 1c63a60..d0a0a17 100644 --- a/src/ui/inc/FUiCtrl_TableViewPresenter.h +++ b/src/ui/inc/FUiCtrl_TableViewPresenter.h @@ -305,6 +305,8 @@ public: void FireItemTouchReleasedEventDuringPressing(int groupIndex, int itemIndex); + void SetFocusDuringOrientationChange(void); + protected: virtual float ScrollToInternal(float targetPosition); virtual void FadeInScrollBar(void); -- 2.7.4