Fix bugs 33/36833/3 accepted/tizen/tv/20150317.003116 accepted/tizen/tv/20150318.030022 accepted/tizen/tv/20150319.020406 accepted/tizen/tv/20150401.123951 submit/tizen/20150318.012427 submit/tizen/20150318.020412 submit/tizen/20150318.022002 submit/tizen_tv/20150316.233615 submit/tizen_tv/20150319.000236 submit/tizen_tv/20150319.002351 submit/tizen_tv/20150401.080439
authorJuWan Kim <juwan.kim@samsung.com>
Mon, 16 Mar 2015 07:10:07 +0000 (16:10 +0900)
committerJuWan Kim <juwan.kim@samsung.com>
Mon, 16 Mar 2015 07:37:48 +0000 (16:37 +0900)
  * Modify focus action in left menu tree.
  * Remove flipping when chaing layout.
  * Modify media list in each layout.

Change-Id: I639c3ab59fcaf8623c862400825cddb041a988f4
Signed-off-by: JuWan Kim <juwan.kim@samsung.com>
include/define.h
src/layouts/FbAllLayout.cpp
src/layouts/FbMusicLayout.cpp
src/layouts/FbPhotoLayout.cpp
src/layouts/FbVideoLayout.cpp
src/views/BaseView/FbBaseView.cpp
src/views/BaseView/FileGrid.cpp

index 27054b3..4450370 100644 (file)
 #define KEY_BACK  "Escape"
 #define KEY_BACK_REMOTE  "XF86Close"
 #define KEY_MENU  "Super_L"
-#define KEY_MENU_REMOTE  "XF86MenuKB"
+#define KEY_MENU_REMOTE  "XF86Send"
 
 /* CTXPOPUP POSITION */
 #define POSITION_SORT_POPUP_X 1344
index a0c367d..336488d 100644 (file)
@@ -12,6 +12,8 @@
 #include <CtxPopup.h>
 #include "FbBaseView.h"
 #include "FbAllLayout.h"
