if (ap->mf_Status.view_type != mf_view_root) {
mf_navi_add_back_button(ap, mf_callback_navi_backbutton_clicked_cb);
- // Evas_Object *pImage = elm_image_add(ap->mf_MainWindow.pNaviLayout);
- // elm_image_file_set(pImage, EDJ_IMAGE, MF_ICON_SOFT_BACK);
- // elm_image_resizable_set(pImage, EINA_TRUE, EINA_TRUE);
- // evas_object_show(pImage);
- //
- // Evas_Object *btn = elm_button_add(ap->mf_MainWindow.pNaviLayout);
- // elm_object_content_set(btn,pImage);
- // elm_object_style_set(btn, "transparent");
- // evas_object_smart_callback_add(btn, "clicked", mf_callback_backbutton_clicked_cb, ap);
- // //elm_object_part_content_set(ap->mf_MainWindow.pNaviLayout, "back_key", btn);
- // elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "title_left_btn", btn);
}
if (ap->mf_Status.more == MORE_DEFAULT) {
#include "mf-object-conf.h"
#include "mf-callback.h"
#include "mf-fm-svc-wrapper.h"
-#include "mf-gengrid.h"
+#include "mf-fs-util.h"
+#include "mf-genlist.h"
#include "mf-util.h"
#include "mf-ta.h"
#include "mf-resource.h"
#include "mf-search-view.h"
#include <unzip.h>
+#include <mime_type.h>
Evas_Object *__mf_genlist_gl_decompress_icon_get_lite(void *data, Evas_Object *obj, const char *part)
{
- if (!strcmp(part, "elm.icon.2")) {
+// mf_debug("parts present are %s", part);
+ if (!strcmp(part, "elm.icon.1")) {
+ char *name = (char *)data;
+ char *mime_type = NULL;
+ int retcode = -1;
+ char *ext = NULL;
+
+ ext = strrchr(name, '.');
+ if (ext != NULL) {
+ ext++;
+ retcode = mime_type_get_mime_type(ext, &mime_type);
+ } else {
+ retcode = mime_type_get_mime_type(name, &mime_type);
+ }
+
+ if ((mime_type == NULL) || (retcode != MIME_TYPE_ERROR_NONE)) {
+ mf_debug("Fail to get mime type with return value [%d]", retcode);
+ return NULL;
+ }
+
+ char edj_path[1024] = {0};
+ char *path = app_get_resource_path();
+
+
+ mf_debug("shubham mime type is %s", mime_type);
+
+ char *file_format = strchr(mime_type, '/');
+ char *file_type = file_format;
+ if (file_format) {
+ file_type++;
+ }
+
+ if(file_format) {
+ strcpy(file_format,"\0");
+ }
+
+ if (!strcmp(mime_type, "image")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_images.png", path);
+ } else if (!strcmp(mime_type, "video")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_search_category_video.png", path);
+ } else if (!strcmp(mime_type, "audio")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_music.png", path);
+ } else if (!strcmp(mime_type, "application")) {
+ if (!strcmp(file_type, "zip")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_zip.png", path);
+ } else if (!strcmp(file_type, "ppt")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_ppt.png", path);
+ } else if (!strcmp(file_type, "pdf")) {
+ snprintf(edj_path, 1024, "%sedje/icon/my_files_list_icon_pdf.png", path);
+ } else if (!strcmp(file_type, "xls")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_excel.png", path);
+ } else if (!strcmp(file_type, "html")) {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_html.png", path);
+ } else {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_etc.png", path);
+ }
+ } else {
+ snprintf(edj_path, 1024, "%sedje/icon/myfile_icon_etc.png", path);
+ }
+ Evas_Object *img = elm_icon_add(obj);
+ evas_object_image_file_set(img, edj_path, NULL);
+ evas_object_size_hint_align_set(img, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ return img;
+
+ } else if (!strcmp(part, "elm.icon.2")) {
Evas_Object *check = NULL;
check = elm_check_add(obj);
elm_object_style_set(check, "default");