TizenRefApp-9236 Update contact thumbnails 59/147759/2
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Tue, 5 Sep 2017 12:18:19 +0000 (15:18 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Tue, 5 Sep 2017 12:18:19 +0000 (15:18 +0300)
Change-Id: I655bd2bdba217735cf13976d5fbab953079935a3
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_02.png [deleted file]
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_04.png
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_05.png [deleted file]
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_02.png [deleted file]
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_05.png [deleted file]
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_02.png [deleted file]
lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_05.png [deleted file]
lib-apps-common/res/apps-common/edje/AppsCommonThumbnail.h
lib-apps-common/res/apps-common/edje/apps-common-thumbnail.edc
lib-apps-common/res/apps-common/edje/apps-common-utils.edc
lib-apps-common/src/Ui/Thumbnail.cpp

diff --git a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_02.png b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_02.png
deleted file mode 100644 (file)
index 8b3c3d3..0000000
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_02.png and /dev/null differ
index bcbb6a7..c03bfcf 100644 (file)
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_04.png and b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_04.png differ
diff --git a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_05.png b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_05.png
deleted file mode 100644 (file)
index b882ab2..0000000
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_05.png and /dev/null differ
diff --git a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_02.png b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_02.png
deleted file mode 100644 (file)
index 5f5fa3d..0000000
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_02.png and /dev/null differ
diff --git a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_05.png b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_05.png
deleted file mode 100644 (file)
index 0a9c947..0000000
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_bg_05.png and /dev/null differ
diff --git a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_02.png b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_02.png
deleted file mode 100644 (file)
index c53e6f9..0000000
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_02.png and /dev/null differ
diff --git a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_05.png b/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_05.png
deleted file mode 100644 (file)
index e243aa4..0000000
Binary files a/lib-apps-common/edje/apps-common/images/contacts_caller_id_default_masking_05.png and /dev/null differ
index 7842b82..a098992 100644 (file)
 
 #include "AppsCommonPath.h"
 
-#define APPS_COMMON_THUMBNAIL_EDJ       APPS_COMMON_EDJ_DIR"apps-common-thumbnail.edj"
+#define APPS_COMMON_THUMBNAIL_EDJ   APPS_COMMON_EDJ_DIR"apps-common-thumbnail.edj"
 
-#define THUMBNAIL_DEFAULT_SMALL         APPS_COMMON_IMG_DIR"contacts_caller_id_default_02.png"
-#define THUMBNAIL_DEFAULT_MEDIUM        APPS_COMMON_IMG_DIR"contacts_caller_id_default_05.png"
-#define THUMBNAIL_DEFAULT_LARGE         APPS_COMMON_IMG_DIR"contacts_caller_id_default_04.png"
+#define THUMBNAIL_DEFAULT           APPS_COMMON_IMG_DIR"contacts_caller_id_default_04.png"
+#define THUMBNAIL_BG                APPS_COMMON_IMG_DIR"contacts_caller_id_default_bg_04.png"
+#define THUMBNAIL_MASK              APPS_COMMON_IMG_DIR"contacts_caller_id_default_masking_04.png"
 
-#define THUMBNAIL_BG_SMALL              APPS_COMMON_IMG_DIR"contacts_caller_id_default_bg_02.png"
-#define THUMBNAIL_BG_MEDIUM             APPS_COMMON_IMG_DIR"contacts_caller_id_default_bg_05.png"
-#define THUMBNAIL_BG_LARGE              APPS_COMMON_IMG_DIR"contacts_caller_id_default_bg_04.png"
+#define LAYOUT_THUMBNAIL            "thumbnail"
+#define LAYOUT_THUMBNAIL_DEFAULT    "default_thumbnail"
 
-#define THUMBNAIL_MASK_SMALL            APPS_COMMON_IMG_DIR"contacts_caller_id_default_masking_02.png"
-#define THUMBNAIL_MASK_MEDIUM           APPS_COMMON_IMG_DIR"contacts_caller_id_default_masking_05.png"
-#define THUMBNAIL_MASK_LARGE            APPS_COMMON_IMG_DIR"contacts_caller_id_default_masking_04.png"
-
-#define LAYOUT_THUMBNAIL_SMALL           "thumbnail_small"
-#define LAYOUT_THUMBNAIL_MEDIUM          "thumbnail_medium"
-#define LAYOUT_THUMBNAIL_LARGE           "thumbnail_large"
-
-#define LAYOUT_THUMBNAIL_DEFAULT_SMALL   "default_thumbnail_small"
-#define LAYOUT_THUMBNAIL_DEFAULT_MEDIUM  "default_thumbnail_medium"
-#define LAYOUT_THUMBNAIL_DEFAULT_LARGE   "default_thumbnail_large"
-
-#define THUMBNAIL_SMALL_SIZE 98
-#define THUMBNAIL_MEDIUM_SIZE 180
-#define THUMBNAIL_LARGE_SIZE 270
+#define THUMBNAIL_SMALL_SIZE        98
+#define THUMBNAIL_MEDIUM_SIZE       180
+#define THUMBNAIL_LARGE_SIZE        270
 
 #endif /* APPS_COMMON_THUMBNAIL_H */
index a5822e5..eee5d63 100644 (file)
  */
 
 #include "AppsCommonThumbnail.h"
-#include "apps-common-utils.edc"
-
-color_classes {
-       color_class { //A03O003
-               name: "thumbnail_bg";
-               color:  255 255 255 255;
-       }
-       color_class { //A03O003L1
-               name: "thumbnail_default";
-               color:  61 185 204 128;
-       }
-}
 
 collections {
-       IMAGE_WITH_MASK(LAYOUT_THUMBNAIL_SMALL, THUMBNAIL_MASK_SMALL)
-       IMAGE_WITH_MASK(LAYOUT_THUMBNAIL_MEDIUM, THUMBNAIL_MASK_MEDIUM)
-       IMAGE_WITH_MASK(LAYOUT_THUMBNAIL_LARGE, THUMBNAIL_MASK_LARGE)
+       group { LAYOUT_THUMBNAIL;
+               parts {
+                       image { "image.mask"; precise;
+                               images.image: THUMBNAIL_MASK COMP;
+                               desc { "default";
+                                       image.normal: THUMBNAIL_MASK;
+                               }
+                       }
+                       swallow { "elm.swallow.content";
+                               clip: "image.mask";
+                       }
+               }
+       }
 
-       IMAGE_WITH_COLOR_AND_BG(LAYOUT_THUMBNAIL_DEFAULT_SMALL, THUMBNAIL_DEFAULT_SMALL, "thumbnail_default", THUMBNAIL_BG_SMALL, "thumbnail_bg")
-       IMAGE_WITH_COLOR_AND_BG(LAYOUT_THUMBNAIL_DEFAULT_MEDIUM, THUMBNAIL_DEFAULT_MEDIUM, "thumbnail_default", THUMBNAIL_BG_MEDIUM, "thumbnail_bg")
-       IMAGE_WITH_COLOR_AND_BG(LAYOUT_THUMBNAIL_DEFAULT_LARGE, THUMBNAIL_DEFAULT_LARGE, "thumbnail_default", THUMBNAIL_BG_LARGE, "thumbnail_bg")
+       group { LAYOUT_THUMBNAIL_DEFAULT;
+               parts {
+                       image { "image.bg";
+                               images.image: THUMBNAIL_BG COMP;
+                               desc { "default";
+                                       image.normal: THUMBNAIL_BG;
+                                       color: 250 250 250 255;
+                               }
+                       }
+                       image { "image";
+                               images.image: THUMBNAIL_DEFAULT COMP;
+                               desc { "default";
+                                       image.normal: THUMBNAIL_DEFAULT;
+                                       color: 61 185 204 255;
+                               }
+                       }
+               }
+       }
 }
index 490cd42..ea2c549 100644 (file)
@@ -59,8 +59,6 @@
                                        aspect_preference: SOURCE; \
                                } \
                        } \
