From: katpaga.a Date: Wed, 4 Sep 2013 08:48:07 +0000 (+0530) Subject: Fix for N_SE-50833(Focus lost during scene transition) X-Git-Tag: accepted/tizen/20131002.165803^2~223 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=639f4645ec0b4d329662638b863f0c929f00f5b7;p=platform%2Fframework%2Fnative%2Fuifw.git Fix for N_SE-50833(Focus lost during scene transition) Change-Id: I0cc59a2bf1af7e99bc36424338a25052844645c2 Signed-off-by: katpaga.a --- diff --git a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp index 707ea73..2364539 100644 --- a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp @@ -1242,11 +1242,11 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, int elementId) } result -_GroupedListViewImpl::UpdateList(void) +_GroupedListViewImpl::UpdateList(bool isRestoreFocus) { __needReloadItems = true; - result r = GetCore().UpdateTableView(); + result r = GetCore().UpdateTableView(isRestoreFocus); CheckEmptyListShowState(); @@ -1957,12 +1957,17 @@ _GroupedListViewImpl::OnBoundsChanged(void) if (__isOrientationChanged) { + __isOrientationChanged = false; + if (GetCore().IsTableViewFocused() && GetCore().IsFocusModeStateEnabled()) { GetCore().RestoreFocus(true); + UpdateList(true); + } + else + { + UpdateList(); } - __isOrientationChanged = false; - UpdateList(); } } diff --git a/src/ui/controls/FUiCtrl_ListViewImpl.cpp b/src/ui/controls/FUiCtrl_ListViewImpl.cpp index e10404c..6bedcd6 100644 --- a/src/ui/controls/FUiCtrl_ListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListViewImpl.cpp @@ -1214,11 +1214,11 @@ _ListViewImpl::RefreshList(int index, int elementId) } result -_ListViewImpl::UpdateList(void) +_ListViewImpl::UpdateList(bool isRestoreFocus) { __needReloadItems = true; - result r = GetCore().UpdateTableView(); + result r = GetCore().UpdateTableView(isRestoreFocus); CheckEmptyListShowState(); @@ -1813,11 +1813,17 @@ _ListViewImpl::OnBoundsChanged(void) if (__isOrientationChanged) { __isOrientationChanged = false; + if (GetCore().IsTableViewFocused() && GetCore().IsFocusModeStateEnabled()) { GetCore().RestoreFocus(true); + UpdateList(true); } - UpdateList(); + else + { + UpdateList(); + } + } } diff --git a/src/ui/controls/FUiCtrl_TableView.cpp b/src/ui/controls/FUiCtrl_TableView.cpp index c2e4d31..3c8fd73 100644 --- a/src/ui/controls/FUiCtrl_TableView.cpp +++ b/src/ui/controls/FUiCtrl_TableView.cpp @@ -780,13 +780,13 @@ _TableView::RefreshAllItems(void) result -_TableView::UpdateTableView(void) +_TableView::UpdateTableView(bool isRestoreFocus) { if (IsOnProcessing()) { return E_INVALID_OPERATION; } - return __pTableViewPresenter->UpdateTableView(); + return __pTableViewPresenter->UpdateTableView(isRestoreFocus); } result diff --git a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp index 5cbfb14..b3b1fe4 100644 --- a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp @@ -638,8 +638,17 @@ _TableViewPresenter::RefreshAllItems(void) } result -_TableViewPresenter::UpdateTableView(void) +_TableViewPresenter::UpdateTableView(bool isRestoreFocus) { + if (!isRestoreFocus) + { + __isTableViewFocused = false; + __focusItemTag.groupIndex = -1; + __focusItemTag.itemIndex = -1; + __isRestoreFocus = false; + __isAnnexFocused = false; + } + if (__isUpdatingTableView) { return E_SUCCESS; diff --git a/src/ui/inc/FUiCtrl_GroupedListViewImpl.h b/src/ui/inc/FUiCtrl_GroupedListViewImpl.h index e87cd80..3059d5a 100644 --- a/src/ui/inc/FUiCtrl_GroupedListViewImpl.h +++ b/src/ui/inc/FUiCtrl_GroupedListViewImpl.h @@ -128,7 +128,7 @@ public: result RefreshList(int groupIndex, int itemIndex, int elementId); - result UpdateList(void); + result UpdateList(bool isRestoreFocus = false); result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; diff --git a/src/ui/inc/FUiCtrl_ListViewImpl.h b/src/ui/inc/FUiCtrl_ListViewImpl.h index 72a9934..a725918 100644 --- a/src/ui/inc/FUiCtrl_ListViewImpl.h +++ b/src/ui/inc/FUiCtrl_ListViewImpl.h @@ -125,7 +125,7 @@ public: result RefreshList(int index, int elementId); - result UpdateList(void); + result UpdateList(bool isRestoreFocus = false); int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; diff --git a/src/ui/inc/FUiCtrl_TableView.h b/src/ui/inc/FUiCtrl_TableView.h index 1172fb8..bd69de6 100644 --- a/src/ui/inc/FUiCtrl_TableView.h +++ b/src/ui/inc/FUiCtrl_TableView.h @@ -151,7 +151,7 @@ public: result RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType type, bool animation = true); result RefreshAllItems(void); - result UpdateTableView(void); + result UpdateTableView(bool isRestoreFocus = false); result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; diff --git a/src/ui/inc/FUiCtrl_TableViewPresenter.h b/src/ui/inc/FUiCtrl_TableViewPresenter.h index 8874e1a..1c63a60 100644 --- a/src/ui/inc/FUiCtrl_TableViewPresenter.h +++ b/src/ui/inc/FUiCtrl_TableViewPresenter.h @@ -221,7 +221,7 @@ public: result RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType type, bool animation); result RefreshAllItems(void); - result UpdateTableView(void); + result UpdateTableView(bool isRestoreFocus); result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; result GetItemFromPosition(const Tizen::Graphics::FloatPoint& position, TableViewItemTag& itemPos) const;