void tab_view_add(Evas_Object *parent) { RETM_IF(!parent, "parent is NULL"); tab_view_data *data = calloc(1, sizeof(tab_view_data)); data->navi = parent; data->layout = ui_utils_layout_add(data->navi, _tab_view_destroy, data); if(!data->layout) { free(data); return; } data->tab = elm_toolbar_add(data->navi); if(!data->tab) { evas_object_del(data->layout); return; } elm_toolbar_shrink_mode_set(data->tab, ELM_TOOLBAR_SHRINK_EXPAND); elm_toolbar_transverse_expanded_set(data->tab, EINA_TRUE); elm_object_style_set(data->tab, "tabbar"); _tab_view_fill(data); data->navi_item = elm_naviframe_item_push(data->navi, NULL, NULL, NULL, data->layout, "tabbar/notitle"); elm_object_item_part_content_set(data->navi_item, "tabbar", data->tab); /* Create badge */ int err = badge_new(PACKAGE); if(BADGE_ERROR_NONE != err) { ERR("Badge is not created."); } }
void nfc_fill_item_cb(void *data, Evas_Object *obj, void *event_info) { elm_list_item_selected_set(event_info, EINA_FALSE); notification_data* notify_info=(notification_data*)data; layout_view_data2 *datas = calloc(1, sizeof(layout_view_data2)); Evas_Object* lists=notify_info->status; datas->navi = evas_object_data_get(lists, "view_data"); datas->name = notify_info->name; datas->layout = ui_utils_layout_add(datas->navi, _layout_view_destroy2, datas); if(!datas->layout) { free(datas); return ; } Evas_Object* list= elm_list_add(datas->layout); notification_data *notification_list = NULL; int size=0; // notification_list=nfc_component_list_get(&size); for(int i=0;i<size;i++){ notification_list[i].status=lists; elm_list_item_append(list,notification_list[i].name,NULL,NULL,_tab_view_layout_fill_cb2depth,¬ification_list[i]); } evas_object_hide(elm_object_part_content_unset(datas->layout, "elm.swallow.content")); elm_object_part_content_set(datas->layout, "elm.swallow.content", list); evas_object_show(list); datas->navi_item = elm_naviframe_item_push(datas->navi, datas->name, NULL, NULL,datas->layout , NULL); // _tab_view_layout_fill_cb2depth(data,obj,event_info); }
Evas_Object *main_view_add(Evas_Object *navi) { main_view *main_view_data = calloc(1, sizeof(main_view)); RETVM_IF(!main_view_data, NULL, "calloc() failed"); main_view_data->navi = navi; main_view_data->layout = ui_utils_layout_add(main_view_data->navi, _main_view_destroy, main_view_data); if(!main_view_data->layout) { ERR("ui_utils_layout_add() failed"); free(main_view_data); return NULL; } main_view_data->preview_canvas = evas_object_image_add(evas_object_evas_get(main_view_data->layout)); if(!main_view_data->preview_canvas) { ERR("_main_view_rect_create() failed"); evas_object_del(main_view_data->layout); return NULL; } elm_object_part_content_set(main_view_data->layout, "elm.swallow.content", main_view_data->preview_canvas); main_view_data->camera_enabled = _main_view_init_camera(main_view_data); if (!main_view_data->camera_enabled) { ERR("_main_view_start_preview failed"); _main_view_show_warning_popup(navi, _error, _camera_init_failed, _ok, main_view_data); } _main_view_register_cbs(main_view_data); main_view_data->navi_item = elm_naviframe_item_push(main_view_data->navi, NULL, NULL, NULL, main_view_data->layout, NULL); // main_view_data->navi_item = elm_naviframe_item_push(main_view_data->navi, "Color Picker", NULL, NULL, main_view_data->layout, NULL); elm_naviframe_item_title_enabled_set(main_view_data->navi_item, EINA_FALSE, EINA_TRUE); return main_view_data->layout; }