-               } \
-               parts { \
                        image { "image"; \
                                desc { "default"; \
                                        image.normal: IMAGE_PATH; \
                } \
        }
 
-#define IMAGE_WITH_MASK(GROUP_NAME, MASK_PATH) \
-       group { GROUP_NAME; \
-               images.image: MASK_PATH COMP; \
-               parts { \
-                       image { "image.mask"; \
-                               precise_is_inside: 1; \
-                               desc { "default"; \
-                                       image.normal: MASK_PATH; \
-                                       aspect: 1.0 1.0; \
-                                       aspect_preference: SOURCE; \
-                               } \
-                       } \
-               } \
-               parts { \
-                       swallow { "elm.swallow.content"; \
-                               clip_to: "image.mask"; \
-                       } \
-               } \
-       }
-
 #define IMAGE_WITH_COLOR_AND_TOUCH(GROUP_NAME, IMAGE_PATH, COLOR_CLASS, PRESSED_COLOR_CLASS) \
        group { GROUP_NAME; \
                images.image: IMAGE_PATH COMP; \
                                        aspect_preference: SOURCE; \
                                } \
                                desc { "pressed"; \
-                                       inherit:  "default" 0.0; \
+                                       inherit: "default"; \
                                        color_class: PRESSED_COLOR_CLASS; \
                                } \
                        } \
                } \
                programs { \
                        program { \
-                               name: "pressed"; \
                                signal: "mouse,down,*"; \
                                source: "*"; \
-                               action: STATE_SET "pressed" 0.0; \
+                               action: STATE_SET "pressed"; \
                                target: "image"; \
                        } \
                        program { \
-                               name: "unpressed"; \
                                signal: "mouse,up,*"; \
                                source: "*"; \
-                               action: STATE_SET "default" 0.0; \
+                               action: STATE_SET "default"; \
                                target: "image"; \
                        } \
                } \
                                        aspect_preference: SOURCE; \
                                } \
                                desc { "pressed"; \
-                                       inherit:  "default" 0.0; \
+                                       inherit: "default"; \
                                        image.normal: PRESSED_IMAGE_PATH; \
                                } \
                        } \
                } \
                programs { \
                        program { \
-                               name: "pressed"; \
                                signal: "mouse,down,*"; \
                                source: "*"; \
-                               action: STATE_SET "pressed" 0.0; \
+                               action: STATE_SET "pressed"; \
                                target: "image"; \
                        } \
                        program { \
-                               name: "unpressed"; \
                                signal: "mouse,up,*"; \
                                source: "*"; \
-                               action: STATE_SET "default" 0.0; \
+                               action: STATE_SET "default"; \
                                target: "image"; \
                        } \
                } \