+#include "../views/BaseView/Info.h"
+#include "common.h"
 
 
 struct SFbAllLayout {
@@ -119,6 +121,7 @@ void CFbAllLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
+       CInfo::SetGroupIndex(E_GRP_ALL);
        m->pFileGrid->Update(m->updateFlag);
        m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
@@ -188,7 +191,7 @@ void CFbAllLayout::SetFocus(Eina_Bool flag)
 void CFbAllLayout::Action(void)
 {
        ASSERT(m);
-       
+
        return m->pFileGrid->Action();
 }
 
index f3b0ea9..ede52f1 100644 (file)
@@ -12,6 +12,8 @@
 #include <CtxPopup.h>
 #include "FbBaseView.h"
 #include "FbMusicLayout.h"
+#include "../views/BaseView/Info.h"
+#include "common.h"
 
 
 struct SFbMusicLayout {
@@ -119,6 +121,7 @@ void CFbMusicLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
+       CInfo::SetGroupIndex(E_GRP_MUSIC);
        m->pFileGrid->Update(m->updateFlag);
        m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
@@ -131,7 +134,7 @@ bool CFbMusicLayout::Create(CLayoutMgr *mgr, void *data)
        ASSERT(mgr);
 
        Evas_Object* layout = NULL;
-       
+
        _CREATE_BEGIN{
                _CHECK(m = new SFbMusicLayout)
                _CHECK(m->pLayoutMgr = mgr)
@@ -141,10 +144,10 @@ bool CFbMusicLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(layout = elm_layout_add(m->eoBase))
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_MUSIC_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
-               _COMMAND{ 
+               _COMMAND{
                        m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
-                       elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
+                       elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout);
                }
                _CHECK(CBaseLayout::Create(layout))
 
@@ -187,7 +190,7 @@ void CFbMusicLayout::SetFocus(Eina_Bool flag)
 void CFbMusicLayout::Action(void)
 {
        ASSERT(m);
-       
+
        return m->pFileGrid->Action();
 }
 
index eb6729f..cfefd5a 100644 (file)
@@ -12,6 +12,8 @@
 #include <CtxPopup.h>
 #include "FbBaseView.h"
 #include "FbPhotoLayout.h"
+#include "../views/BaseView/Info.h"
+#include "common.h"
 
 
 struct SFbPhotoLayout {
@@ -119,6 +121,7 @@ void CFbPhotoLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
+       CInfo::SetGroupIndex(E_GRP_PHOTO);
        m->pFileGrid->Update(m->updateFlag);
        m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
@@ -141,10 +144,10 @@ bool CFbPhotoLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(layout = elm_layout_add(m->eoBase))
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_PHOTO_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
-               _COMMAND{ 
+               _COMMAND{
                        m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
-                       elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
+                       elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout);
                }
                _CHECK(CBaseLayout::Create(layout))
 
@@ -188,7 +191,7 @@ void CFbPhotoLayout::SetFocus(Eina_Bool flag)
 void CFbPhotoLayout::Action(void)
 {
        ASSERT(m);
-       
+
        return m->pFileGrid->Action();
 }
 
index 11932e8..69f4b8f 100644 (file)
@@ -12,6 +12,8 @@
 #include <CtxPopup.h>
 #include "FbBaseView.h"
 #include "FbVideoLayout.h"
+#include "../views/BaseView/Info.h"
+#include "common.h"
 
 
 struct SFbVideoLayout {
@@ -119,6 +121,7 @@ void CFbVideoLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
+       CInfo::SetGroupIndex(E_GRP_VIDEO);
        m->pFileGrid->Update(m->updateFlag);
        m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
@@ -141,10 +144,10 @@ bool CFbVideoLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(layout = elm_layout_add(m->eoBase))
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_VIDEO_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
-               _COMMAND{ 
+               _COMMAND{
                        m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
-                       elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
+                       elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout);
                }
                _CHECK(CBaseLayout::Create(layout))
 
@@ -188,7 +191,7 @@ void CFbVideoLayout::SetFocus(Eina_Bool flag)
 void CFbVideoLayout::Action(void)
 {
        ASSERT(m);
-       
+
        return m->pFileGrid->Action();
 }
 
index d55cd96..eaadef9 100644 (file)
@@ -141,17 +141,21 @@ struct SFbBaseView {
                        delete pHandlerGroup[a];
        }
 
-       class CHandlerBase : public CListenerMgr, public IKeyDownListener {
+       class CHandlerBase : public CListenerMgr, public IKeyDownListener, public IKeyUpListener{
                SFbBaseView *m;
 
        public:
-               CHandlerBase(SFbBaseView *ins) : IKeyDownListener(this) { m = ins; }
+               CHandlerBase(SFbBaseView *ins) : IKeyDownListener(this), IKeyUpListener(this) { m = ins; }
 
                virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
                        _DBG("m->curLayoutId = %d",m->curLayoutId);
                        if (!strcmp(ev->keyname, KEY_EXIT))
                                elm_exit();
-                       else if (!strcmp(ev->keyname, KEY_ENTER) || !strcmp(ev->keyname, KEY_ENTER_REMOTE)) {
+               }
+               virtual void OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev)
+               {
+                       _DBG("m->curLayoutId = %d",m->curLayoutId);
+                       if (!strcmp(ev->keyname, KEY_ENTER) || !strcmp(ev->keyname, KEY_ENTER_REMOTE)) {
                                if (elm_object_focus_get(m->eoSelectedBtnGroup)) {
                                        switch(m->curLayoutId)
                                        {
@@ -170,6 +174,7 @@ struct SFbBaseView {
                                        }
                                }
                        }
+
                }
        } *pHandlerBase;
 
@@ -335,16 +340,8 @@ Evas_Object *_add_button(Evas_Object *box)
 
 void CFbBaseView::UpdateEmptyFocusSequence(void)
 {
-       int i;
        _DBG("");
 
-       for (i = 0; i < TOTAL_GROUP_BTNS; i++)
-               elm_object_focus_next_object_set(m->eoBtnGroup[i], m->eoBtnSort, ELM_FOCUS_RIGHT);
-
-       elm_object_focus_next_object_set(m->eoBtnGroup[E_GRP_ALL], m->eoBtnSort,              ELM_FOCUS_UP);
-       elm_object_focus_next_object_set(m->eoBtnSort,              m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_DOWN);
-       elm_object_focus_next_object_set(m->eoBtnSource,               m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_DOWN);
-
        if (t_SelectedGroupButton() == m->eoBtnGroup[E_GRP_ALL]) {
                elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT,     _(NO_FILE_MESSAGE));
                elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, _(NO_FILE_MESSAGE_SUB));
@@ -395,23 +392,6 @@ void CFbBaseView::CbLinkApp(int type, int source_type, char *path)
 
 void CFbBaseView::UpdatedGrid(void)
 {
-#if 0 // It will be removed at soon.
-       int i;
-
-       for (i = 0; i < TOTAL_GROUP_BTNS; i++)
-               elm_object_focus_next_object_set(m->eoBtnGroup[i],
-               m->pFbAllLayout->Grid(), ELM_FOCUS_RIGHT);
-
-       elm_object_focus_next_object_set(m->eoBtnGroup[E_GRP_ALL],
-               m->eoBtnSort, ELM_FOCUS_UP);
-       elm_object_focus_next_object_set(m->eoBtnSort,
-               m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_LEFT);
-       elm_object_focus_next_object_set(m->eoBtnSort,
-               m->pFbAllLayout->Grid(), ELM_FOCUS_DOWN);
-       elm_object_focus_next_object_set(m->eoBtnSource,
-               m->pFbAllLayout->Grid(), ELM_FOCUS_DOWN);
-
-#endif
        elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT, "");
        elm_object_part_text_set(m->eoBase, FBR_PART_NO_CONTENT_SUB, "");
 }
@@ -492,7 +472,6 @@ void CFbBaseView::t_CreateLeftSession(void)
                ic = elm_image_add(m->eoBtnGroup[i]);
                if (!ic)
                        continue;
-               _DBG("");
 
                snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR,
                        btninfo[i].icon_path);
@@ -500,15 +479,15 @@ void CFbBaseView::t_CreateLeftSession(void)
                elm_object_part_content_set(m->eoBtnGroup[i],
                        FBR_PART_ELM_SWALLOWICON, ic);
        }
-       _DBG("");
 
        t_SetSelectedGroupButton(m->eoBtnGroup[E_GRP_ALL]);
-       _DBG("");
 
-       elm_object_signal_emit(m->eoBtnGroup[E_GRP_ALL],
-               FBR_SIGNAL_GROUP_SELECTED, "");
+       elm_object_signal_emit(m->eoBtnGroup[E_GRP_ALL], FBR_SIGNAL_GROUP_SELECTED, "");
        elm_object_focus_set(m->eoBtnGroup[E_GRP_ALL], EINA_TRUE);
        elm_object_part_content_set(m->eoBase, FBR_PART_GROUPBTN_BOX, box);
+
+       elm_object_focus_next_object_set(m->eoBtnGroup[E_GRP_ALL], m->eoBtnGroup[E_GRP_MUSIC], ELM_FOCUS_UP);
+       elm_object_focus_next_object_set(m->eoBtnGroup[E_GRP_MUSIC], m->eoBtnGroup[E_GRP_ALL], ELM_FOCUS_DOWN);
 }
 
 void CFbBaseView::t_CreateFullView(void)
@@ -521,15 +500,15 @@ void CFbBaseView::t_CreateFullView(void)
 
 void CFbBaseView::t_SetSelectedGroupButton(Evas_Object* obj)
 {
-       m->eoSelectedBtnGroup = obj;
-       int idx = -1;
 
-       int a;
-       for (a = 0; a < TOTAL_GROUP_BTNS; a++) {
+       for (int a = 0; a < TOTAL_GROUP_BTNS; a++) {
                if (m->eoBtnGroup[a] == obj)
-                       idx = a;
+               {
+                       m->eoSelectedBtnGroup = obj;
+                       CInfo::SetGroupIndex(a);
+                       break;
+               }
        }
-       CInfo::SetGroupIndex(idx);
 }
 
 Evas_Object* CFbBaseView::t_SelectedGroupButton(void)
index ae11473..191302b 100644 (file)
@@ -20,7 +20,7 @@
 #include <aul.h>
 #include "dbg.h"
 #include "i18n.h"
-#include "define.h" 
+#include "define.h"
 #include "common.h"
 
 #include <AppCommon.h>
@@ -222,19 +222,15 @@ void CFileGrid::t_CreateFileGrid(void)
        grid = elm_gengrid_add(m->eoBase);
        if (!grid)
                return;
-       evas_object_size_hint_weight_set(grid,
-               EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        elm_gengrid_align_set(grid, 0, 0);
        elm_object_part_content_set(m->eoBase, FBR_PART_MEDIA_GRID, grid);
 
-
        Connect(grid);
 
        evas_object_smart_callback_add(grid, FBR_SIGNAL_REALIZED,      sm_CbRealized, this);
        evas_object_smart_callback_add(grid, FBR_SIGNAL_UNREALIZED,    sm_CbUnrealized, this);
-       elm_gengrid_item_size_set(grid,
-               elm_config_scale_get() * GENGRID_ITEM_SIZE_W,
-               elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
+       elm_gengrid_item_size_set(grid, elm_config_scale_get() * GENGRID_ITEM_SIZE_W, elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
 
        m->eoGrid = grid;
 
@@ -246,7 +242,7 @@ void CFileGrid::t_CreateFileGrid(void)
                _ERR(" elm_genlist_item_class_new failed ");
                return;
        }
-       
+
        evas_object_show(grid);
 }
 
@@ -280,8 +276,16 @@ void CFileGrid::t_Empty(bool sort_flag)
 void CFileGrid::t_Update(char *fid, bool sort_flag)
 {
        _DBG("fid: %s, sort_flag: %d", fid, sort_flag);
-       t_Empty(sort_flag);
-       t_CreateFileGrid();
+
+       elm_gengrid_clear(m->eoGrid);
+       if (sort_flag == false && m->elFile != NULL) {
+               eina_list_free(m->elFile);
+               m->elFile = NULL;
+       }
+
+       m->elItemInfo = NULL;
+       if (m->callback.cbUpdateEmptyFocusSequence)
+               m->callback.cbUpdateEmptyFocusSequence(m->callback.cookie);
 
        if (sort_flag == false) {
                if (fid)
@@ -317,8 +321,6 @@ void CFileGrid::t_Update(char *fid, bool sort_flag)
                        break;
        }
 
-       //ASSERT(m->elFile);
-
        m->elFile = CSortMgr::Sort(m->elFile, sortType);
        t_Fill();
 
@@ -344,7 +346,6 @@ void CFileGrid::t_Fill(void)
        ts = eina_list_count(m->elFile);
        _DBG("count: %d", ts);
        if (ts == 0) {
-               t_Empty(false);
                return;
        }
 
@@ -352,7 +353,7 @@ void CFileGrid::t_Fill(void)
                pInfo = (CExtNameInfo*)obj;
                pItemInfo = (SItemInfo *)calloc(1, sizeof(SItemInfo));
                if (!pItemInfo) {
-                       t_Empty(false);
+                       _DBG("Fail to allocate memory!!!!!!");
                        return;
                }
 
@@ -376,16 +377,18 @@ bool CFileGrid::Create(Evas_Object* win, Evas_Object *base, const SCallback *cb)
                _CHECK(m->pMediadata = new CMediadata )
                _CHECK(m->pMediadata->Create())
 
-               _WHEN_SUCCESS{}
+               _WHEN_SUCCESS{
+                       m->eoWin    = win;
+                       m->eoBase   = base;
+                       m->callback = *cb;
+                       t_CreateFileGrid();
+               }
 
                _CHECK_FAIL{ m->pMediadata->Destroy(); }
                _CHECK_FAIL{ delete m->pMediadata; }
                _CHECK_FAIL{ delete m; m = NULL; }
        } _CREATE_END_AND_CATCH{ return false; }
 
-       m->eoWin    = win;
-       m->eoBase   = base;
-       m->callback = *cb;
 
        return true;
 }
@@ -439,7 +442,7 @@ Evas_Object* CFileGrid::Grid(void)
 void CFileGrid::OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev) {
        Elm_Object_Item *it;
        SItemInfo *pItemInfo;
-       
+
        if(ev->keyname)
                _DBG("%s", ev->keyname);