: Fix to use IKeyDownListener instead of IFocusedListener to show the first depth of layout when one of group button is focused.
: Using IFocusedListener can make a critical bug because OnFocused function can be called unintentionally when elm_object_part_content_unset is called.
Change-Id: Ied4f0a9a6d05f67de9058fb27deb9783ec78861f
Signed-off-by: Kim Tae Soo <taesoo46.kim@samsung.com>
public CBaseView,
public IMouseMoveListener,
public IMouseClickedListener,
- public IMusicControllerListener,
- public IFocusedListener {
+ public IMusicControllerListener {
private:
struct SMusicBaseView* m;
static void sm_CbCtxPopupBtnSelected(void* cookie, CCtxPopup* instance, const char* text);
void m_CbCtxPopupBtnSelected(CCtxPopup* instance, const char* text);
+ static Eina_Bool sm_CbShowLayoutIdler(void *cookie);
+ void m_OnShowLayoutIdler(void);
+
private:
void m_UpdateFocusSequence(void);
void m_UpdateEmptyFocusSequence(void);
CBaseView(pViewId),
IMouseMoveListener(this),
IMouseClickedListener(this),
- IFocusedListener(this),
m(0) {}
virtual ~CMusicBaseView() {}
virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
virtual void OnMouseClicked(int id, Evas_Object *obj);
- virtual void OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item);
virtual void OnComplete(void);
virtual void OnError(void);
Evas_Object *base;
Evas_Object *songlist;
Evas_Object *addBtns[TOTAL_ADD_BTNS];
+ Evas_Object *albumCover;
Elm_Object_Item *focused_item;
CMusicController* mhandle;
m->it_infolist = NULL;
}
+ if (m->albumCover)
+ evas_object_del(m->albumCover);
+ m->albumCover = NULL;
+
+ int i;
+
+ for (i = 0; i < TOTAL_ADD_BTNS; i++) {
+ if (m->addBtns[i])
+ evas_object_del(m->addBtns[i]);
+ m->addBtns[i] = NULL;
+ }
+
m->total_duration = 0;
}
void CAlbumSongsLayout::m_CreateTopSection(void)
{
- Evas_Object *thumb = NULL;
int i;
Evas_Object *btn;
Evas_Object *img = NULL;
btninfo[BTN_LAST].icon = MUSIC_IMAGE_ADD_LAST;
btninfo[BTN_LAST].type = ALBUM_SONGS_LAST_BUTTON;
- thumb = m_AddAlbumCover();
- if (!thumb)
+ m->albumCover = m_AddAlbumCover();
+ if (!m->albumCover)
return;
for (i = 0; i < TOTAL_ADD_BTNS; i++) {
path = m->alinfo->ThumbnailPath();
if (path) {
- elm_image_file_set(thumb, path, NULL);
- elm_image_aspect_fixed_set(thumb, EINA_FALSE);
+ elm_image_file_set(m->albumCover, path, NULL);
+ elm_image_aspect_fixed_set(m->albumCover, EINA_FALSE);
}
else {
snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
MUSIC_IMAGE_DEFAULT_THUMB_126);
- elm_image_file_set(thumb, buf, NULL);
- elm_image_no_scale_set(thumb, EINA_TRUE);
+ elm_image_file_set(m->albumCover, buf, NULL);
+ elm_image_no_scale_set(m->albumCover, EINA_TRUE);
}
elm_object_part_content_set(layout, MUSIC_PART_ALBUM_THUMB,
- thumb);
+ m->albumCover);
elm_object_part_text_set(layout, MUSIC_PART_ALBUM_NAME,
m->alinfo->Name());
elm_object_part_text_set(layout, MUSIC_PART_ALBUM_ARTIST,
CHandleVolume *pHandleVolume;
+ Ecore_Idler *eiShowLayout;
+
SMusicBaseView() {
memset(this, 0, sizeof(SMusicBaseView));
pHandleVolume = new CHandleVolume;
}
+Eina_Bool CMusicBaseView::sm_CbShowLayoutIdler(void *cookie)
+{
+ CMusicBaseView *root = (CMusicBaseView*)cookie;
+ if (root)
+ root->m_OnShowLayoutIdler();
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+
+void CMusicBaseView::m_OnShowLayoutIdler(void)
+{
+ m->eiShowLayout = NULL;
+
+ if (elm_object_focus_get(m->c_grpbtn))
+ m_ShowCurrentLayout();
+}
+
+
Evas_Object *CMusicBaseView::m_CreateLoadingPopup(void)
{
Evas_Object *popup = NULL, *label = NULL, *icon = NULL;
parcel.keyEvent = ev->keyname;
CViewMgr::GetInstance()->UpdateView((const char *)MUSIC_PLAYBACK_VIEW, &parcel);
}
+ else if (!strcmp(ev->keyname, KEY_LEFT))
+ m->eiShowLayout = ecore_idler_add(sm_CbShowLayoutIdler, this);
break;
case BASE_VIEW_PLAY_BUTTON:
case BASE_VIEW_GROUP_PLAYLIST:
{
if (m->c_grpbtn == obj)
- return;
+ return;
elm_object_signal_emit(m->c_grpbtn,
MUSIC_SIGNAL_GROUP_UNSELECTED, MUSIC_BASE_VIEW);
}
-void CMusicBaseView::OnFocused(int id, Evas_Object *obj, Elm_Object_Item *item)
-{
- switch (id) {
- case BASE_VIEW_GROUP_SONG:
- case BASE_VIEW_GROUP_ALBUM:
- case BASE_VIEW_GROUP_ARTIST:
- case BASE_VIEW_GROUP_GENRE:
- case BASE_VIEW_GROUP_FOLDER:
- case BASE_VIEW_GROUP_PLAYLIST:
- if (m->lmgr->Layout()) {
- m_ShowCurrentLayout();
- m_UpdateCurrentLayout(false);
- }
- break;
-
- default:
- break;
- }
-}
-
-
void CMusicBaseView::OnComplete(void)
{
m_UpdatePlaysongLabel();
CSongInfo *sinfo;
void *obj;
Eina_List *l;
- struct SSongItemInfo *itinfo;
+ SSongItemInfo *itinfo;
Elm_Object_Item *item;
/* Remove existing songlist and prepare afresh */