index b2cf883..155eb84 100644 (file)
@@ -24,17 +24,7 @@ using namespace Ui;
 
 namespace
 {
-       const struct
-       {
-               int size;
-               const char *groupMask;
-               const char *groupDefault;
-       } params[] = {
-               { THUMBNAIL_SMALL_SIZE, LAYOUT_THUMBNAIL_SMALL, LAYOUT_THUMBNAIL_DEFAULT_SMALL },
-               { THUMBNAIL_MEDIUM_SIZE, LAYOUT_THUMBNAIL_MEDIUM, LAYOUT_THUMBNAIL_DEFAULT_MEDIUM },
-               { THUMBNAIL_LARGE_SIZE, LAYOUT_THUMBNAIL_LARGE, LAYOUT_THUMBNAIL_DEFAULT_LARGE }
-       };
-
+       int sizes[] = { THUMBNAIL_SMALL_SIZE, THUMBNAIL_MEDIUM_SIZE, THUMBNAIL_LARGE_SIZE };
        const std::string layoutPath = App::getResourcePath(APPS_COMMON_THUMBNAIL_EDJ);
 }
 
@@ -61,7 +51,7 @@ void Thumbnail::setImagePath(const char *path)
        if (path && *path) {
                elm_image_file_set(m_Image, path, nullptr);
        } else {
-               elm_image_file_set(m_Image, layoutPath.c_str(), params[m_Size].groupDefault);
+               elm_image_file_set(m_Image, layoutPath.c_str(), LAYOUT_THUMBNAIL_DEFAULT);
        }
 }
 
@@ -69,7 +59,7 @@ void Thumbnail::setSizeHint(bool isSet)
 {
        int size = 0;
        if (isSet) {
-               size = getScaledValue(params[m_Size].size);
+               size = getScaledValue(sizes[m_Size]);
        }
 
        evas_object_size_hint_min_set(m_Image, size, size);
@@ -78,10 +68,10 @@ void Thumbnail::setSizeHint(bool isSet)
 Evas_Object *Thumbnail::onCreate(Evas_Object *parent)
 {
        Evas_Object *layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, layoutPath.c_str(), params[m_Size].groupMask);
+       elm_layout_file_set(layout, layoutPath.c_str(), LAYOUT_THUMBNAIL);
 
        m_Image = elm_image_add(layout);
-       elm_image_prescale_set(m_Image, getScaledValue(params[m_Size].size) * 2);
+       elm_image_prescale_set(m_Image, getScaledValue(sizes[m_Size]));
        elm_image_aspect_fixed_set(m_Image, EINA_TRUE);
        elm_image_fill_outside_set(m_Image, EINA_TRUE);
        elm_object_part_content_set(layout, "elm.swallow.content", m_Image);