TizenRefApp-7284 Implement circle buttons' press effect in the Contact Details, Log... 08/89608/4
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 26 Sep 2016 06:41:48 +0000 (09:41 +0300)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 27 Sep 2016 12:02:11 +0000 (05:02 -0700)
[Implementation] Implemented button style with circle effect for arbitrary image.
Updated basic button implementation. Fixed custom button performance issue.

Change-Id: Ibb942152745330d0e313d7243414eabf26421515
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
30 files changed:
lib-apps-common/res/apps-common/edje/AppsCommonButtons.h
lib-apps-common/res/apps-common/edje/apps-common-buttons.edc
lib-apps-common/res/apps-common/edje/apps-common-colors.edc [deleted file]
lib-apps-common/res/apps-common/edje/apps-common-thumbnail.edc
lib-common/res/details/CMakeLists.txt
lib-common/res/details/edje/DetailsItemLayoutMetrics.h
lib-common/res/details/edje/DetailsPath.h [moved from lib-contacts/res/details/edje/ContactsDetailsPath.h with 84% similarity]
lib-common/res/details/edje/details-item-layout.edc
lib-common/res/details/images/contacts_btn_ic_Internet.png [moved from lib-contacts/res/details/images/contacts_btn_ic_Internet.png with 100% similarity]
lib-common/res/details/images/contacts_btn_ic_call.png [moved from lib-contacts/res/details/images/contacts_btn_ic_call.png with 100% similarity]
lib-common/res/details/images/contacts_btn_ic_email.png [moved from lib-contacts/res/details/images/contacts_btn_ic_email.png with 100% similarity]
lib-common/res/details/images/contacts_btn_ic_message.png [moved from lib-contacts/res/details/images/contacts_btn_ic_message.png with 100% similarity]
lib-contacts/project_def.prop
lib-contacts/res/CMakeLists.txt
lib-contacts/res/details/CMakeLists.txt [deleted file]
lib-contacts/res/details/edje/ContactsDetailsItemLayout.h [deleted file]
lib-contacts/res/details/edje/contacts-details-item-layout.edc [deleted file]
lib-contacts/res/input/edje/InputItemLayout.h
lib-contacts/res/input/edje/InputItemLayoutMetrics.h
lib-contacts/res/input/edje/input-item-layout.edc
lib-contacts/src/Contacts/Details/ActionFieldItem.cpp
lib-contacts/src/Contacts/Details/DetailsView.cpp
lib-contacts/src/Contacts/Input/ContactCompoundFieldItem.cpp
lib-contacts/src/Contacts/Input/ContactRelationshipFieldItem.cpp
lib-logs/res/details/CMakeLists.txt
lib-logs/res/details/edje/LogsDetailsPath.h
lib-logs/res/details/edje/logs-details-item-layout.edc
lib-logs/res/details/images/logs_btn_ic_call.png [deleted file]
lib-logs/res/details/images/logs_btn_ic_message.png [deleted file]
lib-logs/src/Logs/Details/ActionItem.cpp

index 3bc4af2..f56f80a 100644 (file)
 
 #include "AppsCommonPath.h"
 
-#define APPS_COMMON_BUTTONS_EDJ     APPS_COMMON_EDJ_DIR"apps-common-buttons.edj"
+#define APPS_COMMON_BUTTONS_EDJ      APPS_COMMON_EDJ_DIR"apps-common-buttons.edj"
 
-#define STYLE_BUTTON_CUSTOM_DEFAULT "custom_default"
-#define STYLE_BUTTON_CUSTOM_SMALL   "custom_small"
-#define STYLE_BUTTON_CUSTOM_CIRCLE  "custom_circle"
+#define STYLE_BUTTON_CUSTOM_DEFAULT         "custom_default"
+#define STYLE_BUTTON_CUSTOM_SMALL           "custom_small"
+#define STYLE_BUTTON_CUSTOM_CIRCLE          "custom_circle"
+#define STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG    "custom_circle/no_bg"
 
-#define BUTTON_TEXT_CLASS           "button_text"
-#define BUTTON_COLOR_CLASS_NORMAL   "button_normal"
+#define BUTTON_TEXT_CLASS                   "button_text"
+#define BUTTON_COLOR_CLASS_NORMAL           "button_normal"
+#define BUTTON_COLOR_CLASS_PRESSED          "button_pressed"
+#define BUTTON_COLOR_CLASS_UNPRESSED        "button_unpressed"
+#define BUTTON_COLOR_CLASS_ICON_NORMAL      "button_icon_normal"
+#define BUTTON_COLOR_CLASS_ICON_PRESSED     "button_icon_pressed"
 
 #endif /* APPS_COMMON_BUTTONS_H */
index 589e7ba..5609f00 100644 (file)
  *
  */
 
-#include "apps-common-colors.edc"
+#include "AppsCommonButtons.h"
 #include "apps-common-utils.edc"
 
-#define BUTTON_CORNER_RADIUS "35"
+#define BUTTON_CORNER_RADIUS "39"
 #define BUTTON_DEFAULT_H 78
-#define BUTTON_DEFAULT_TEXT_H 54
-#define BUTTON_DEFAULT_TEXT_LR 20
-#define BUTTON_DEFAULT_TEXT_TB ((BUTTON_DEFAULT_H-BUTTON_DEFAULT_TEXT_H)/2)
+#define BUTTON_DEFAULT_TEXT_LR 32
 
 #define BUTTON_SMALL_CORNER_RADIUS "25"
 #define BUTTOM_SMALL_H 50
 #define BUTTON_SMALL_TEXT_LR 24
