Previously, the apis won't have considered considerably.
It's implmeneted better.
Change-Id: I885870a52d53417445a93a9bbc7e4f47afe47827
*/
void _setViewmgr(UiIfaceViewmgr *viewmgr);
+ void setPopping(bool popping);
+
/**
* @brief Return the viewmgr instance.
*
EAPI int ui_viewmgr_insert_view_before(ui_view *view, ui_view *before)
{
- if (!before || !view)
+ if (!view)
{
- LOGE("Invalid Parameter view = %p, before = %p", view, before);
+ LOGE("Invalid Parameter view = %p", view);
return TIZEN_ERROR_INVALID_PARAMETER;
}
EAPI int ui_viewmgr_insert_view_after(ui_view *view, ui_view *after)
{
- if (!after || !view)
+ if (!view)
{
- LOGE("Invalid Parameter view = %p, after = %p", view, after);
+ LOGE("Invalid Parameter view = %p", view);
return TIZEN_ERROR_INVALID_PARAMETER;
}
unsigned int _rotationCount = 0; ///< The number of available rotations.
bool _eventBlock = false; ///< State of event block.
bool _removableContent = true; ///< When this value is true, view removes it's content internally on unload state.
+ bool _popping = false;
public:
int setEventBlock(bool block);
UiIfaceViewImpl::~UiIfaceViewImpl()
{
- this->_viewmgr->removeView(this->_view);
+ //This view is destroyed instantly.
+ if (this->_viewmgr && !this->_popping)
+ {
+ //Activate the previous view in this case.
+ unsigned int view_count = this->_viewmgr->getViewCount();
+
+ if ((view_count > 1) && (this->_viewmgr->getLastView() == this->_view))
+ {
+ auto pview = this->_viewmgr->getView(view_count - 2);
+ this->_viewmgr->popViewFinished(pview);
+ }
+
+ this->onUnload();
+ this->onDestroy();
+ }
+
+ if (this->_viewmgr) this->_viewmgr->removeView(this->_view);
if (this->_rotations) delete[](this->_rotations);
}
void UiIfaceView::onLanguageChanged(const char *language)
{
}
+
+void UiIfaceView::setPopping(bool popping)
+{
+ this->_impl->_popping = popping;
+}
//The previous view has been popped. It should become activate.
view->onActivate();
this->setEventBlock(view, false);
+ view->setPopping(false);
}
UiIfaceViewmgrImpl::UiIfaceViewmgrImpl(UiIfaceViewmgr* viewmgr)
return TIZEN_ERROR_NONE;
}
+ view->setPopping(true);
view->onDeactivate();
this->setEventBlock(view, true);
//previous page is to be an active page.
auto nx = prev(this->_viewList.end(), 2);
auto pview = *nx;
+ pview->setPopping(true);
pview->onLoad();
pview->onDeactivate();
this->setEventBlock(pview, true);