From: aman.jeph Date: Mon, 6 Jul 2020 12:13:49 +0000 (+0530) Subject: Implemented share view according to new guideline X-Git-Tag: submit/tizen/20200708.104956^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61fc2fb82fe80a8c3b0461e15e5f4deabad07de6;p=profile%2Fiot%2Fapps%2Fnative%2Fvideo-player.git Implemented share view according to new guideline Change-Id: I164a8559c7af2be15ef578f6dd478e51bcf84e7e Signed-off-by: aman.jeph --- diff --git a/include/view/mp-video-list-view-folder.h b/include/view/mp-video-list-view-folder.h index f7db02b..3309bc6 100755 --- a/include/view/mp-video-list-view-folder.h +++ b/include/view/mp-video-list-view-folder.h @@ -20,9 +20,6 @@ #include "mp-video-list-view-common.h" #include "mp-video-type-define.h" -void mp_folder_view_add_folder_view_to_naviframe(); -void mp_folder_view_folder_list_set(void *pMainHandle, void *pMainViewWidget, - MpListUpdateType eUpdateType, UpdateListItemsCbFunc pUpdateVideoListUserCb); void mp_folder_view_destroy(void); void mp_folder_view_arrange_folder_list(void *pMainViewHandle, void *pMainViewWidget, @@ -31,4 +28,9 @@ void mp_folder_view_arrange_folder_list(void *pMainViewHandle, pUpdateVideoListUserCb); void mp_folder_view_update_video_items(void); void mp_folder_view_change_language(void); +void mp_folder_view_view_set(void *pMainViewHandle, void *pMainViewWidget, + MpListUpdateType eUpdateType, + UpdateListItemsCbFunc pUpdateVideoListUserCb); + + #endif diff --git a/include/view/mp-video-list-view-item-of-folder.h b/include/view/mp-video-list-view-item-of-folder.h index c332a8a..4e1de34 100755 --- a/include/view/mp-video-list-view-item-of-folder.h +++ b/include/view/mp-video-list-view-item-of-folder.h @@ -27,5 +27,6 @@ void mp_folder_item_view_check_more_button_of_toolbar(void); void mp_folder_item_view_change_language(void); void mp_folder_item_view_update_played_item(void); void mp_folder_item_view_update_video_list(MpListUpdateType eUpdateType); +void mp_folder_item_view_remove(); #endif diff --git a/src/view/mp-video-list-remove-view.c b/src/view/mp-video-list-remove-view.c index 75b8398..e77e282 100755 --- a/src/view/mp-video-list-remove-view.c +++ b/src/view/mp-video-list-remove-view.c @@ -207,6 +207,12 @@ void mp_remove_view_destroy(void) { VideoLogInfo(""); + if(g_pListRemoveViewHandle) + { + mp_util_db_set_update_fun(g_pListRemoveViewHandle->euLev, NULL); + mp_util_db_set_backup_fun(g_pListRemoveViewHandle->euLev, NULL); + } + if (g_pListRemoveViewWidget) { MP_DEL_OBJ(g_pListRemoveViewWidget->pTitleContentLayout); MP_DEL_OBJ(g_pListRemoveViewWidget->pSelectallbtn); diff --git a/src/view/mp-video-list-share-via-view.c b/src/view/mp-video-list-share-via-view.c index ce59923..aea84f5 100755 --- a/src/view/mp-video-list-share-via-view.c +++ b/src/view/mp-video-list-share-via-view.c @@ -34,21 +34,31 @@ #include "mp-video-util-db-controller.h" #include "mp-rotate-ctrl.h" #include "videos-view-mgr.h" +#include "mp-video-list-view-main.h" #define VIDEO_SELECTED_INFO_TIMER 4.0 #define FIRST_SHARE_ITEM_OFFSET 1 #define VIDEO_SHARE_ITEM_MAX 30 +#define GENGRID_ITEM_WIDTH 304 // Width is ICON(280) + LEFT_PADDING(12) RIGHT_PADDING(12) +#define GENGRID_ITEM_HEIGHT 256 //Height is ICON(160) + TEXT_PART(56) + Bottom_PADDING(40) + +typedef struct _stGengridItemData{ + Elm_Object_Item *item; + Evas_Object *icon; + Evas_Object *progress_layout; + Evas_Object *checkbox; + int itemIndex; +}stGengridItemData; + + typedef struct { void *pNaviFrameHandle; void *pNaviFrameItem; /* used for list view ,thumbnail view */ void *pObjVideosList; - Elm_Genlist_Item_Class *pGenListItc; - Elm_Genlist_Item_Class *pGenListLandscapeItc; - Elm_Gengrid_Item_Class *pGenGridItc_1; - Elm_Gengrid_Item_Class *pGenGridItc_2; + Elm_Gengrid_Item_Class *pShareViewGIC; bool *pCheckedItemsEditList; /* save selected video id */ @@ -68,13 +78,10 @@ typedef struct { } st_VideoListShareViaViewHandle; typedef struct { - Evas_Object *pVideoListBox; - Evas_Object *pChareViaViewBaselayout; + Evas_Object *pShareViaViewBaselayout; Evas_Object *pSelectallbtn; Evas_Object *pSelAllLayout; - Evas_Object *pSavebtn; - Evas_Object *pCancelbtn; - + Evas_Object *pTitleContentLayout; } st_VideoListShareViaViewWidget; static st_VideoListShareViaViewHandle *g_pShareViaHandle = NULL; @@ -88,13 +95,7 @@ static bool g_bSharePanelLaunched = FALSE; int mp_share_view_get_sort_type(void); bool __mp_share_view_arrange_video_list(void *pObjVideosList, bool bNeedSvc); -void mp_share_view_naviframe_transition_effect_cb(void *pUserData, - Evas_Object * pObject, - void *pEventInfo); -void mp_share_view_change_title_info(void); -static void __mp_share_view_base_layout_del_cb(void *pUserData, Evas * e, - Evas_Object * pObject, - void *pEventInfo); +void mp_share_view_change_done_button_state(void); static void __mp_share_via_view_rotate_cb(void *data, Evas_Object * obj, void *event_info); @@ -137,60 +138,20 @@ void mp_share_view_update_all_check_box(void) return; } - Evas_Object *check_box = NULL; - Evas_Object *check_box_layout = NULL; - Elm_Object_Item *currentItem = NULL; Elm_Object_Item *currentItemGengrid = NULL; int nVideoItemIndex = 0; -#ifdef VS_FEATURE_THUMBNAIL_VIEW - if (g_pShareViaHandle->bThumbnailView) { - currentItem = - elm_genlist_first_item_get(g_pShareViaHandle->pObjVideosList); - nVideoItemIndex = 0; - while (currentItem && (nVideoItemIndex < nVideoListSize)) { - Evas_Object *gengrid = - elm_object_item_part_content_get(currentItem, "elm.icon"); - currentItemGengrid = elm_gengrid_first_item_get(gengrid); - while (currentItemGengrid - && (nVideoItemIndex < nVideoListSize)) { - Evas_Object *check_box = - elm_object_item_part_content_get(currentItemGengrid, - "elm.swallow.end"); - if (check_box) { - elm_check_state_set(check_box, - g_pShareViaHandle-> - pCheckedItemsEditList - [nVideoItemIndex]); - } - currentItemGengrid = - elm_gengrid_item_next_get(currentItemGengrid); - nVideoItemIndex++; - } - currentItem = elm_genlist_item_next_get(currentItem); - } - - } else -#endif - { - currentItem = - elm_genlist_first_item_get(g_pShareViaHandle->pObjVideosList); - nVideoItemIndex = 0; - while (currentItem && (nVideoItemIndex < nVideoListSize)) { - check_box_layout = - elm_object_item_part_content_get(currentItem, - "elm.icon.2"); - check_box = - elm_object_part_content_get(check_box_layout, - "elm.swallow.content"); + nVideoItemIndex = 0; + currentItemGengrid = elm_gengrid_first_item_get((Evas_Object*)g_pShareViaHandle->pObjVideosList); + while (currentItemGengrid && (nVideoItemIndex < nVideoListSize)) { + Evas_Object *check_box = elm_object_item_part_content_get(currentItemGengrid, "elm.check"); if (check_box) { - elm_check_state_set(check_box, - g_pShareViaHandle-> - pCheckedItemsEditList - [nVideoItemIndex]); + VideoLogInfo("Select All : %d and Current Check: %d", + g_pShareViaHandle->bSelectallCheckBoxState, + g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex]); + elm_check_state_set(check_box, g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex]); } - currentItem = elm_genlist_item_next_get(currentItem); + currentItemGengrid = elm_gengrid_item_next_get(currentItemGengrid); nVideoItemIndex++; - } } } @@ -200,114 +161,36 @@ void mp_share_view_update_all_check_box(void) void mp_share_view_destroy(void) { VideoLogInfo(""); + if(g_pShareViaHandle) + { + mp_util_db_set_update_fun(g_pShareViaHandle->euLev, NULL); + mp_util_db_set_backup_fun(g_pShareViaHandle->euLev, NULL); - if (g_pShareViaHandle) { - evas_object_smart_callback_del(g_pShareViaHandle->pNaviFrameHandle, - "transition,finished", - mp_share_view_naviframe_transition_effect_cb); - __mp_share_view_free_selected_list(); - + elm_gengrid_clear((Evas_Object*)g_pShareViaHandle->pObjVideosList); MP_DEL_OBJ(g_pShareViaHandle->pObjVideosList); - MP_DEL_ITC(g_pShareViaHandle->pGenListItc); - MP_DEL_ITC(g_pShareViaHandle->pGenListLandscapeItc); - MP_DEL_GRID_ITC(g_pShareViaHandle->pGenGridItc_1); - MP_DEL_GRID_ITC(g_pShareViaHandle->pGenGridItc_2); - MP_FREE_STRING(g_pShareViaHandle->pCheckedItemsEditList); - MP_FREE_STRING(g_pShareViaHandle->pFolderPath); - evas_object_smart_callback_del((Evas_Object *) - mp_util_get_main_window_handle(), - "wm,rotation,changed", - __mp_share_via_view_rotate_cb); - - MP_FREE_STRING(g_pShareViaHandle); } if (g_pShareViaWidget) { MP_DEL_OBJ(g_pShareViaWidget->pSelectallbtn); MP_DEL_OBJ(g_pShareViaWidget->pSelAllLayout); - MP_DEL_OBJ(g_pShareViaWidget->pVideoListBox); - MP_DEL_OBJ(g_pShareViaWidget->pChareViaViewBaselayout); - MP_DEL_OBJ(g_pShareViaWidget->pSavebtn); - MP_DEL_OBJ(g_pShareViaWidget->pCancelbtn); + MP_DEL_OBJ(g_pShareViaWidget->pShareViaViewBaselayout); + MP_DEL_OBJ(g_pShareViaWidget->pTitleContentLayout); MP_FREE_STRING(g_pShareViaWidget); } -} - -/** - * - */ -static void __mp_share_view_reset(void) -{ - VideoLogInfo(""); if (g_pShareViaHandle) { - mp_util_db_set_update_fun(g_pShareViaHandle->euLev, NULL); - mp_util_db_set_backup_fun(g_pShareViaHandle->euLev, NULL); - evas_object_smart_callback_del(g_pShareViaHandle->pNaviFrameHandle, - "transition,finished", - mp_share_view_naviframe_transition_effect_cb); - evas_object_smart_callback_del((Evas_Object *) - mp_util_get_main_window_handle(), - "wm,rotation,changed", - __mp_share_via_view_rotate_cb); __mp_share_view_free_selected_list(); - g_pShareViaHandle->pObjVideosList = NULL; - - MP_DEL_ITC(g_pShareViaHandle->pGenListItc); - MP_DEL_ITC(g_pShareViaHandle->pGenListLandscapeItc); - MP_DEL_GRID_ITC(g_pShareViaHandle->pGenGridItc_1); - MP_DEL_GRID_ITC(g_pShareViaHandle->pGenGridItc_2); MP_FREE_STRING(g_pShareViaHandle->pCheckedItemsEditList); MP_FREE_STRING(g_pShareViaHandle->pFolderPath); + evas_object_smart_callback_del((Evas_Object *)mp_util_get_main_window_handle(), + "wm,rotation,changed", + __mp_share_via_view_rotate_cb); MP_FREE_STRING(g_pShareViaHandle); } - - if (g_pShareViaWidget) { - MP_DEL_OBJ(g_pShareViaWidget->pSelectallbtn); - g_pShareViaWidget->pVideoListBox = NULL; - g_pShareViaWidget->pSelAllLayout = NULL; - - g_pShareViaWidget->pChareViaViewBaselayout = NULL; - MP_DEL_OBJ(g_pShareViaWidget->pSavebtn); - MP_DEL_OBJ(g_pShareViaWidget->pCancelbtn); - - MP_FREE_STRING(g_pShareViaWidget); - } -} - -/** - * - */ -void mp_share_view_reset_value(void) -{ - if (!g_pShareViaHandle) { - VideoLogError("[ERR] g_pShareViaHandle is not existed."); - return; - } - VideoLogInfo(""); - - g_pShareViaHandle->pNaviFrameHandle = NULL; - g_pShareViaHandle->pNaviFrameItem = NULL; - g_pShareViaHandle->pChangeViewUserCbFunc = NULL; - - g_pShareViaHandle->bSelectallCheckBoxState = FALSE; - g_pShareViaHandle->nSelectCounterForEditList = 0; - g_pShareViaHandle->nSortType = MP_MEDIA_SORT_BY_RECENTLY_VIEWED; - - if (g_pShareViaHandle->pNaviFrameItem) { - elm_object_item_part_content_unset(g_pShareViaHandle-> - pNaviFrameItem, - "toolbar_more_btn"); - elm_object_item_part_content_unset(g_pShareViaHandle-> - pNaviFrameItem, "toolbar"); - elm_object_item_part_content_unset(g_pShareViaHandle-> - pNaviFrameItem, - "toolbar_button2"); - } } /** @@ -363,9 +246,7 @@ static void __vp_share_view_create_launch_share_panel(void) **) (&g_pShareList[1]), g_nShareListSize - 1); if (nErr != APP_CONTROL_ERROR_NONE) { - VideoLogWarning - ("[WARNING] app_control_add_extra_data_array() [0x%x]", - nErr); + VideoLogWarning("[WARNING] app_control_add_extra_data_array() [0x%x]", nErr); goto ERROR_EXCEPTION; } } @@ -530,21 +411,16 @@ void mp_share_view_launching_share_panel(void) if (szFileUrl) { if (nTotalAppendedItem < nExtraDataSize) { - szFileUrlArrayForServiceExtraData - [nTotalAppendedItem] = szFileUrl; - VideoSecureLogInfo - ("Appending share item : %s, Total Appended item : %d", - (const char **) - szFileUrlArrayForServiceExtraData - [nTotalAppendedItem], nTotalAppendedItem); + szFileUrlArrayForServiceExtraData[nTotalAppendedItem] = szFileUrl; + VideoSecureLogInfo("Appending share item : %s, Total Appended item : %d", + (const char **)szFileUrlArrayForServiceExtraData[nTotalAppendedItem], + nTotalAppendedItem); nTotalAppendedItem++; - g_pShareList[g_nShareListSize++] = - strdup(szFileUrl); + g_pShareList[g_nShareListSize++] = strdup(szFileUrl); continue; } else { - VideoLogWarning - ("[WARNING] OVERFLOW ALOOCATED MEMORY SIZE."); + VideoLogWarning("[WARNING] OVERFLOW ALOOCATED MEMORY SIZE."); free(szFileUrl); } } else { @@ -645,6 +521,8 @@ static void __mp_share_view_trans_finished_cb(void *pUserData, mp_widget_ctrl_enable_navi_handle_focus(obj); + mp_share_view_destroy(); + evas_object_smart_callback_del(obj, "transition,finished", __mp_share_view_trans_finished_cb); } @@ -679,27 +557,24 @@ static Eina_Bool mp_share_view_back_btn_cb(void *pUserData, /** * */ -void mp_share_view_change_title_info(void) +void mp_share_view_change_done_button_state(void) { + if(g_pShareViaHandle == NULL || g_pShareViaWidget == NULL || g_pShareViaWidget->pTitleContentLayout == NULL) + { + VideoLogError("g_pShareViaHandle: %p, g_pShareViaWidget: %p, g_pShareViaWidget->pTitleContentLayout: %p may be invalid", + g_pShareViaHandle, g_pShareViaWidget, g_pShareViaWidget->pTitleContentLayout); + return; + } + VideoLogInfo("nNumOfSelectdCount : %d", g_pShareViaHandle->nSelectCounterForEditList); if (g_pShareViaHandle->nSelectCounterForEditList > 0) { - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, EINA_FALSE); + elm_object_signal_emit(g_pShareViaWidget->pTitleContentLayout, "done_button,state,enable", "vp"); } else { VideoLogInfo("Unactivate delete tab."); - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, EINA_TRUE); - } - - char *szCheckingTotalItem = - g_strdup_printf(VIDEOS_SELECTVIEW_HEADER_PD_SELECTED, - g_pShareViaHandle->nSelectCounterForEditList); - elm_object_item_domain_translatable_part_text_set(g_pShareViaHandle-> - pNaviFrameItem, - "elm.text.title", - VIDEOS_STRING, - szCheckingTotalItem); - MP_FREE_STRING(szCheckingTotalItem); + elm_object_signal_emit(g_pShareViaWidget->pTitleContentLayout, "done_button,state,disable", "vp"); + } } /** @@ -749,38 +624,20 @@ static void __mp_share_view_select_all_change_check_box_cb(void *pUserData, } else { g_pShareViaHandle->bSelectallCheckBoxState = FALSE; g_pShareViaHandle->nSelectCounterForEditList = 0; - - VideoLogInfo("Unactivate delete button."); - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, EINA_TRUE); } - elm_check_state_set(g_pShareViaWidget->pSelectallbtn, - g_pShareViaHandle->bSelectallCheckBoxState); + //elm_check_state_set(g_pShareViaWidget->pSelectallbtn, g_pShareViaHandle->bSelectallCheckBoxState); - mp_share_view_change_title_info(); + mp_share_view_change_done_button_state(); for (nCounter = 0; nCounter < nVideoListSize; nCounter++) { - g_pShareViaHandle->pCheckedItemsEditList[nCounter] = - g_pShareViaHandle->bSelectallCheckBoxState; + g_pShareViaHandle->pCheckedItemsEditList[nCounter] = g_pShareViaHandle->bSelectallCheckBoxState; } mp_share_view_update_all_check_box(); } -/** - * - */ -void mp_share_view_delete_select_all(void) -{ - VideoLogInfo(""); - - g_pShareViaHandle->bSelectallCheckBoxState = FALSE; - g_pShareViaHandle->nSelectCounterForEditList = 0; - - mp_share_view_change_title_info(); -} - /* Check box callback */ @@ -834,101 +691,11 @@ void mp_share_view_change_check_box_state_cb(void *pUserData, } g_pShareViaHandle->nSelectCounterForEditList--; - if (g_pShareViaHandle->nSelectCounterForEditList < 1) { - VideoLogInfo("Unactivate delete button."); - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, - EINA_TRUE); - } } elm_check_state_set(g_pShareViaWidget->pSelectallbtn, g_pShareViaHandle->bSelectallCheckBoxState); - mp_share_view_change_title_info(); -} - -/* -Genlist callback -*/ -/** - * - * @param pUserData - * @param pObject - * @param pEventInfo - */ -void mp_share_view_naviframe_transition_effect_cb(void *pUserData, - Evas_Object * pObject, - void *pEventInfo) -{ - if (!g_pShareViaHandle) { - VideoLogError("[ERR] No exist g_pShareViaHandle."); - return; - } - - VideoLogInfo(""); - - Evas_Object *pTmpContents = NULL; - Elm_Object_Item *pTmpItem = NULL; - - if (!g_pShareViaHandle->pNaviFrameHandle) { - VideoLogInfo("[ERR] No exist naviframe handle."); - return; - } - - pTmpItem = - elm_naviframe_top_item_get(g_pShareViaHandle->pNaviFrameHandle); - pTmpContents = elm_object_item_content_get(pTmpItem); - if (pTmpContents) { - if (pTmpContents == g_pShareViaWidget->pVideoListBox) { - } else { - VideoLogInfo - ("It's not pListShareViaViewTabbarLayout in top screen."); - } - } else { - VideoLogError("[ERR] No exist naviframe top item."); - } -} - -/** - * - */ -void mp_share_view_double_tap_cb(void) -{ - if (!g_pShareViaHandle->pObjVideosList) { - VideoLogError("pObjVideosList is not exist."); - return; - } - - VideoLogInfo(""); - - elm_genlist_item_bring_in(elm_genlist_first_item_get - (g_pShareViaHandle->pObjVideosList), - ELM_GENLIST_ITEM_SCROLLTO_TOP); -} - -/** - * - * @param nVideoItemIndex - * @return - */ -char *mp_share_view_get_duration_time(int nVideoItemIndex) -{ - VideoLogInfo(""); - - char szTmpStr[STR_LEN_MAX] = { 0, }; - char szTmpStrDurationTime[STR_LEN_MAX] = { 0, }; - char szTmpStrLastPlayedPos[STR_LEN_MAX] = { 0, }; - - unsigned int nVideoInfoDuration = - mp_util_svc_get_video_duration_time(nVideoItemIndex); - unsigned int nVideoInfoLastTime = 0; - - mp_util_convert_time(nVideoInfoDuration, szTmpStrDurationTime, FALSE); - mp_util_convert_time(nVideoInfoLastTime, szTmpStrLastPlayedPos, TRUE); - - snprintf(szTmpStr, STR_LEN_MAX, "%s/%s", szTmpStrLastPlayedPos, - szTmpStrDurationTime); - - return strdup(szTmpStr); + mp_share_view_change_done_button_state(); } /** @@ -951,69 +718,50 @@ static void __mp_share_view_select_grid_item_cb(void *pUserData, int nVideoItemIndex = 0; Elm_Object_Item *pItem = (Elm_Object_Item *) pEventInfo; - Elm_Object_Item *pSelectedItem = - elm_gengrid_selected_item_get(pObject); + stGengridItemData *item_data = (stGengridItemData*)pUserData; + nVideoItemIndex = item_data->itemIndex; if (pItem) { - nVideoItemIndex = (int) elm_object_item_data_get(pItem); VideoLogInfo("nVideoItemIndex : %d", nVideoItemIndex); - int nVideoListSize = - mp_util_svc_get_number_of_video_item_by_type(); + int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); - VideoLogInfo("BEFORE : nSelectCounterForEditList : %d", - g_pShareViaHandle->nSelectCounterForEditList); + VideoLogInfo("BEFORE : nSelectCounterForEditList : %d", g_pShareViaHandle->nSelectCounterForEditList); if (g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex]) { - g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex] = - FALSE; - if (nVideoListSize == - g_pShareViaHandle->nSelectCounterForEditList) { - VideoLogInfo - ("All check box of edit list state are not true."); + g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex] = FALSE; + if (nVideoListSize == g_pShareViaHandle->nSelectCounterForEditList) { + VideoLogInfo("All check box of edit list state are not true."); g_pShareViaHandle->bSelectallCheckBoxState = FALSE; } - g_pShareViaHandle->nSelectCounterForEditList--; - if (g_pShareViaHandle->nSelectCounterForEditList < 1) { - VideoLogInfo("Unactivate delete button."); - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, - EINA_TRUE); - } } else { - VideoLogInfo("selected count = %d", - g_pShareViaHandle->nSelectCounterForEditList); - if (g_pShareViaHandle->nSelectCounterForEditList > - (VIDEO_SHARE_ITEM_MAX - 1)) { - char *pStrWarning = - g_strdup_printf(VIDEOS_NOTIPOP_MSG_SHARE_ITEM_MAX, - VIDEO_SHARE_ITEM_MAX); + VideoLogInfo("selected count = %d", g_pShareViaHandle->nSelectCounterForEditList); + if (g_pShareViaHandle->nSelectCounterForEditList > (VIDEO_SHARE_ITEM_MAX - 1)) { + char *pStrWarning = g_strdup_printf(VIDEOS_NOTIPOP_MSG_SHARE_ITEM_MAX, VIDEO_SHARE_ITEM_MAX); mp_util_ticker_toast_popup(pStrWarning, false, false); MP_FREE_STRING(pStrWarning); - if (pSelectedItem) { - elm_genlist_item_selected_set(pSelectedItem, - EINA_FALSE); - elm_gengrid_item_update(pSelectedItem); + if (pItem) { + elm_gengrid_item_selected_set(pItem, EINA_FALSE); } return; } - g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex] = - TRUE; + g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex] = TRUE; g_pShareViaHandle->nSelectCounterForEditList++; - if (nVideoListSize == - g_pShareViaHandle->nSelectCounterForEditList) { + if (nVideoListSize == g_pShareViaHandle->nSelectCounterForEditList) { VideoLogInfo("All check box of edit list state are true."); g_pShareViaHandle->bSelectallCheckBoxState = TRUE; } } - VideoLogInfo("AFTER : nSelectCounterForEditList : %d", - g_pShareViaHandle->nSelectCounterForEditList); - elm_check_state_set(g_pShareViaWidget->pSelectallbtn, - g_pShareViaHandle->bSelectallCheckBoxState); + // + elm_check_state_set(item_data->checkbox, g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex]); - mp_share_view_change_title_info(); - elm_gengrid_item_update(pItem); + VideoLogInfo("AFTER : nSelectCounterForEditList : %d", g_pShareViaHandle->nSelectCounterForEditList); + elm_check_state_set(g_pShareViaWidget->pSelectallbtn, g_pShareViaHandle->bSelectallCheckBoxState); + + mp_share_view_change_done_button_state(); + elm_gengrid_item_selected_set(pItem, EINA_FALSE); } else { VideoLogInfo("[ERR]Error item number."); } @@ -1063,11 +811,6 @@ void mp_share_view_select_video_item_cb(void *pUserData, } g_pShareViaHandle->nSelectCounterForEditList--; - if (g_pShareViaHandle->nSelectCounterForEditList < 1) { - VideoLogInfo("Unactivate delete button."); - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, - EINA_TRUE); - } } else { VideoLogInfo("Unactivate delete button. = %d", g_pShareViaHandle->nSelectCounterForEditList); @@ -1098,7 +841,7 @@ void mp_share_view_select_video_item_cb(void *pUserData, g_pShareViaHandle->nSelectCounterForEditList); elm_check_state_set(g_pShareViaWidget->pSelectallbtn, g_pShareViaHandle->bSelectallCheckBoxState); - mp_share_view_change_title_info(); + mp_share_view_change_done_button_state(); Evas_Object *check_box_layout = elm_object_item_part_content_get(pItem, "elm.icon.2"); Evas_Object *check_box = @@ -1127,16 +870,17 @@ void mp_share_view_select_video_item_cb(void *pUserData, * @param pPart * @return */ -static char *__mp_share_view_get_label_of_grid_item_cb(const void +static char *__mp_share_view_get_label_of_grid_item_cb(void *pUserData, Evas_Object * pObject, const char *pPart) { - int nVideoItemIndex = (int) pUserData; + stGengridItemData *item_data = (stGengridItemData*)pUserData; + int nVideoItemIndex = item_data->itemIndex; if (!strcmp(pPart, "elm.text")) { - char *szTitle = NULL; + char *szTitle; szTitle = mp_util_svc_get_video_title(nVideoItemIndex); char *szTitleUtf8 = elm_entry_utf8_to_markup(szTitle); @@ -1146,43 +890,13 @@ static char *__mp_share_view_get_label_of_grid_item_cb(const void } return szTitleUtf8; - } else if (!strcmp(pPart, "elm.text.2")) { + } else if (!strcmp(pPart, "elm.sub.text")) { return mp_util_svc_get_duration_str_time(nVideoItemIndex); } - return NULL; -} -#endif - -/** - * - * @param pUserData - * @param pObject - * @param pPart - * @return - */ -char *mp_share_view_get_label_of_video_item_cb(const void *pUserData, - Evas_Object * pObject, - const char *pPart) -{ - int nVideoItemIndex = (int) pUserData; - - if (!strcmp(pPart, "elm.text.main.left.top")) { - char *szTitle = NULL; - szTitle = mp_util_svc_get_video_title(nVideoItemIndex); - char *szTitleUtf8 = elm_entry_utf8_to_markup(szTitle); - if (szTitle) { - free(szTitle); - szTitle = NULL; - } - - return szTitleUtf8; - } else if (!strcmp(pPart, "elm.text.sub.left.bottom")) { - return mp_util_svc_get_duration_str_time(nVideoItemIndex); - } - return NULL; } +#endif #ifdef VS_FEATURE_THUMBNAIL_VIEW /** @@ -1192,162 +906,69 @@ char *mp_share_view_get_label_of_video_item_cb(const void *pUserData, * @param pPart * @return */ -static Evas_Object *__mp_share_view_get_grid_icon_cb(const void *pUserData, +static Evas_Object *__mp_share_view_get_grid_icon_cb(void *pUserData, Evas_Object * pObject, const char *pPart) { - int nVideoItemIndex = (int) pUserData; - char edj_path[1024] = { 0 }; + stGengridItemData *item_data = (void*)pUserData; + int nVideoItemIndex = item_data->itemIndex; + char edj_path[1024] = { 0 }; char *path = app_get_resource_path(); - snprintf(edj_path, 1024, "%s%s/%s", path, "edje", - VIDEO_PLAYER_IMAGE_NAME_EDJ); + snprintf(edj_path, 1024, "%s%s/%s", path, "edje", VIDEO_CUSTOM_THEME); free(path); - if (!strcmp(pPart, "elm.swallow.icon")) { - char *pThumbIconUri = - mp_util_svc_get_video_thumbnail(nVideoItemIndex); - Evas_Object *pBg = NULL; - - if (!pThumbIconUri || !vp_file_exists(pThumbIconUri)) { - pBg = elm_image_add(pObject); - MP_FREE_STRING(pThumbIconUri); - evas_object_size_hint_aspect_set(pBg, EVAS_ASPECT_CONTROL_BOTH, - 1, 1); - elm_image_file_set(pBg, pThumbIconUri, NULL); - } else { - pBg = - mp_util_create_preload_image(pObject, pThumbIconUri, - GRID_VIDEO_ICON_WIDTH); - } - - MP_FREE_STRING(pThumbIconUri); - return pBg; - } else if (!strcmp(pPart, "elm.progressbar.icon")) { - return NULL; - } else if (!strcmp(pPart, "elm.lock.icon")) { - char *pVideoFile = mp_util_svc_get_video_url(nVideoItemIndex); - bool bRet = mp_util_check_video_personal_status((const char *) - pVideoFile); - MP_FREE_STRING(pVideoFile); - if (bRet) { - Evas_Object *pLockIcon = elm_image_add(pObject); - elm_image_file_set(pLockIcon, - edj_path, - VIDEO_LIST_VIEW_ICON_PERSONAL_LOCK); - evas_object_size_hint_align_set(pLockIcon, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - evas_object_size_hint_weight_set(pLockIcon, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_show(pLockIcon); - return pLockIcon; - } else { - return NULL; - } - } else if (!strcmp(pPart, "elm.dropbox.icon")) { - bool bRet = mp_util_svc_is_cloud_storage(nVideoItemIndex); - if (bRet) { - Evas_Object *pDropboxIcon = elm_image_add(pObject); - elm_image_file_set(pDropboxIcon, - edj_path, VIDEO_LIST_VIEW_ICON_DROPBOX); - evas_object_size_hint_align_set(pDropboxIcon, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - evas_object_size_hint_weight_set(pDropboxIcon, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_show(pDropboxIcon); - return pDropboxIcon; - } else { + if (!strcmp(pPart, "elm.icon")) { + char *pThumbIconUri = mp_util_svc_get_video_thumbnail(nVideoItemIndex); + if(pThumbIconUri == NULL) + { + VideoLogError("thumbnail url is invalid"); return NULL; } - } else if (!strcmp(pPart, "elm.swallow.end")) { - Evas_Object *pCheckBox = elm_check_add(pObject); - elm_object_style_set(pCheckBox, "default"); - elm_check_state_pointer_set(pCheckBox, - (Eina_Bool *) & (g_pShareViaHandle-> - pCheckedItemsEditList - [nVideoItemIndex])); + Evas_Object *img = elm_image_add(pObject); + elm_image_file_set(img, pThumbIconUri, NULL); + elm_image_aspect_fixed_set(img, EINA_FALSE); + elm_image_preload_disabled_set(img, EINA_FALSE); + evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(pCheckBox); + item_data->icon = img; + free(pThumbIconUri); - return pCheckBox; + return img; } - return NULL; -} -#endif - -/** - * - * @param pUserData - * @param pObject - * @param pPart - * @return - */ -Evas_Object *mp_share_view_get_icon_of_video_item_cb(const void *pUserData, - Evas_Object * pObject, - const char *pPart) -{ - int nVideoItemIndex = (int) pUserData; - Evas_Object *pLayout = NULL; - - if (!strcmp(pPart, "elm.icon.1")) { - pLayout = elm_layout_add(pObject); - char *pThumbIconUri = - mp_util_svc_get_video_thumbnail(nVideoItemIndex); - Evas_Object *pBg = NULL; - - if (!pThumbIconUri || !vp_file_exists(pThumbIconUri)) { - MP_FREE_STRING(pThumbIconUri); - } - - pBg = mp_util_create_preload_image(pLayout, pThumbIconUri, - VIDEO_ICON_WIDTH); - if (pBg) - evas_object_show(pBg); - char edj_path[1024] = { 0 }; - - char *path = app_get_resource_path(); - snprintf(edj_path, 1024, "%s%s/%s", path, "edje", - VIDEO_CUSTOM_THEME); - free(path); - elm_layout_file_set(pLayout, edj_path, - "listview.thumbnail.layout"); - elm_layout_content_set(pLayout, "elm.thumbnail.icon", pBg); - - MP_FREE_STRING(pThumbIconUri); - - if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) { - VideoLogWarning("Create sub icon is failed.", nVideoItemIndex); - } - - return pLayout; - } else if (!strcmp(pPart, "elm.icon.2")) { - pLayout = elm_layout_add(pObject); - Evas_Object *pCheckBox = elm_check_add(pLayout); - - elm_layout_theme_set(pLayout, "layout", "list/C/type.2", - "default"); - evas_object_propagate_events_set(pCheckBox, EINA_FALSE); - evas_object_smart_callback_add(pCheckBox, "changed", - mp_share_view_change_check_box_state_cb, - pUserData); - elm_check_state_pointer_set(pCheckBox, - (Eina_Bool *) & (g_pShareViaHandle-> - pCheckedItemsEditList - [nVideoItemIndex])); - - evas_object_show(pCheckBox); - - elm_layout_content_set(pLayout, "elm.swallow.content", pCheckBox); - - return pLayout; + else if(!strcmp(pPart, "elm.progress")) + { + //enable progess for video items + elm_object_item_signal_emit(item_data->item, "elm,state,progess,show", "elm"); + // Add progess bar + Evas_Object *progessbar = elm_layout_add(pObject); + Eina_Bool ret = elm_layout_file_set(progessbar, edj_path, "videolist/progressbar"); + VideoLogInfo("layout file set %s %s",(ret? "Successful": "Failed"), pPart); + evas_object_size_hint_weight_set(progessbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(progessbar, EVAS_HINT_FILL, EVAS_HINT_FILL); + double value = (((double) rand() ) / RAND_MAX ); + edje_object_part_drag_value_set(elm_layout_edje_get(progessbar), "elm.cur.progressbar", value, 0.0); + //__mp_thumbnail_view_get_playback_progress(nVideoItemIndex); + item_data->progress_layout = progessbar; + return progessbar; + } + else if(!strcmp(pPart, "elm.check")) + { + //enable check + elm_object_item_signal_emit(item_data->item, "videolist,checkbox,show", "elm"); + //Add Check + Evas_Object *checkbox = elm_check_add(pObject); + elm_object_style_set(checkbox, "default"); + evas_object_propagate_events_set(checkbox, EINA_TRUE); + elm_check_state_pointer_set(checkbox, (Eina_Bool *) & (g_pShareViaHandle->pCheckedItemsEditList[nVideoItemIndex])); + evas_object_show(checkbox); + item_data->checkbox = checkbox; + return checkbox; } - - MP_DEL_OBJ(pLayout); return NULL; } +#endif /** * @@ -1371,220 +992,68 @@ int mp_share_view_get_sort_type(void) } #ifdef VS_FEATURE_THUMBNAIL_VIEW -/** - * - * @param pObjVideosList - * @param nGenItemIndex - */ -static void __mp_share_view_append_grid_items(void *pObjVideosList, - int nGenItemIndex) + +static void __mp_share_view_grid_item_del_cb(void *pUserdata, Evas_Object * obj, void *event_info) { - if (!g_pShareViaHandle) { - VideoLogInfo("invalid handle"); + if(g_pShareViaHandle == NULL) + { + VideoLogError("g_pShareViaHandle is invalid"); return; } - MP_DEL_GRID_ITC(g_pShareViaHandle->pGenGridItc_1); - MP_DEL_GRID_ITC(g_pShareViaHandle->pGenGridItc_2); - g_pShareViaHandle->pGenGridItc_1 = elm_gengrid_item_class_new(); - g_pShareViaHandle->pGenGridItc_1->item_style = "video/album_grid"; - g_pShareViaHandle->pGenGridItc_1->func.text_get = - (void *) __mp_share_view_get_label_of_grid_item_cb; - g_pShareViaHandle->pGenGridItc_1->func.content_get = - (void *) __mp_share_view_get_grid_icon_cb; - g_pShareViaHandle->pGenGridItc_1->func.state_get = NULL; - g_pShareViaHandle->pGenGridItc_1->func.del = NULL; - - int nCount = (mp_rotate_ctrl_check_landspace_by_win((Evas_Object *) - mp_util_get_main_window_handle - ()) ? - VP_GENLIST_THUMB_LANDSPACE_COUNT : - VP_GENLIST_THUMB_PORTRAIT_COUNT); - int nIndex = nGenItemIndex * nCount; - int nMaxIndex = nIndex + nCount; - int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); - - Elm_Object_Item *gridItem = NULL; - for (; (nIndex < nMaxIndex) && (nIndex < nVideoListSize); nIndex++) { - gridItem = - elm_gengrid_item_append(pObjVideosList, - g_pShareViaHandle->pGenGridItc_1, - (void *) nIndex, - __mp_share_view_select_grid_item_cb, - (void *) nIndex); - elm_gengrid_item_select_mode_set(gridItem, - ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_object_item_data_set(gridItem, (void *) nIndex); - } + stGengridItemData *item_data = (stGengridItemData*)pUserdata; + elm_object_item_data_set(item_data->item, NULL); + free(item_data); } -/** - * - * @param parent - * @param nWidth - * @param nHeight - * @return - */ -static Evas_Object *__mp_share_view_create_gengrid(Evas_Object * parent, - int nWidth, int nHeight) -{ - Evas_Object *pGengrid; - pGengrid = elm_gengrid_add(parent); - if (!pGengrid) { - VideoLogError("pVideoGrid is not existed."); - return NULL; - } - evas_object_size_hint_weight_set(pGengrid, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(pGengrid, EVAS_HINT_FILL, - EVAS_HINT_FILL); - elm_gengrid_item_size_set(pGengrid, nWidth, nHeight); - elm_gengrid_align_set(pGengrid, 0.0, 0.0); - elm_gengrid_horizontal_set(pGengrid, EINA_TRUE); - return pGengrid; -} /** * - * @param height - * @param width + * @param pObjVideosList + * @param nGenItemIndex */ -static void mp_share_view_get_icon_dimensions(int *height, int *width) +static void __mp_share_view_append_grid_items(void *pObjVideosList) { - int winHeight = 0; - int winWidth = 0; - elm_win_screen_size_get(mp_util_get_main_window_handle(), NULL, NULL, - &winWidth, &winHeight); - - bool bLandscape = mp_rotate_ctrl_check_landspace_by_win((Evas_Object *) - mp_util_get_main_window_handle - ()); - if (bLandscape) { - *width = winHeight / VP_GENLIST_THUMB_LANDSPACE_COUNT; - } else { - *width = winWidth / VP_GENLIST_THUMB_PORTRAIT_COUNT; + if (!g_pShareViaHandle) { + VideoLogInfo("invalid g_pShareViaHandle object"); + return; } - *height = VP_ALBUM_THUMB_ICON_HEIGHT * MP_SCALE; -} + VideoLogInfo(""); -/** - * - * @param pUserData - * @param pObject - * @param pPart - * @return - */ -static Evas_Object *__mp_share_view_get_icon_of_grid_cb(const void - *pUserData, - Evas_Object * - pObject, - const char *pPart) -{ - if (!g_pShareViaHandle || !pObject) { - VideoLogError("g_pMainViewWidgetOfShareList is NULL"); - return NULL; + if (!pObjVideosList) { + VideoLogInfo("gengrid object is invalid."); + return; } - int nGenItemIndex = (int) pUserData; - int nHeight = 0; - int nWidth = 0; - mp_share_view_get_icon_dimensions(&nHeight, &nWidth); - - Evas_Object *pGengrid = __mp_share_view_create_gengrid(pObject, - nWidth, - nHeight); - __mp_share_view_append_grid_items(pGengrid, nGenItemIndex); - - return pGengrid; -} - -/** - * - * @param nVideoItemIndex - * @return - */ -int mp_share_view_thumbnail_to_genlist_index(int nVideoItemIndex) -{ - if (nVideoItemIndex < 0) { - VideoLogDebug("invalid nVideoItemIndex"); - return 0; + if(g_pShareViaHandle->pShareViewGIC == NULL) + { + g_pShareViaHandle->pShareViewGIC = elm_gengrid_item_class_new(); + g_pShareViaHandle->pShareViewGIC->item_style = "videolist"; + g_pShareViaHandle->pShareViewGIC->func.text_get = __mp_share_view_get_label_of_grid_item_cb;; + g_pShareViaHandle->pShareViewGIC->func.content_get = __mp_share_view_get_grid_icon_cb; + g_pShareViaHandle->pShareViewGIC->func.state_get = NULL; + g_pShareViaHandle->pShareViewGIC->func.del = NULL; } - int nGenlistIndex = 0; - int nItemCount = (mp_rotate_ctrl_check_landspace_by_win((Evas_Object *) - mp_util_get_main_window_handle - ()) ? - VP_GENLIST_THUMB_LANDSPACE_COUNT : - VP_GENLIST_THUMB_PORTRAIT_COUNT); - nGenlistIndex = nVideoItemIndex / nItemCount; - return nGenlistIndex; -} -/** - * - * @param pGenlist - * @return - */ -static bool __mp_share_view_append_grid_layout(void *pGenlist) -{ - if (!pGenlist || !g_pShareViaHandle) { - VideoLogError("error handle."); - return FALSE; - } - int nIndex = 0; int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); - if (nVideoListSize <= 0) { - VideoLogWarning("nVideoListSize = %d", nVideoListSize); - return FALSE; - } else { - VideoLogWarning("nVideoListSize = %d", nVideoListSize); - } - - MP_DEL_ITC(g_pShareViaHandle->pGenListItc); - g_pShareViaHandle->pGenListItc = elm_genlist_item_class_new(); - g_pShareViaHandle->pGenListItc->item_style = "video/1icon.thumbnail"; - g_pShareViaHandle->pGenListItc->func.text_get = NULL; - g_pShareViaHandle->pGenListItc->func.content_get = - (void *) __mp_share_view_get_icon_of_grid_cb; - g_pShareViaHandle->pGenListItc->func.state_get = NULL; - g_pShareViaHandle->pGenListItc->func.del = NULL; - g_pShareViaHandle->pGenListItc->decorate_item_style = NULL; - - MP_DEL_ITC(g_pShareViaHandle->pGenListLandscapeItc); - g_pShareViaHandle->pGenListLandscapeItc = elm_genlist_item_class_new(); - g_pShareViaHandle->pGenListLandscapeItc->item_style = - "video/1icon.thumbnail.landscape"; - g_pShareViaHandle->pGenListLandscapeItc->func.text_get = NULL; - g_pShareViaHandle->pGenListLandscapeItc->func.content_get = - (void *) __mp_share_view_get_icon_of_grid_cb; - g_pShareViaHandle->pGenListLandscapeItc->func.state_get = NULL; - g_pShareViaHandle->pGenListLandscapeItc->func.del = NULL; - g_pShareViaHandle->pGenListLandscapeItc->decorate_item_style = NULL; - - int nGenlistRow = 0; - nGenlistRow = - mp_share_view_thumbnail_to_genlist_index(nVideoListSize - 1); - - if (mp_rotate_ctrl_check_landspace_by_win((Evas_Object *) - mp_util_get_main_window_handle - ())) { - for (nIndex = 0; nIndex <= nGenlistRow; nIndex++) { - elm_genlist_item_append(pGenlist, - g_pShareViaHandle-> - pGenListLandscapeItc, (void *) nIndex, - NULL, ELM_GENLIST_ITEM_NONE, NULL, - NULL); - } - } else { - for (nIndex = 0; nIndex <= nGenlistRow; nIndex++) { - elm_genlist_item_append(pGenlist, - g_pShareViaHandle->pGenListItc, - (void *) nIndex, - NULL, - ELM_GENLIST_ITEM_NONE, NULL, NULL); + + int nIndex = 0; + + for (nIndex = 0; nIndex < nVideoListSize; nIndex++) { + stGengridItemData *item_data = calloc(1, sizeof(stGengridItemData)); + if(item_data == NULL) + { + VideoLogError("Failed to allocate memory for item data"); + return; } + item_data->itemIndex = nIndex; + item_data->item = elm_gengrid_item_append(pObjVideosList, g_pShareViaHandle->pShareViewGIC, + (void *) item_data, + __mp_share_view_select_grid_item_cb, + (void *) item_data); + elm_gengrid_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_object_item_del_cb_set(item_data->item, __mp_share_view_grid_item_del_cb); } - - return TRUE; } /** @@ -1612,43 +1081,10 @@ static void __mp_share_via_view_rotate_cb(void *data, Evas_Object * obj, } __mp_share_view_arrange_video_list(g_pShareViaHandle->pObjVideosList, TRUE); - mp_share_view_change_title_info(); + mp_share_view_change_done_button_state(); } #endif -/** - * - * @param pObjVideosList - */ -static void __mp_share_view_append_video_items(void *pObjVideosList) -{ - VideoLogInfo(""); - if (!g_pShareViaHandle) { - VideoLogError("No exist g_pShareViaHandle."); - return; - } - - int nIndex = 0; - int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); - MP_DEL_ITC(g_pShareViaHandle->pGenListItc); - g_pShareViaHandle->pGenListItc = elm_genlist_item_class_new(); - g_pShareViaHandle->pGenListItc->item_style = "2line.top"; - g_pShareViaHandle->pGenListItc->func.text_get = - (void *) mp_share_view_get_label_of_video_item_cb; - g_pShareViaHandle->pGenListItc->func.content_get = - (void *) mp_share_view_get_icon_of_video_item_cb; - g_pShareViaHandle->pGenListItc->func.state_get = NULL; - g_pShareViaHandle->pGenListItc->func.del = NULL; - - for (nIndex = 0; nIndex < nVideoListSize; nIndex++) { - elm_genlist_item_append(pObjVideosList, - g_pShareViaHandle->pGenListItc, - (void *) nIndex, NULL, - ELM_GENLIST_ITEM_NONE, - mp_share_view_select_video_item_cb, NULL); - } -} - /** * * @param nTotalSize @@ -1681,8 +1117,10 @@ void mp_share_view_set_value(int nTotalSize) bool __mp_share_view_arrange_video_list(void *pObjVideosList, bool bNeedSvc) { - if (!g_pShareViaWidget || !g_pShareViaHandle) { - VideoLogError("No exist g_pShareViaListViewWidget."); + if (!g_pShareViaWidget || !g_pShareViaHandle || !pObjVideosList) { + VideoLogError("g_pShareViaWidget: [%p], g_pShareViaHandle: [%p] or pObjVideosList: %p maybe invalid.",g_pShareViaWidget, + g_pShareViaHandle, + pObjVideosList); return FALSE; } @@ -1693,7 +1131,7 @@ bool __mp_share_view_arrange_video_list(void *pObjVideosList, int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); int nSortType = mp_share_view_get_sort_type(); - int nViewType = mp_view_as_ctrl_get_type(); + int nViewType = mp_list_view_view_type_get(); if ((nViewType == MP_LIST_VIEW_AS_FOLDER_LIST) && (g_pShareViaHandle->pFolderPath)) { @@ -1739,23 +1177,18 @@ bool __mp_share_view_arrange_video_list(void *pObjVideosList, if (nVideoListSize > 0) { #ifdef VS_FEATURE_THUMBNAIL_VIEW if (g_pShareViaHandle->bThumbnailView) { - elm_genlist_clear(pObjVideosList); - __mp_share_view_append_grid_layout(pObjVideosList); + elm_gengrid_clear(pObjVideosList); + __mp_share_view_append_grid_items(pObjVideosList); } else #endif { - elm_genlist_clear(pObjVideosList); - __mp_share_view_append_video_items(pObjVideosList); + elm_gengrid_clear(pObjVideosList); + __mp_share_view_append_grid_items(pObjVideosList); } } else { elm_naviframe_item_pop(g_pShareViaHandle->pNaviFrameHandle); return FALSE; } -#ifdef VS_FEATURE_THUMBNAIL_VIEW - if (!g_pShareViaHandle->bThumbnailView) { - elm_genlist_decorate_mode_set(pObjVideosList, EINA_TRUE); - } -#endif evas_object_show(pObjVideosList); return TRUE; } @@ -1767,34 +1200,30 @@ bool __mp_share_view_arrange_video_list(void *pObjVideosList, */ Evas_Object *mp_share_view_create_internal_layout(void *pParent) { - if (!pParent) { - VideoLogInfo("[ERR]"); + if (g_pShareViaWidget == NULL || pParent == NULL) { + VideoLogInfo("g_pShareViaWidget [%p] or pParent [%p] is invalid.", g_pShareViaWidget, pParent); return NULL; } VideoLogInfo(""); - if (g_pShareViaWidget->pChareViaViewBaselayout) { - evas_object_del(g_pShareViaWidget->pChareViaViewBaselayout); - g_pShareViaWidget->pChareViaViewBaselayout = NULL; + if (g_pShareViaWidget->pShareViaViewBaselayout) { + evas_object_del(g_pShareViaWidget->pShareViaViewBaselayout); + g_pShareViaWidget->pShareViaViewBaselayout = NULL; } char edj_path[1024] = { 0 }; - char *path = app_get_resource_path(); - snprintf(edj_path, 1024, "%s%s/%s", path, "edje", - VIDEO_PLAYER_REMOVE_LIST_EDJ); + snprintf(edj_path, 1024, "%s%s/%s", path, "edje", VIDEO_CUSTOM_THEME); free(path); - g_pShareViaWidget->pChareViaViewBaselayout = elm_layout_add(pParent); - elm_layout_file_set(g_pShareViaWidget->pChareViaViewBaselayout, - edj_path, REMOVE_LIST_EDJ_GROUP); - evas_object_size_hint_weight_set(g_pShareViaWidget-> - pChareViaViewBaselayout, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(g_pShareViaWidget-> - pChareViaViewBaselayout, - EVAS_HINT_FILL, EVAS_HINT_FILL); - - return g_pShareViaWidget->pChareViaViewBaselayout; + + Evas_Object *base_layout = elm_layout_add(pParent); + elm_layout_file_set(base_layout, edj_path, "gengrid/layout"); + evas_object_size_hint_weight_set(base_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(base_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_signal_emit(base_layout, "top_content,show", "vp"); + + return base_layout; } /** @@ -1841,8 +1270,7 @@ static bool __mp_share_view_get_selected_video_list(int nSelectedSize) pMediaId = mp_util_svc_get_video_id_by_index(nCounter); if (pMediaId) { - g_pShareViaHandle->pSelectedList[nIndex] = - strdup(pMediaId); + g_pShareViaHandle->pSelectedList[nIndex] = strdup(pMediaId); MP_FREE_STRING(pMediaId); nIndex++; } @@ -1919,7 +1347,7 @@ static void __mp_share_select_all_layout_down_cb(void *data, Evas * evas, return; } - int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); + /*int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type(); VideoLogInfo("nVideoListSize : %d", nVideoListSize); Evas_Object *check = @@ -1929,11 +1357,112 @@ static void __mp_share_select_all_layout_down_cb(void *data, Evas * evas, if (nVideoListSize <= VIDEO_SHARE_ITEM_MAX) { elm_check_state_set(check, !state); + }*/ + + __mp_share_view_select_all_change_check_box_cb(data, g_pShareViaWidget->pSelectallbtn, NULL); +} + +static Evas_Object* _create_gengrid(Evas_Object *parent) +{ + if(parent == NULL) + { + VideoLogError("gengrid parent [%p] maybe be invalid", parent); + return NULL; + } + Evas_Object *gengrid = elm_gengrid_add(parent); + evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_gengrid_item_size_set(gengrid, GENGRID_ITEM_WIDTH, GENGRID_ITEM_HEIGHT); + + return gengrid; +} + +static Evas_Object* __mp_share_view_create_select_all_panel(Evas_Object* parent) +{ + if(parent == NULL || g_pShareViaWidget == NULL) + { + VideoLogError("parent[%p] or g_pListRemoveViewWidget[%p] is invalid, can't create select all panel", parent, g_pShareViaWidget); + return NULL; + } + VideoLogError(""); + Evas_Object* grid = elm_grid_add(parent); + elm_grid_size_set(grid, 1200, 72); + evas_object_resize(grid, 1200, 72); + evas_object_event_callback_add(grid, EVAS_CALLBACK_MOUSE_DOWN, + __mp_share_select_all_layout_down_cb, + NULL); + + Evas_Object* bg_image = elm_image_add(grid); + + char *res_path = app_get_resource_path(); + char path[1024] = {0,}; + if(res_path) + { + snprintf(path, 1024, "%s%s/%s", res_path, "images", "select_all_panel_bg.png"); + free(res_path); + VideoLogError("File Path: %s", path); } - __mp_share_view_select_all_change_check_box_cb(data, check, NULL); + elm_image_file_set(bg_image, path, NULL); + evas_object_resize(bg_image, ELM_SCALE_SIZE(1200), ELM_SCALE_SIZE(72)); + elm_grid_pack(grid, bg_image, 0, 0, ELM_SCALE_SIZE(1200), ELM_SCALE_SIZE(72)); + evas_object_show(bg_image); + + + Evas_Object *checkbox = elm_check_add(grid); + // If we regiser the mouse down and check state change callback both then check state callback is executed twice so as of now we + // only using the mouse down callback..and also, mouse down callback cover the entire select all panel which is better. + //evas_object_smart_callback_add(checkbox, "changed", __mp_remove_view_select_all_change_check_box_cb, NULL); + elm_object_domain_translatable_part_text_set(checkbox, "elm.text", VIDEOS_STRING, VIDEOS_SELECTVIEW_BODY_SELECT_ALL_IDS); + elm_object_signal_emit(checkbox, "elm,state,text,visible", "elm"); + evas_object_show(checkbox); + elm_grid_pack(grid, checkbox, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(1120), ELM_SCALE_SIZE(72)); + g_pShareViaWidget->pSelectallbtn = checkbox; + + return grid; } +static Evas_Object* __mp_share_view_create_title_content(Evas_Object* parent) +{ + if(parent == NULL || g_pShareViaWidget== NULL || g_pShareViaHandle== NULL) + { + VideoLogError("parent [%p], widget [%p] or handle [%p] may not be valid", parent, + g_pShareViaWidget, + g_pShareViaHandle); + return NULL; + } + VideoLogError(""); + + char *res_path = app_get_resource_path(); + if(res_path == NULL) + { + VideoLogError("Failed to get valid resouce path"); + return NULL; + } + char path[1024] = {0,}; + snprintf(path, 1024, "%s%s/%s", res_path, "edje", "vp-remove-view-layouts.edj"); + free(res_path); + + Evas_Object *layout = elm_layout_add(parent); + Eina_Bool ret = elm_layout_file_set(layout, path, "remove_view/title_content"); + VideoLogInfo("Layout File Set: %s", ret?"Successful": "Failed"); + //evas_object_size_hint_min_set(layout, 372, 48); + + elm_object_domain_part_text_translatable_set(layout, "cancel_text", VIDEOS_STRING, EINA_TRUE); + elm_object_domain_part_text_translatable_set(layout, "done_text", VIDEOS_STRING, EINA_TRUE); + + elm_object_part_text_set(layout, "cancel_text", VIDEOS_DELETEVIEW_CANCEL_IDS); + elm_object_part_text_set(layout, "done_text", VIDEOS_SHAREVIEW_DONE_IDS); + + elm_object_signal_callback_add(layout, "cancel_button,clicked", "vp", __mp_share_view_show_cancel_cb, (void*)g_pShareViaHandle ); + elm_object_signal_callback_add(layout, "done_button,clicked", "vp", __mp_share_view_show_share_via_panel_cb, (void*)g_pShareViaHandle ); + + return layout; + +} + + + /** * * @param pParent @@ -1946,102 +1475,32 @@ void mp_share_view_init(void *pParent) } VideoLogInfo(""); - g_pShareViaWidget->pChareViaViewBaselayout = - mp_share_view_create_internal_layout(pParent); - if (!g_pShareViaWidget->pChareViaViewBaselayout) { - VideoLogError("pChareViaViewBaselayout is not existed."); - return; - } - evas_object_event_callback_add(g_pShareViaWidget-> - pChareViaViewBaselayout, - EVAS_CALLBACK_DEL, - __mp_share_view_base_layout_del_cb, - NULL); - - g_pShareViaWidget->pVideoListBox = - elm_box_add(g_pShareViaWidget->pChareViaViewBaselayout); - if (!g_pShareViaWidget->pVideoListBox) { - VideoLogError("pVideoListBox is not existed."); + g_pShareViaWidget->pShareViaViewBaselayout = mp_share_view_create_internal_layout(pParent); + if (!g_pShareViaWidget->pShareViaViewBaselayout) { + VideoLogError("pShareViaViewBaselayout is not existed."); return; } - evas_object_size_hint_weight_set(g_pShareViaWidget->pVideoListBox, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(g_pShareViaWidget->pVideoListBox, - EVAS_HINT_FILL, EVAS_HINT_FILL); - - mp_widget_ctrl_create_select_all_layout(g_pShareViaWidget-> - pVideoListBox, - __mp_share_view_select_all_change_check_box_cb, - __mp_share_select_all_layout_down_cb, - (void *) g_pShareViaWidget, - &g_pShareViaWidget-> - pSelectallbtn, - &g_pShareViaWidget-> - pSelAllLayout); + g_pShareViaWidget->pSelAllLayout = __mp_share_view_create_select_all_panel(g_pShareViaWidget->pShareViaViewBaselayout); + elm_object_part_content_set(g_pShareViaWidget->pShareViaViewBaselayout, "top.swallow", g_pShareViaWidget->pSelAllLayout); if (!g_pShareViaWidget->pSelAllLayout) { VideoLogError("pSelAllLayout is not existed."); return; } - elm_box_pack_start(g_pShareViaWidget->pVideoListBox, - g_pShareViaWidget->pSelAllLayout); - - -#ifdef VS_FEATURE_THUMBNAIL_VIEW - if (g_pShareViaHandle->bThumbnailView) { - g_pShareViaHandle->pObjVideosList = - elm_genlist_add(g_pShareViaWidget->pVideoListBox); - if (!g_pShareViaHandle->pObjVideosList) { - VideoLogError("pObjVideosList does not exist."); - return; - } - elm_scroller_bounce_set(g_pShareViaHandle->pObjVideosList, - EINA_FALSE, EINA_TRUE); - evas_object_size_hint_weight_set(g_pShareViaHandle->pObjVideosList, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(g_pShareViaHandle->pObjVideosList, - EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_genlist_block_count_set(g_pShareViaHandle->pObjVideosList, - VIDEO_GENLIST_BLOCK_COUNT); - elm_genlist_homogeneous_set(g_pShareViaHandle->pObjVideosList, - EINA_TRUE); - elm_genlist_mode_set(g_pShareViaHandle->pObjVideosList, - ELM_LIST_COMPRESS); - } else -#endif + g_pShareViaHandle->pObjVideosList = _create_gengrid(g_pShareViaWidget->pShareViaViewBaselayout); + if(g_pShareViaHandle->pObjVideosList == NULL) { - g_pShareViaHandle->pObjVideosList = - elm_genlist_add(g_pShareViaWidget->pVideoListBox); - if (!g_pShareViaHandle->pObjVideosList) { - VideoLogError("pObjVideosList is not existed."); - return; - } - evas_object_size_hint_weight_set(g_pShareViaHandle->pObjVideosList, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(g_pShareViaHandle->pObjVideosList, - EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_genlist_block_count_set(g_pShareViaHandle->pObjVideosList, - VIDEO_GENLIST_BLOCK_COUNT); - elm_genlist_homogeneous_set(g_pShareViaHandle->pObjVideosList, - EINA_TRUE); - elm_genlist_mode_set(g_pShareViaHandle->pObjVideosList, - ELM_LIST_COMPRESS); - } - - elm_box_pack_end(g_pShareViaWidget->pVideoListBox, - g_pShareViaHandle->pObjVideosList); - elm_object_part_content_set(g_pShareViaWidget->pChareViaViewBaselayout, - SWALLOW_LISTVIEW_CONTENT, - g_pShareViaWidget->pVideoListBox); + VideoLogError("Failed to create gengrid"); + return; + } + elm_object_part_content_set(g_pShareViaWidget->pShareViaViewBaselayout, + "elm.content.swallow", + g_pShareViaHandle->pObjVideosList); bool bNormalShow = TRUE; - bNormalShow = - __mp_share_view_arrange_video_list(g_pShareViaHandle-> - pObjVideosList, FALSE); + bNormalShow = __mp_share_view_arrange_video_list(g_pShareViaHandle->pObjVideosList, FALSE); if (!bNormalShow) { VideoLogError("invalid view"); return; @@ -2053,8 +1512,8 @@ void mp_share_view_init(void *pParent) g_pShareViaHandle->pNaviFrameItem = elm_naviframe_item_push(g_pShareViaHandle->pNaviFrameHandle, - szTitle, NULL, NULL, - g_pShareViaWidget->pChareViaViewBaselayout, + "Select Videos", NULL, NULL, + g_pShareViaWidget->pShareViaViewBaselayout, NULL); elm_object_item_domain_text_translatable_set(g_pShareViaHandle-> pNaviFrameItem, @@ -2065,46 +1524,19 @@ void mp_share_view_init(void *pParent) elm_naviframe_item_title_enabled_set(g_pShareViaHandle->pNaviFrameItem, EINA_TRUE, EINA_FALSE); - evas_object_smart_callback_add(g_pShareViaHandle->pNaviFrameHandle, - "transition,finished", - mp_share_view_naviframe_transition_effect_cb, - NULL); - - g_pShareViaWidget->pCancelbtn = - elm_button_add(g_pShareViaHandle->pNaviFrameHandle); - elm_object_style_set(g_pShareViaWidget->pCancelbtn, - "naviframe/title_left"); - mp_util_set_translate_str(g_pShareViaWidget->pCancelbtn, - "IDS_TPLATFORM_ACBUTTON_CANCEL_ABB"); - elm_object_signal_callback_add(g_pShareViaWidget->pCancelbtn, - "elm,action,click", "", - __mp_share_view_show_cancel_cb, - (void *) g_pShareViaHandle); - elm_object_item_part_content_set(g_pShareViaHandle->pNaviFrameItem, - "title_left_btn", - g_pShareViaWidget->pCancelbtn); - evas_object_show(g_pShareViaWidget->pCancelbtn); - - /* Title Done layout */ - g_pShareViaWidget->pSavebtn = - elm_button_add(g_pShareViaHandle->pNaviFrameHandle); - elm_object_style_set(g_pShareViaWidget->pSavebtn, - "naviframe/title_right"); - mp_util_set_translate_str(g_pShareViaWidget->pSavebtn, - "IDS_TPLATFORM_ACBUTTON_DONE_ABB"); - elm_object_signal_callback_add(g_pShareViaWidget->pSavebtn, - "elm,action,click", "", - __mp_share_view_show_share_via_panel_cb, - (void *) g_pShareViaHandle); - elm_object_item_part_content_set(g_pShareViaHandle->pNaviFrameItem, - "title_right_btn", - g_pShareViaWidget->pSavebtn); - evas_object_show(g_pShareViaWidget->pSavebtn); - elm_object_disabled_set(g_pShareViaWidget->pSavebtn, EINA_TRUE); + g_pShareViaWidget->pTitleContentLayout = __mp_share_view_create_title_content(g_pShareViaHandle->pNaviFrameItem); + if(g_pShareViaWidget->pTitleContentLayout == NULL) + { + VideoLogError("Failed to create title content layout"); + } + elm_object_item_part_content_set(g_pShareViaHandle->pNaviFrameItem, "title_content", g_pShareViaWidget->pTitleContentLayout); + elm_object_item_signal_emit(g_pShareViaHandle->pNaviFrameItem, "elm,state,title_content,show", "elm"); evas_object_show(g_pShareViaHandle->pObjVideosList); - evas_object_show(g_pShareViaWidget->pChareViaViewBaselayout); + evas_object_show(g_pShareViaWidget->pShareViaViewBaselayout); + + mp_share_view_change_done_button_state(); mp_util_db_set_update_fun(g_pShareViaHandle->euLev, __mp_share_view_db_changed_cb); @@ -2127,10 +1559,6 @@ void mp_share_view_push(void *pNaviFrame, char *pFolderPath, MpVideoListTabType eTabType) { VideoLogInfo(""); - if (g_pShareViaHandle || g_pShareViaWidget) { - mp_share_view_destroy(); - } - g_pShareViaHandle = (st_VideoListShareViaViewHandle *) calloc(1, sizeof (st_VideoListShareViaViewHandle)); @@ -2141,7 +1569,7 @@ void mp_share_view_push(void *pNaviFrame, memset(g_pShareViaHandle, 0, sizeof(st_VideoListShareViaViewHandle)); memset(g_pShareViaWidget, 0, sizeof(st_VideoListShareViaViewWidget)); - mp_share_view_reset_value(); + g_pShareViaHandle->nSortType = MP_MEDIA_SORT_BY_RECENTLY_VIEWED; g_pShareViaHandle->pNaviFrameHandle = pNaviFrame; g_pShareViaHandle->pChangeViewUserCbFunc = pChangeViewCb; @@ -2152,7 +1580,7 @@ void mp_share_view_push(void *pNaviFrame, g_pShareViaHandle->eTabType = eTabType; g_pShareViaHandle->euLev = MP_DB_UPDATE_LEV_1; - int nViewType = mp_view_as_ctrl_get_type(); + int nViewType = mp_list_view_view_type_get(); if (nViewType == MP_LIST_VIEW_AS_FOLDER_LIST && g_pShareViaHandle->pFolderPath) { @@ -2217,19 +1645,5 @@ void mp_share_view_change_language(void) VideoLogInfo(""); - mp_share_view_change_title_info(); -} - -/** - * - * @param pUserData - * @param e - * @param pObject - * @param pEventInfo - */ -static void -__mp_share_view_base_layout_del_cb(void *pUserData, Evas * e, - Evas_Object * pObject, void *pEventInfo) -{ - __mp_share_view_reset(); + mp_share_view_change_done_button_state(); } diff --git a/src/view/mp-video-list-view-folder.c b/src/view/mp-video-list-view-folder.c index 18f6cf6..2b5268f 100755 --- a/src/view/mp-video-list-view-folder.c +++ b/src/view/mp-video-list-view-folder.c @@ -226,7 +226,7 @@ static int mp_folder_view_get_respective_video_no(int nFolderItemIndex) * @param pPart * @return */ -static char *mp_folder_view_get_label_of_folder_cb(const void *pUserData, +static char *mp_folder_view_get_label_of_folder_cb(void *pUserData, Evas_Object * pObject, const char *pPart) { @@ -261,7 +261,7 @@ static char *mp_folder_view_get_label_of_folder_cb(const void *pUserData, * @param pPart * @return */ -static Evas_Object *mp_folder_view_get_icon_of_folder_cb(const void *pUserData, +static Evas_Object *mp_folder_view_get_icon_of_folder_cb(void *pUserData, Evas_Object *pObject, const char *pPart) { @@ -878,30 +878,20 @@ void mp_folder_view_update_base_layout_content(Evas_Object* content) mp_list_view_check_more_button_of_toolbar(); } -void mp_folder_view_folder_list_set(void *pMainHandle, void *pMainViewWidget, - MpListUpdateType eUpdateType, UpdateListItemsCbFunc pUpdateVideoListUserCb) +void mp_folder_view_view_set(void *pMainViewHandle, + void *pMainViewWidget, + MpListUpdateType eUpdateType, + UpdateListItemsCbFunc pUpdateVideoListUserCb) { - VideoLogDebug("IN"); - if(g_pFolderView == NULL) + if(mp_folder_item_view_is_current_view()) { - mp_folder_view_arrange_folder_list(pMainHandle, pMainViewWidget, eUpdateType, pUpdateVideoListUserCb); + // this will remove the folder item a view and add the folder-view + mp_folder_item_view_remove(); } else { - mp_folder_view_update_base_layout_content(g_pFolderView->pCurrentLayout); + mp_folder_view_arrange_folder_list(pMainViewHandle, pMainViewWidget, eUpdateType, pUpdateVideoListUserCb); } } -void mp_folder_view_add_folder_view_to_naviframe() -{ - if(g_pFolderView == NULL) - { - VideoLogError("g_pFolderView is invalid"); - return; - } - void *mainHandle = g_pFolderView->pMainHandle; - void *mainWidget = g_pFolderView->pMainWidget; - UpdateListItemsCbFunc func = g_pFolderView->fUpdateListItemUserCb; - mp_folder_view_arrange_folder_list(mainHandle, mainWidget,LIST_UPDATE_TYPE_ALL, func); -} /** * * @param pMainViewHandle diff --git a/src/view/mp-video-list-view-item-of-folder.c b/src/view/mp-video-list-view-item-of-folder.c index 20cd04e..5f08ac5 100755 --- a/src/view/mp-video-list-view-item-of-folder.c +++ b/src/view/mp-video-list-view-item-of-folder.c @@ -1432,14 +1432,12 @@ void __mp_folder_soft_back_button_cb(void *data, Evas_Object * obj, void *event_ VideoLogError("g_pFolderViewHandle is invalid"); return; } - - //mp_folder_view_add_folder_view_to_naviframe(); g_pFolderViewHandle->bExist = true; mp_list_view_view_type_set(MP_LIST_VIEW_AS_FOLDER_LIST); mp_folder_view_set_is_item_view(false); - g_pFolderViewHandle->pUpdateListUserCbFunc(LIST_UPDATE_TYPE_ALL); //deleting the folder view in idler callback, as this callback object will also be deleted. ecore_idler_add(delete_folder_item_view_idler_cb, NULL); + g_pFolderViewHandle->pUpdateListUserCbFunc(LIST_UPDATE_TYPE_ALL); } static Evas_Object* _create_gengrid(Evas_Object *parent) @@ -1486,6 +1484,15 @@ static void __mp_folder_item_view_init(void *pParent) __mp_folder_item_view_rotate_cb, NULL); } +void mp_folder_item_view_remove() +{ + VideoLogInfo(""); + if(g_pFolderViewWidget){ + __mp_folder_soft_back_button_cb(NULL, g_pFolderViewWidget->pBackButton, NULL); + } +} + + /** * * @return diff --git a/src/view/mp-video-list-view-main.c b/src/view/mp-video-list-view-main.c index bdf1e25..8515849 100755 --- a/src/view/mp-video-list-view-main.c +++ b/src/view/mp-video-list-view-main.c @@ -1199,7 +1199,7 @@ static void toolbar_folders_item_cb(void *data, Evas_Object *obj, void *event_info) { VideoLogInfo("Called"); - mp_folder_view_arrange_folder_list(g_pMainViewHandle, g_pMainViewWidget, + mp_folder_view_view_set(g_pMainViewHandle, g_pMainViewWidget, LIST_UPDATE_TYPE_ALL, (void *)__mp_list_view_result_user_cb); } @@ -1216,8 +1216,6 @@ Evas_Object* mp_list_view_create_toolbar(Evas_Object* naviframe) g_pToolbarItemData.videos_item = elm_toolbar_item_append(toolbar, NULL, TOOLBAR_BUTTON_VIDEOS, toolbar_videos_item_cb, NULL); g_pToolbarItemData.folders_item = elm_toolbar_item_append(toolbar, NULL, TOOLBAR_BUTTOn_FOLDERS, toolbar_folders_item_cb, NULL); - ///elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_ALWAYS); - return toolbar; }