-#define BUTTON_SMALL_TEXT_TB 2
-#define BUTTON_SMALL_TEXT_H (BUTTOM_SMALL_H-(BUTTON_SMALL_TEXT_TB*2))
 
 #define BUTTON_CIRCLE_WH 98
 #define BUTTON_CIRCLE_CONTENT_WH 60
+#define BUTTON_CIRCLE_NO_BG_WH 80
 
 styles {
        style {
                name: "button_main";
-               base: "font=Tizen:style=Light font_size=40 align=center color=#ffffffff text_class="BUTTON_TEXT_CLASS;
+               base: "font=Tizen:style=Light font_size=40 align=center color=#fafafa text_class="BUTTON_TEXT_CLASS;
+       }
+}
+
+color_classes {
+       color_class {
+               name: BUTTON_COLOR_CLASS_NORMAL;
+               color: 82 198 216 255;
+       }
+       color_class {
+               name: BUTTON_COLOR_CLASS_PRESSED;
+               color: 0 0 0 77;
+       }
+       color_class {
+               name: BUTTON_COLOR_CLASS_UNPRESSED;
+               color: 0 0 0 0;
+       }
+       color_class {
+               name: BUTTON_COLOR_CLASS_ICON_NORMAL;
+               color: 250 250 250 255;
+       }
+       color_class {
+               name: BUTTON_COLOR_CLASS_ICON_PRESSED;
+               color: 250 250 250 255;
        }
 }
 
 collections {
        base_scale: 2.6;
 
+       plugins {
+               plugin {
+                       name: "touch_sound";
+                       source: "feedback";
+                       param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_TAP";
+               }
+       }
+
        group { "elm/button/base/custom";
                script {
                        FUNCTION_SCALE_PART
+                       public effect_scale;
                }
                parts {
                        swallow { "tizen_vg_shape"; scale;
@@ -53,6 +82,8 @@ collections {
                        }
                        rect { "rect.bg"; scale;
                                desc { "default";
+                                       rel1.to: "tizen_vg_shape";
+                                       rel2.to: "tizen_vg_shape";
                                        color_class: BUTTON_COLOR_CLASS_NORMAL;
                                }
                        }
@@ -61,39 +92,66 @@ collections {
                        }
                        rect { "rect.effect_bg"; scale;
                                desc { "default";
-                                       color: 0 0 0 0;
+                                       rel1.to: "tizen_vg_shape2";
+                                       rel2.to: "tizen_vg_shape2";
+                                       color_class: BUTTON_COLOR_CLASS_UNPRESSED;
                                }
                                desc { "pressed";
-                                       color: 0 0 0 77;
+                                       rel1.to: "tizen_vg_shape2";
+                                       rel2.to: "tizen_vg_shape2";
+                                       color_class: BUTTON_COLOR_CLASS_PRESSED;
                                }
                        }
                }
                programs {
                        program {
+                               name: "loaded";
+                               signal: "load";
+                               source: "*";
+                               script {
+                                       set_float(effect_scale, 0.7);
+                               }
+                       }
+                       program {
                                name: "pressed";
                                signal: "mouse,down,*";
                                source: "*";
                                script {
-                                       scale_part(PART:"tizen_vg_shape2", "default", 0.7);
+                                       scale_part(PART:"tizen_vg_shape2", "default", get_float(effect_scale));
                                        set_state(PART:"rect.effect_bg", "pressed", 0.0);
                                }
                                after: "pressed_effect";
                        }
                        program {
+                               name: "unpressed";
+                               signal: "mouse,up,*";
+                               source: "*";
+                               script {
+                                       new r, g, b, a;
+                                       get_color_class(BUTTON_COLOR_CLASS_PRESSED, r, g, b, a);
+                                       set_color_class(BUTTON_COLOR_CLASS_UNPRESSED, r, g, b, 0);
+                               }
+                               after: "unpressed_effect";
+                       }
+                       program {
                                name: "pressed_effect";
                                action: STATE_SET "default" 0.0;
                                target: "tizen_vg_shape2";
                                transition: TRANSITION_GLIDE(0.15);
                        }
                        program {
-                               name: "unpressed";
-                               signal: "mouse,up,*";
-                               source: "*";
+                               name: "unpressed_effect";
                                action: STATE_SET "default" 0.0;
                                target: "rect.effect_bg";
                                transition: TRANSITION_GLIDE(0.45);
                        }
                        program {
+                               name: "touch_sound";
+                               signal: "mouse,clicked,*";
+                               source: "*";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
                                name: "clicked";
                                signal: "mouse,clicked,*";
                                source: "*";
@@ -108,31 +166,37 @@ collections {
                data.item: "corner_radius" BUTTON_CORNER_RADIUS;
 
                parts {
-                       spacer { "spacer.left_top"; scale;
+                       spacer { "spacer.base"; scale;
                                desc { "default";
-                                       min: BUTTON_DEFAULT_TEXT_LR BUTTON_DEFAULT_TEXT_TB;
-                                       align: 0.0 0.0;
+                                       min: 0 BUTTON_DEFAULT_H;
+                               }
+                       }
+                       spacer { "spacer.left"; scale;
+                               desc { "default";
+                                       fixed: 1 0;
+                                       min: BUTTON_DEFAULT_TEXT_LR 0;
+                                       align: 0.0 0.5;
                                        rel1.relative: 0.0 0.0;
-                                       rel2.relative: 0.0 0.0;
+                                       rel2.relative: 0.0 1.0;
                                }
                        }
-                       spacer { "spacer.right_bottom"; scale;
+                       spacer { "spacer.right"; scale;
                                desc { "default";
-                                       min: BUTTON_DEFAULT_TEXT_LR BUTTON_DEFAULT_TEXT_TB;
-                                       align: 1.0 1.0;
-                                       rel1.relative: 1.0 1.0;
+                                       fixed: 1 0;
+                                       min: BUTTON_DEFAULT_TEXT_LR 0;
+                                       align: 1.0 0.5;
+                                       rel1.relative: 1.0 0.0;
                                        rel2.relative: 1.0 1.0;
                                }
                        }
                        textblock { "elm.text"; scale;
                                desc { "default";
-                                       min: 0 BUTTON_DEFAULT_TEXT_H;
-                                       rel1 { relative: 1.0 1.0; to: "spacer.left_top"; }
-                                       rel2 { relative: 0.0 0.0; to: "spacer.right_bottom"; }
+                                       align: 0.0 0.5;
+                                       rel1 { relative: 1.0 0.0; to_x: "spacer.left"; }
+                                       rel2 { relative: 0.0 1.0; to_x: "spacer.right"; }
                                        text {
+                                               align: 0.5 0.5;
                                                style: "button_main";
-                                               min: 1 0;
-                                               ellipsis: -1;
                                        }
                                }
                        }
@@ -145,19 +209,19 @@ collections {
                data.item: "corner_radius" BUTTON_SMALL_CORNER_RADIUS;
 
                parts {
-                       spacer { "spacer.left_top"; scale;
+                       spacer { "spacer.base"; scale;
                                desc { "default";
-                                       min: BUTTON_SMALL_TEXT_LR BUTTON_SMALL_TEXT_TB;
+                                       min: 0 BUTTOM_SMALL_H;
                                }
                        }
-                       spacer { "spacer.right_bottom"; scale;
+                       spacer { "spacer.left"; scale;
                                desc { "default";
-                                       min: BUTTON_SMALL_TEXT_LR BUTTON_SMALL_TEXT_TB;
+                                       min: BUTTON_SMALL_TEXT_LR 0;
                                }
                        }
-                       textblock { "elm.text"; scale;
+                       spacer { "spacer.right"; scale;
                                desc { "default";
-                                       min: 0 BUTTON_SMALL_TEXT_H;
+                                       min: BUTTON_SMALL_TEXT_LR 0;
                                }
                        }
                }
@@ -174,6 +238,7 @@ collections {
                                }
                        }
                        swallow { "elm.swallow.content"; scale;
+                               clip_to: "rect.icon_bg";
                                desc { "default";
                                        fixed: 1 1;
                                        min: BUTTON_CIRCLE_CONTENT_WH BUTTON_CIRCLE_CONTENT_WH;
@@ -181,6 +246,70 @@ collections {
                                        rel2.relative: 0.5 0.5;
                                }
                        }
+                       rect { "rect.icon_bg"; scale;
+                               desc { "default";
+                                       color_class: BUTTON_COLOR_CLASS_ICON_NORMAL;
+                               }
+                               desc { "pressed";
+                                       color_class: BUTTON_COLOR_CLASS_ICON_PRESSED;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "icon_pressed";
+                               signal: "mouse,down,*";
+                               source: "*";
+                               action: STATE_SET "pressed" 0.0;
+                               target: "rect.icon_bg";
+                       }
+                       program {
+                               name: "icon_unpressed";
+                               signal: "mouse,up,*";
+                               source: "*";
+                               action: STATE_SET "default" 0.0;
+                               target: "rect.icon_bg";
+                               transition: TRANSITION_GLIDE(0.45);
+                       }
+               }
+       }
+
+       group { "elm/button/base/"STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG;
+               inherit: "elm/button/base/"STYLE_BUTTON_CUSTOM_CIRCLE;
+               data.item: "vector_ux" "circle";
+
+               parts {
+                       spacer { "spacer.base"; scale;
+                               desc { "default";
+                                       min: BUTTON_CIRCLE_NO_BG_WH BUTTON_CIRCLE_NO_BG_WH;
+                               }
+                       }
+                       swallow { "tizen_vg_shape2"; scale;
+                               desc { "default";
+                                       rel1.relative: -0.15 -0.15;
+                                       rel2.relative: 1.15 1.15;
+                               }
+                       }
+                       swallow { "elm.swallow.content"; scale;
+                               desc { "default";
+                                       rel1.relative: 0.0 0.0;
+                                       rel2.relative: 1.0 1.0;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "loaded";
+                               signal: "load";
+                               source: "*";
+                               script {
+                                       set_float(effect_scale, 1.0);
+                                       set_color_class(BUTTON_COLOR_CLASS_NORMAL, 0, 0, 0, 0);
+                                       set_color_class(BUTTON_COLOR_CLASS_PRESSED, 61, 185, 204, 77);
+                                       set_color_class(BUTTON_COLOR_CLASS_ICON_NORMAL, 61, 185, 204, 255);
+                                       set_color_class(BUTTON_COLOR_CLASS_ICON_PRESSED, 34, 104, 115, 255);
+                               }
+                       }
                }
        }
 }
diff --git a/lib-apps-common/res/apps-common/edje/apps-common-colors.edc b/lib-apps-common/res/apps-common/edje/apps-common-colors.edc
deleted file mode 100644 (file)
index d5b0bea..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "AppsCommonButtons.h"
-
-color_classes {
-       color_class { //A03O003
-               name: "thumbnail_bg";
-               color:  255 255 255 255;
-       }
-       color_class { //A03O003L1
-               name: "thumbnail_default";
-               color:  61 185 204 128;
-       }
-       color_class {
-               name: BUTTON_COLOR_CLASS_NORMAL;
-               color: 82 198 216 255;
-       }
-       color_class { //W023 (Input Color 1)
-               name: "icon_expand";
-               color: 61 185 204 255;
-       }
-       color_class { //W0113 (Input Color 1)
-               name: "touch_icon_normal";
-               color: 61 185 204 255;
-       }
-       color_class { //W0113P
-               name: "touch_icon_pressed";
-               color: 34 104 115 255;
-       }
-}
index 82e9db8..6833515 100644 (file)
  */
 
 #include "AppsCommonThumbnail.h"
-#include "apps-common-colors.edc"
 #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)
index 6a70084..7767b75 100644 (file)
@@ -1,5 +1,6 @@
 set(EDCFILES details-item-layout.edc)
 set(EDJDIR "${RES_DIR}/details/edje")
+set(IMGDIR "${RES_DIR}/details/images")
 
 foreach(EDCFILE ${EDCFILES})
        get_filename_component(EDJFILE ${EDCFILE} NAME_WE)
@@ -13,3 +14,5 @@ foreach(EDCFILE ${EDCFILES})
        add_dependencies(${PROJECT_NAME} ${EDJFILE})
        install(FILES ${EDJFILE} DESTINATION ${EDJDIR})
 endforeach(${EDCFILE})
+
+install(DIRECTORY images/ DESTINATION ${IMGDIR})
index b79d5b0..2cbc297 100644 (file)
@@ -18,8 +18,6 @@
 #ifndef DETAILS_ITEM_LAYOUT_METRICS_H
 #define DETAILS_ITEM_LAYOUT_METRICS_H
 
-#define ACTION_BTN_WH 80
-
 #define THUMBNAIL_WH 270
 #define THUMBNAIL_T 60
 #define THUMBNAIL_B 110
  *
  */
 
-#ifndef CONTACTS_DETAILS_PATH_H
-#define CONTACTS_DETAILS_PATH_H
+#ifndef DETAILS_PATH_H
+#define DETAILS_PATH_H
 
 #define DETAILS_IMG_DIR "details/images/"
 #define DETAILS_EDJ_DIR "details/edje/"
 
-#define CONTACTS_DETAILS_ITEM_LAYOUT_EDJ   DETAILS_EDJ_DIR"contacts-details-item-layout.edj"
+#define DETAILS_ITEM_LAYOUT_EDJ   DETAILS_EDJ_DIR"details-item-layout.edj"
 
 #define DETAILS_ICON_CALL         DETAILS_IMG_DIR"contacts_btn_ic_call.png"
 #define DETAILS_ICON_MESSAGE      DETAILS_IMG_DIR"contacts_btn_ic_message.png"
 #define DETAILS_ICON_EMAIL        DETAILS_IMG_DIR"contacts_btn_ic_email.png"
 #define DETAILS_ICON_INTERNET     DETAILS_IMG_DIR"contacts_btn_ic_Internet.png"
 
-#endif /* CONTACTS_DETAILS_PATH_H */
+#endif /* DETAILS_PATH_H */
index d11f69d..a9d719e 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "DetailsItemLayout.h"
 #include "DetailsItemLayoutMetrics.h"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-colors.edc"
 
 collections
 {
index a7b75be..1d8d1ee 100644 (file)
@@ -40,7 +40,7 @@ USER_INC_DIRS_ABS =
 USER_INC_FILES =
 USER_INC_FILES_ABS =
 ## C++ Compiler
-USER_CPP_INC_DIRS = inc res/details/edje res/input/edje res/list/edje res/groups/edje
+USER_CPP_INC_DIRS = inc res/input/edje res/list/edje res/groups/edje
 USER_CPP_INC_DIRS_ABS = $(workspace_loc)/lib-apps-common/inc $(workspace_loc)/lib-apps-common/res/apps-common/edje $(workspace_loc)/lib-common/inc $(workspace_loc)/lib-common/res/details/edje
 USER_CPP_INC_FILES =
 USER_CPP_INC_FILES_ABS =
@@ -60,7 +60,7 @@ USER_EDCS_FONT_DIRS_ABS =
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0
 
-USER_EXT_EDC0_EDCS = res/details/edje/contacts-details-item-layout.edc res/input/edje/input-item-layout.edc
+USER_EXT_EDC0_EDCS = res/input/edje/input-item-layout.edc
 USER_EXT_EDC0_EDCS_IMAGE_DIRS = res
 USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
 USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
@@ -70,5 +70,5 @@ USER_EXT_EDC0_EDCS_FONT_DIRS_ABS =
 
 # Resource Filter
 USER_RES_INCLUDE =
-USER_RES_EXCLUDE = res/details/CMakeLists.txt res/input/CMakeLists.txt res/list/CMakeLists.txt res/CMakeLists.txt
+USER_RES_EXCLUDE = res/input/CMakeLists.txt res/list/CMakeLists.txt res/CMakeLists.txt
 
index 74b13b0..1157777 100644 (file)
@@ -1,6 +1,5 @@
 cmake_minimum_required(VERSION 2.6)
 
-add_subdirectory(details)
 add_subdirectory(groups)
 add_subdirectory(input)
 add_subdirectory(list)
diff --git a/lib-contacts/res/details/CMakeLists.txt b/lib-contacts/res/details/CMakeLists.txt
deleted file mode 100644 (file)
index a2acf39..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-set(EDC_FILES contacts-details-item-layout.edc)
-set(EDJ_DIR "${RES_DIR}/details/edje")
-set(IMG_DIR "${RES_DIR}/details/images")
-
-foreach(EDC_FILE ${EDC_FILES})
-       get_filename_component(EDJ_FILE ${EDC_FILE} NAME_WE)
-       set(EDJ_FILE ${EDJ_FILE}.edj)
-
-       add_custom_target(${EDJ_FILE}
-               COMMAND edje_cc -id .. edje/${EDC_FILE} ${EDJ_FILE}
-               DEPENDS edje/${EDC_FILE}
-       )
-
-       add_dependencies(${PROJECT_NAME} ${EDJ_FILE})
-       install(FILES ${EDJ_FILE} DESTINATION ${EDJ_DIR})
-endforeach(${EDC_FILE})
diff --git a/lib-contacts/res/details/edje/ContactsDetailsItemLayout.h b/lib-contacts/res/details/edje/ContactsDetailsItemLayout.h
deleted file mode 100644 (file)
index 3fdef51..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef CONTACTS_DETAILS_ITEM_LAYOUT_H
-#define CONTACTS_DETAILS_ITEM_LAYOUT_H
-
-#include "ContactsDetailsPath.h"
-
-#define GROUP_ICON_CALL         "icon_call"
-#define GROUP_ICON_MESSAGE      "icon_message"
-#define GROUP_ICON_EMAIL        "icon_email"
-#define GROUP_ICON_INTERNET     "icon_internet"
-
-#endif /* CONTACTS_DETAILS_ITEM_LAYOUT_H */
diff --git a/lib-contacts/res/details/edje/contacts-details-item-layout.edc b/lib-contacts/res/details/edje/contacts-details-item-layout.edc
deleted file mode 100644 (file)
index 7e22451..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "ContactsDetailsItemLayout.h"
-
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
-#include "../../../../lib-common/res/details/edje/details-item-layout.edc"
-
-collections
-{
-       base_scale: 2.6;
-
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_CALL, DETAILS_ICON_CALL,
-                       "touch_icon_normal", "touch_icon_pressed");
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_MESSAGE, DETAILS_ICON_MESSAGE,
-                       "touch_icon_normal", "touch_icon_pressed");
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_EMAIL, DETAILS_ICON_EMAIL,
-                       "touch_icon_normal", "touch_icon_pressed");
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_INTERNET, DETAILS_ICON_INTERNET,
-                       "touch_icon_normal", "touch_icon_pressed");
-}
index 14b68ff..f5890de 100644 (file)
@@ -30,8 +30,4 @@
 #define PART_BUTTON              "swallow.button"
 #define PART_REL_ICON            "swallow.rel_icon"
 
-#define GROUP_ICON_EXPAND        "icon_expand"
-#define GROUP_ICON_CONTRACT      "icon_contract"
-#define GROUP_ICON_RELATIONSHIP  "icon_relationship"
-
 #endif /* INPUT_ITEM_LAYOUT_H */
index 366b523..131fe61 100644 (file)
 #ifndef INPUT_ITEM_LAYOUT_METRICS_H
 #define INPUT_ITEM_LAYOUT_METRICS_H
 
-#define ITEM_H 120
-#define ITEM_T 33
-#define ITEM_B 20
-
 #define TYPE_L 32
+#define TYPE_B 20
 #define TYPE_W 180
-
 #define BUTTON_R 10
-#define BUTTON_WH 80
 
 #define IMAGE_TB 60
 #define IMAGE_WH 270
index 97a4395..1becfaa 100644 (file)
 #include "InputItemLayout.h"
 #include "InputItemLayoutMetrics.h"
 
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-colors.edc"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
-
 collections
 {
        base_scale: 2.6;
 
-       IMAGE_WITH_COLOR(GROUP_ICON_EXPAND, INPUT_ICON_EXPAND, "icon_expand")
-       IMAGE_WITH_COLOR(GROUP_ICON_CONTRACT, INPUT_ICON_CONTRACT, "icon_expand")
-       IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_RELATIONSHIP, INPUT_ICON_RELATIONSHIP,
-                       "touch_icon_normal", "touch_icon_pressed");
-
        group {
                name: "elm/genlist/item/"INPUT_ITEM_STYLE"/default";
                alias: "elm/genlist/item_compress/"INPUT_ITEM_STYLE"/default";
@@ -42,22 +34,22 @@ collections
 
                parts {
                        swallow { "swallow.bg"; }
-                       spacer { "spacer.left_top"; scale;
+                       spacer { "spacer.left_bottom"; scale;
                                desc { "default";
-                                       align: 0.0 0.0;
-                                       rel1.relative: 0.0 0.0;
-                                       rel2.relative: 0.0 0.0;
+                                       align: 0.0 1.0;
+                                       rel1.relative: 0.0 1.0;
+                                       rel2.relative: 0.0 1.0;
                                }
                                desc { "visible";
                                        inherit: "default";
-                                       min: TYPE_L ITEM_T;
+                                       min: TYPE_L TYPE_B;
                                }
                        }
                        swallow { PART_TYPE; scale;
                                desc { "default";
-                                       align: 0.0 0.5;
-                                       rel1 { relative: 1.0 1.0; to: "spacer.left_top"; }
-                                       rel2 { relative: 1.0 0.0; to_x: "spacer.left_top"; to_y: "spacer.right_bottom"; }
+                                       align: 0.0 1.0;
+                                       rel1 { relative: 1.0 0.0; to: "spacer.left_bottom"; }
+                                       rel2 { relative: 1.0 0.0; to: "spacer.left_bottom"; }
                                }
                                desc { "visible";
                                        inherit: "default";
@@ -74,15 +66,15 @@ collections
                        swallow { PART_BUTTON; scale;
                                desc { "default";
                                        align: 1.0 0.5;
-                                       rel1 { relative: 0.0 0.5; to_x: "spacer.right_bottom"; }
-                                       rel2 { relative: 0.0 0.5; to_x: "spacer.right_bottom"; }
+                                       rel1 { relative: 0.0 0.0; to_x: "spacer.right"; }
+                                       rel2 { relative: 0.0 1.0; to_x: "spacer.right"; }
                                }
                        }
-                       spacer { "spacer.right_bottom"; scale;
+                       spacer { "spacer.right"; scale;
                                desc { "default";
-                                       align: 1.0 1.0;
-                                       min: BUTTON_R ITEM_B;
-                                       rel1.relative: 1.0 1.0;
+                                       align: 1.0 0.5;
+                                       min: BUTTON_R 0;
+                                       rel1.relative: 1.0 0.0;
                                        rel2.relative: 1.0 1.0;
                                }
                        }
@@ -93,14 +85,14 @@ collections
                                source: "elm";
                                action: STATE_SET "visible" 0.0;
                                target: PART_TYPE;
-                               target: "spacer.left_top";
+                               target: "spacer.left_bottom";
                        }
                        program {
                                signal: "elm,state,"PART_TYPE",passive";
                                source: "elm";
                                action: STATE_SET "default" 0.0;
                                target: PART_TYPE;
-                               target: "spacer.left_top";
+                               target: "spacer.left_bottom";
                        }
                }
        }
@@ -123,9 +115,8 @@ collections
                        swallow { PART_REL_ICON; scale;
                                desc { "default";
                                        align: 1.0 0.5;
-                                       min: BUTTON_WH BUTTON_WH;
-                                       rel1 { relative: 0.0 0.5; to_x: PART_BUTTON; }
-                                       rel2 { relative: 0.0 0.5; to_x: PART_BUTTON; }
+                                       rel1 { relative: 0.0 0.0; to_x: PART_BUTTON; }
+                                       rel2 { relative: 0.0 1.0; to_x: PART_BUTTON; }
                                }
                        }
                }
index ba4571a..f0c6f67 100644 (file)
@@ -24,8 +24,8 @@
 #include "Ui/Scale.h"
 #include "Utils/Callback.h"
 
-#include "ContactsDetailsItemLayout.h"
-#include "DetailsItemLayoutMetrics.h"
+#include "AppsCommonButtons.h"
+#include "DetailsPath.h"
 
 #define PART_ACTION_BUTTON1 "elm.swallow.icon.2"
 #define PART_ACTION_BUTTON2 "elm.swallow.end"
@@ -34,11 +34,6 @@ using namespace Common;
 using namespace Contacts::Details;
 using namespace Contacts::Model;
 
-namespace
-{
-       const std::string layoutPath = App::getResourcePath(CONTACTS_DETAILS_ITEM_LAYOUT_EDJ);
-}
-
 ActionFieldItem::ActionFieldItem(Model::ContactObject &object, ActionType actionType)
        : FieldItem(object), m_ActionType(actionType)
 {
@@ -62,23 +57,25 @@ void ActionFieldItem::onSelected()
 
 Evas_Object *ActionFieldItem::createActionButton(Evas_Object *parent, ActionType actionType)
 {
-       static const int imageSize = Ui::getScaledValue(ACTION_BTN_WH);
        static const char *icons[] = {
-               /* ActionCall    = */ GROUP_ICON_CALL,
-               /* ActionMessage = */ GROUP_ICON_MESSAGE,
-               /* ActionEmail   = */ GROUP_ICON_EMAIL,
-               /* ActionUrl     = */ GROUP_ICON_INTERNET
+               /* ActionCall    = */ DETAILS_ICON_CALL,
+               /* ActionMessage = */ DETAILS_ICON_MESSAGE,
+               /* ActionEmail   = */ DETAILS_ICON_EMAIL,
+               /* ActionUrl     = */ DETAILS_ICON_INTERNET
        };
 
-       Evas_Object *image = elm_image_add(parent);
-       elm_image_file_set(image, layoutPath.c_str(), icons[actionType]);
-       evas_object_size_hint_min_set(image, imageSize, imageSize);
-       evas_object_propagate_events_set(image, EINA_FALSE);
-       evas_object_smart_data_set(image, (void *) actionType);
-       evas_object_smart_callback_add(image, "clicked",
+       Evas_Object *button = elm_button_add(parent);
+       elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
+       evas_object_propagate_events_set(button, EINA_FALSE);
+       evas_object_smart_data_set(button, (void *) actionType);
+       evas_object_smart_callback_add(button, "clicked",
                        makeCallback(&ActionFieldItem::onButtonPressed), this);
 
-       return image;
+       Evas_Object *image = elm_image_add(button);
+       elm_image_file_set(image, App::getResourcePath(icons[actionType]).c_str(), nullptr);
+       elm_object_part_content_set(button, "elm.swallow.content", image);
+
+       return button;
 }
 
 void ActionFieldItem::executeAction(ActionType actionType)
index e0783a8..f315ad8 100644 (file)
@@ -36,7 +36,7 @@
 #include "Utils/Logger.h"
 #include "Utils/Range.h"
 
-#include "ContactsDetailsPath.h"
+#include "DetailsPath.h"
 
 #include <app_i18n.h>
 
@@ -78,7 +78,7 @@ DetailsView::DetailsView(int recordId, Type type)
 
 Evas_Object *DetailsView::onCreate(Evas_Object *parent)
 {
-       elm_theme_extension_add(nullptr, App::getResourcePath(CONTACTS_DETAILS_ITEM_LAYOUT_EDJ).c_str());
+       elm_theme_extension_add(nullptr, App::getResourcePath(DETAILS_ITEM_LAYOUT_EDJ).c_str());
 
        m_Genlist = new Ui::Genlist();
        m_Genlist->create(parent);
index 846638b..b3662bd 100644 (file)
 #include "App/Path.h"
 #include "Utils/Callback.h"
 
+#include "AppsCommonButtons.h"
 #include "InputItemLayout.h"
 
 using namespace Contacts::Input;
 using namespace Contacts::Model;
 
-namespace
-{
-       const std::string layoutPath = App::getResourcePath(INPUT_ITEM_LAYOUT_EDJ);
-}
-
 ContactCompoundFieldItem::ContactCompoundFieldItem(Model::ContactObject &object)
        : ContactFieldItem(object)
 {
@@ -75,26 +71,25 @@ void ContactCompoundFieldItem::onExpanded(bool isExpanded)
 Evas_Object *ContactCompoundFieldItem::createExpandButton(Evas_Object *parent)
 {
        Evas_Object *button = elm_button_add(parent);
-       /* FIXME: Request standard style for expand open/close buttons */
-       elm_object_style_set(button, "floatingbutton/default");
+       elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
        elm_object_focus_allow_set(button, EINA_FALSE);
        evas_object_smart_callback_add(button, "clicked",
                        makeCallback(&ContactCompoundFieldItem::onExpandPressed), this);
 
+       std::string path = App::getResourcePath(isExpanded() ? INPUT_ICON_CONTRACT : INPUT_ICON_EXPAND);
        Evas_Object *icon = elm_image_add(button);
        elm_object_part_content_set(button, "elm.swallow.content", icon);
-       elm_image_file_set(icon, layoutPath.c_str(),
-                       isExpanded() ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
+       elm_image_file_set(icon, path.c_str(), nullptr);
 
        return button;
 }
 
 void ContactCompoundFieldItem::updateExpandIcon(bool isExpanded) const
 {
+       std::string path = App::getResourcePath(isExpanded ? INPUT_ICON_CONTRACT : INPUT_ICON_EXPAND);
        Evas_Object *button = elm_object_item_part_content_get(getObjectItem(), PART_BUTTON);
        Evas_Object *icon = elm_object_part_content_get(button, "elm.swallow.content");
-       elm_image_file_set(icon, layoutPath.c_str(),
-                       isExpanded ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
+       elm_image_file_set(icon, path.c_str(), nullptr);
 }
 
 void ContactCompoundFieldItem::onExpandPressed(Evas_Object *button, void *eventInfo)
index 058cb17..83e60e7 100644 (file)
 #include "Utils/Callback.h"
 #include "Utils/Logger.h"
 
+#include "AppsCommonButtons.h"
 #include "InputItemLayout.h"
 
 using namespace Contacts::Input;
 using namespace Contacts::Model;
 
-namespace
-{
-       const std::string layoutPath = App::getResourcePath(INPUT_ITEM_LAYOUT_EDJ);
-}
-
 Elm_Genlist_Item_Class *ContactRelationshipFieldItem::getItemClass() const
 {
        static Elm_Genlist_Item_Class itc = createItemClass(INPUT_REL_ITEM_STYLE);
@@ -43,10 +39,15 @@ Elm_Genlist_Item_Class *ContactRelationshipFieldItem::getItemClass() const
 Evas_Object *ContactRelationshipFieldItem::getContent(Evas_Object *parent, const char *part)
 {
        if (strcmp(part, PART_REL_ICON) == 0) {
-               Evas_Object *button = elm_image_add(parent);
-               elm_image_file_set(button, layoutPath.c_str(), GROUP_ICON_RELATIONSHIP);
+               Evas_Object *button = elm_button_add(parent);
+               elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
                evas_object_smart_callback_add(button, "clicked",
                                makeCallback(&ContactRelationshipFieldItem::onPickPressed), this);
+
+               Evas_Object *image = elm_image_add(button);
+               elm_image_file_set(image, App::getResourcePath(INPUT_ICON_RELATIONSHIP).c_str(), nullptr);
+               elm_object_part_content_set(button, "elm.swallow.content", image);
+
                return button;
        }
 
index 3f7de06..9a803ad 100644 (file)
@@ -1,6 +1,5 @@
 set(EDC_FILES logs-details-item-layout.edc)
 set(EDJ_DIR "${RES_DIR}/details/edje")
-set(IMG_DIR "${RES_DIR}/details/images")
 
 foreach(EDC_FILE ${EDC_FILES})
        get_filename_component(EDJ_FILE ${EDC_FILE} NAME_WE)
@@ -14,5 +13,3 @@ foreach(EDC_FILE ${EDC_FILES})
        add_dependencies(${PROJECT_NAME} ${EDJ_FILE})
        install(FILES ${EDJ_FILE} DESTINATION ${EDJ_DIR})
 endforeach(${EDC_FILE})
-
-install(DIRECTORY images/ DESTINATION ${IMG_DIR})
index 3f2c7dc..9cda94c 100644 (file)
@@ -23,7 +23,4 @@
 
 #define LOGS_DETAILS_ITEM_LAYOUT_EDJ   DETAILS_EDJ_DIR"logs-details-item-layout.edj"
 
-#define DETAILS_ICON_CALL         DETAILS_IMG_DIR"logs_btn_ic_call.png"
-#define DETAILS_ICON_MESSAGE      DETAILS_IMG_DIR"logs_btn_ic_message.png"
-
 #endif /* LOGS_DETAILS_PATH_H */
index db2106d..a61326b 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "LogsDetailsItemLayout.h"
 
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
 #include "../../../../lib-common/res/details/edje/details-item-layout.edc"
 
 #define UNSAVED_BTN_H 78
@@ -31,11 +30,6 @@ collections
 {
        base_scale: 2.6;
 
-       IMAGE_WITH_COLOR_AND_TOUCH(LAYOUT_ICON_CALL, DETAILS_ICON_CALL,
-                       "touch_icon_normal", "touch_icon_pressed");
-       IMAGE_WITH_COLOR_AND_TOUCH(LAYOUT_ICON_MESSAGE, DETAILS_ICON_MESSAGE,
-                       "touch_icon_normal", "touch_icon_pressed");
-
        group {
                name: "elm/genlist/item/"LOGS_DETAILS_ITEM_STYLE"/default";
                alias: "elm/genlist/item_compress/"LOGS_DETAILS_ITEM_STYLE"/default";
diff --git a/lib-logs/res/details/images/logs_btn_ic_call.png b/lib-logs/res/details/images/logs_btn_ic_call.png
deleted file mode 100644 (file)
index 7ded7ed..0000000
Binary files a/lib-logs/res/details/images/logs_btn_ic_call.png and /dev/null differ
diff --git a/lib-logs/res/details/images/logs_btn_ic_message.png b/lib-logs/res/details/images/logs_btn_ic_message.png
deleted file mode 100644 (file)
index 2610874..0000000
Binary files a/lib-logs/res/details/images/logs_btn_ic_message.png and /dev/null differ
index 74440b8..a5eee27 100644 (file)
 #include "Logs/Details/ActionItem.h"
 #include "Logs/Model/Log.h"
 
-#include "LogsDetailsItemLayout.h"
-#include "DetailsItemLayoutMetrics.h"
-
 #include "App/Path.h"
 #include "Ui/Menu.h"
 #include "Ui/Scale.h"
 #include "Utils/Callback.h"
 #include "Common/Strings.h"
 
+#include "AppsCommonButtons.h"
+#include "DetailsPath.h"
+
 #include <app_i18n.h>
 
 using namespace Logs::Details;
@@ -42,10 +42,6 @@ using namespace std::placeholders;
 #define TAG_BACKING "<backing=on><backing_color=#00ddff99>"
 
 
-namespace
-{
-       const std::string layoutPath = App::getResourcePath(LOGS_DETAILS_ITEM_LAYOUT_EDJ);
-}
 
 ActionItem::ActionItem(LogGroup *group)
        : m_Group(group)
@@ -161,21 +157,23 @@ char *ActionItem::getStrNumberType()
 
 Evas_Object *ActionItem::createActionButton(Evas_Object *parent, ActionType actionType)
 {
-       static const int imageSize = Ui::getScaledValue(ACTION_BTN_WH);
        static const char *actionIcons[] = {
-               /* ActionCall    = */ LAYOUT_ICON_CALL,
-               /* ActionMessage = */ LAYOUT_ICON_MESSAGE
+               /* ActionCall    = */ DETAILS_ICON_CALL,
+               /* ActionMessage = */ DETAILS_ICON_MESSAGE
        };
 
-       Evas_Object *image = elm_image_add(parent);
-       elm_image_file_set(image, layoutPath.c_str(), actionIcons[actionType]);
-       evas_object_size_hint_min_set(image, imageSize, imageSize);
-       evas_object_propagate_events_set(image, EINA_FALSE);
-       evas_object_smart_data_set(image, (void *) actionType);
-       evas_object_smart_callback_add(image, "clicked",
+       Evas_Object *button = elm_button_add(parent);
+       elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
+       evas_object_propagate_events_set(button, EINA_FALSE);
+       evas_object_smart_data_set(button, (void *) actionType);
+       evas_object_smart_callback_add(button, "clicked",
                        makeCallback(&ActionItem::onButtonPressed), this);
 
-       return image;
+       Evas_Object *image = elm_image_add(button);
+       elm_image_file_set(image, App::getResourcePath(actionIcons[actionType]).c_str(), nullptr);
+       elm_object_part_content_set(button, "elm.swallow.content", image);
+
+       return button;
 }
 
 void ActionItem::executeAction(ActionType actionType)