//ViewItem
virtual void onAttached(ViewItem &item);
+ virtual void onTransitionFinished(NaviFrameItem &item) {};
private:
void setTitleVisibility(bool visible);
void pop();
void insertToBottom(NaviFrameItem &item);
void promote(NaviFrameItem &item);
+ NaviFrameItem *getTopFrame() const;
+ bool getTransitionStatus() const;
private:
void create(Evas_Object *parent);
+ void onTransitionFinished(Evas_Object *obj, void *eventInfo);
+
+ private:
+ bool m_TransitionStatus;
};
}
NaviFrameView::NaviFrameView(Evas_Object *parent)
: View()
+ , m_TransitionStatus(false)
{
create(parent);
}
NaviFrameView::NaviFrameView(View &parent)
: View()
+ , m_TransitionStatus(false)
{
create(parent.getEo());
}
void NaviFrameView::create(Evas_Object *parent)
{
setEo(elm_naviframe_add(parent));
+ addSmartCb("transition,finished", SMART_CALLBACK(NaviFrameView, onTransitionFinished), this);
show();
}
return elm_naviframe_bottom_item_get(getEo()) == elm_naviframe_top_item_get(getEo());
}
+NaviFrameItem *NaviFrameView::getTopFrame() const
+{
+ return ViewItem::staticCast<NaviFrameItem*>(elm_naviframe_top_item_get(getEo()));
+}
+
int NaviFrameView::getItemsCount() const
{
int res = 0;
void NaviFrameView::push(NaviFrameItem &item, Evas_Object *content)
{
+ m_TransitionStatus = !isEmpty();
Elm_Object_Item *it = elm_naviframe_item_push(getEo(), nullptr, nullptr, nullptr, content, naviTitleStyleEmpty);
item.setElmObjItem(it);
}
void NaviFrameView::push(NaviFrameItem &item, View &content)
{
+ m_TransitionStatus = !isEmpty();
push(item, content);
}
void NaviFrameView::pop()
{
+ m_TransitionStatus = getItemsCount() > 1;
elm_naviframe_item_pop(getEo());
}
void NaviFrameView::promote(NaviFrameItem &item)
{
+ m_TransitionStatus = &item != getTopFrame();
elm_naviframe_item_promote(item);
}
+
+void NaviFrameView::onTransitionFinished(Evas_Object *obj, void *eventInfo)
+{
+ MSG_LOG("");
+ m_TransitionStatus = false;
+ auto *item = ViewItem::staticCast<NaviFrameItem*>(eventInfo);
+ if(item)
+ item->onTransitionFinished(*item);
+}
+
+bool NaviFrameView::getTransitionStatus() const
+{
+ // TODO: Move functionality for gets TransitionStatus to EFL (elm_naviframe) side.
+ return m_TransitionStatus;
+}
#include "SystemSettingsManager.h"
#include "WorkingDir.h"
+#include <functional>
+
namespace Msg
{
class NaviFrameController;
private:
// NaviFrameItem:
virtual void onAttached(ViewItem &item);
+ virtual void onTransitionFinished(NaviFrameItem &item);
virtual void onButtonClicked(NaviFrameItem &item, NaviButtonId buttonId);
// IHwButtonListener:
void convertMsgTypeHandler();
void checkAndSetMsgType();
void navigateToSlideShow(MsgId id);
+ void setBodyFocus();
+ void setRecipEntryFocus();
void showMainPopup();
void showNoRecipPopup();
DefferedCmd m_DefferedCmd;
ContactEditor m_ContactEditor;
IConversationListener *m_pListener;
+ std::function<void()> m_TransFinishedFunc;
};
class IConversationListener
}
if(isRecipExists() && m_pBody)
- {
m_pBody->setFocus(true);
- }
else if(m_pRecipPanel)
m_pRecipPanel->setEntryFocus(true);
}
m_pRecipPanel->update(m_ThreadId);
m_pRecipPanel->showMbe(!m_pRecipPanel->isMbeEmpty());
m_pRecipPanel->showEntry(true);
- m_pRecipPanel->setEntryFocus(true);
+ m_pRecipPanel->setFocus(true);
}
void Conversation::setConversationMode()
getParent().push(*viewer);
}
+void Conversation::setBodyFocus()
+{
+ if(getOwner().getTransitionStatus())
+ {
+ m_TransFinishedFunc = [this]()
+ {
+ if(m_pBody)
+ m_pBody->setFocus(true);
+ };
+ }
+ else
+ {
+ if(m_pBody)
+ m_pBody->setFocus(true);
+ }
+}
+
+void Conversation::setRecipEntryFocus()
+{
+ if(getOwner().getTransitionStatus())
+ {
+ m_TransFinishedFunc = [this]()
+ {
+ if(m_pRecipPanel)
+ m_pRecipPanel->setEntryFocus(true);
+ };
+ }
+ else
+ {
+ if(m_pRecipPanel)
+ m_pRecipPanel->setEntryFocus(true);
+ }
+}
+
PopupList &Conversation::createPopupList(const std::string &title)
{
PopupList &popup = getApp().getPopupManager().getPopupList();
void Conversation::onAttached(ViewItem &item)
{
+ MSG_LOG("");
FrameController::onAttached(item);
updateNavibar();
setContent(*m_pLayout);
}
+void Conversation::onTransitionFinished(NaviFrameItem &item)
+{
+ MSG_LOG("");
+ if(m_TransFinishedFunc)
+ {
+ m_TransFinishedFunc();
+ m_TransFinishedFunc = nullptr;
+ }
+}
+
void Conversation::onHwBackButtonClicked()
{
MSG_LOG("");
void MsgThread::composeNewMessage()
{
Conversation *frame = new Conversation(getParent());
- frame->setThreadId(ThreadId());
getParent().push(*frame);
+ frame->setThreadId(ThreadId());
}
void MsgThread::navigateToSettings()