TizenRefApp-7116 Review and update Speed Dial GUI 27/88127/3
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Wed, 14 Sep 2016 06:07:36 +0000 (09:07 +0300)
committerAleksandr Sapozhnik <a.sapozhnik@samsung.com>
Wed, 14 Sep 2016 11:20:12 +0000 (04:20 -0700)
[Implementation] Reimplemented Speed Dial GUI using spacers.

Change-Id: I5383687e0d1704d79e9d065daf84e9303f2c9506
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
15 files changed:
lib-phone/.cproject
lib-phone/CMakeLists.txt
lib-phone/project_def.prop
lib-phone/res/CMakeLists.txt
lib-phone/res/speed-dial/CMakeLists.txt [moved from lib-phone/res/speeddial/CMakeLists.txt with 81% similarity]
lib-phone/res/speed-dial/edje/SpeedDialLayout.h [moved from lib-phone/res/speeddial/edje/SpeedDialLayout.h with 65% similarity]
lib-phone/res/speed-dial/edje/SpeedDialPath.h [moved from lib-phone/res/speeddial/edje/SpeedDialPath.h with 62% similarity]
lib-phone/res/speed-dial/edje/speed-dial-layout.edc [new file with mode: 0644]
lib-phone/res/speed-dial/images/keypad_speed_dial_add.png [moved from lib-phone/res/speeddial/images/keypad_speed_dial_add.png with 100% similarity]
lib-phone/res/speed-dial/images/keypad_speed_dial_bg.png [moved from lib-phone/res/speeddial/images/keypad_speed_dial_bg.png with 100% similarity]
lib-phone/res/speed-dial/images/keypad_speed_dial_del.png [moved from lib-phone/res/speeddial/images/keypad_speed_dial_del.png with 100% similarity]
lib-phone/res/speeddial/edje/SpeedDialLayoutMetrics.h [deleted file]
lib-phone/res/speeddial/edje/speeddial-layout.edc [deleted file]
lib-phone/src/Phone/SpeedDial/SettingsItem.cpp
lib-phone/src/Phone/SpeedDial/SettingsView.cpp

index 584a880..fc7b2b0 100644 (file)
                                                                <option id="sbi.gnu.cpp.compiler.option.1832462661" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" useByScannerDiscovery="false" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="mobile-3.0-device.core_llvm37.armel.core.sharedLib"/>
                                                                </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.2123696125" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" useByScannerDiscovery="false" valueType="includePath">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.2123696125" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" useByScannerDiscovery="false" valueType="includePath"/>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.425562116" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" useByScannerDiscovery="false" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
+                                                                       <listOptionValue builtIn="false" value="-fvisibility=hidden"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.compiler.option.include.paths.53096408" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-apps-common/inc}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-apps-common/res/apps-common/edje}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-common/inc}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-phone/res/dialer/edje}&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/EGL&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.425562116" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" useByScannerDiscovery="false" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
-                                                                       <listOptionValue builtIn="false" value="-fvisibility=hidden"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.compiler.option.include.paths.53096408" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-apps-common/inc}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-apps-common/res/apps-common/edje}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-common/inc}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-phone/res/dialer/edje}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-phone/res/speeddial/edje}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-phone/res/speed-dial/edje}&quot;"/>
                                                                </option>
                                                                <option id="sbi.gnu.cpp.compiler.option.frameworks.core.225449461" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" useByScannerDiscovery="false" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="Native_API"/>
                <project id="lib-phone.org.tizen.nativecore.target.sbi.gcc45.so.812478332" name="Tizen Native Shared Library" projectType="org.tizen.nativecore.target.sbi.gcc45.so"/>
        </storageModule>
        <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
-       <storageModule moduleId="refreshScope"/>
+       <storageModule moduleId="refreshScope" versionNumber="2">
+               <configuration configurationName="Debug">
+                       <resource resourceType="PROJECT" workspacePath="/lib-phone"/>
+               </configuration>
+               <configuration configurationName="Release">
+                       <resource resourceType="PROJECT" workspacePath="/lib-phone"/>
+               </configuration>
+       </storageModule>
        <storageModule moduleId="com.samsung.tizen.nativeapp.projectInfo" version="1.0.0"/>
        <storageModule moduleId="scannerConfiguration">
                <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
                        <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
                </scannerConfigBuildInfo>
        </storageModule>
+       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 </cproject>
index f28d636..8a5a7f3 100644 (file)
@@ -7,7 +7,7 @@ include_directories(
        ${CMAKE_SOURCE_DIR}/lib-apps-common/res/apps-common/edje
        ${CMAKE_SOURCE_DIR}/lib-common/inc
        ${CMAKE_CURRENT_SOURCE_DIR}/res/dialer/edje
-       ${CMAKE_CURRENT_SOURCE_DIR}/res/speeddial/edje
+       ${CMAKE_CURRENT_SOURCE_DIR}/res/speed-dial/edje
        ${CMAKE_CURRENT_SOURCE_DIR}/inc
 )
 
index 03956f5..077cc00 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/dialer/edje res/speeddial/edje
+USER_CPP_INC_DIRS = inc res/dialer/edje res/speed-dial/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
 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/dialer/edje/dialer-layout.edc res/dialer/edje/dialer-button-layout.edc res/dialer/edje/dialer-predictive-layout.edc res/speeddial/edje/speeddial-layout.edc
+USER_EXT_EDC0_EDCS = res/dialer/edje/dialer-layout.edc res/dialer/edje/dialer-button-layout.edc res/dialer/edje/dialer-predictive-layout.edc res/speed-dial/edje/speed-dial-layout.edc
 USER_EXT_EDC0_EDCS_IMAGE_DIRS = res
 USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
 USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
index 26db38b..094db2d 100644 (file)
@@ -1,4 +1,4 @@
 cmake_minimum_required(VERSION 2.6)
 
 add_subdirectory(dialer)
-add_subdirectory(speeddial)
+add_subdirectory(speed-dial)
similarity index 81%
rename from lib-phone/res/speeddial/CMakeLists.txt
rename to lib-phone/res/speed-dial/CMakeLists.txt
index c7351c7..7fb8925 100644 (file)
@@ -1,5 +1,5 @@
-set(EDCFILES speeddial-layout.edc)
-set(EDJDIR "${RES_DIR}/speeddial/edje")
+set(EDCFILES speed-dial-layout.edc)
+set(EDJDIR "${RES_DIR}/speed-dial/edje")
 
 foreach(EDCFILE ${EDCFILES})
        get_filename_component(EDJFILE ${EDCFILE} NAME_WE)
 
 #include "SpeedDialPath.h"
 
-#define GROUP_MAIN_LAYOUT           "main_layout"
-#define GROUP_DELETE_BUTTON         "delete_button"
-#define GROUP_ITEM_ICON             "icon"
-#define GROUP_ITEM_LAYOUT           "item"
+#define LAYOUT_MAIN         "main"
+#define LAYOUT_BUTTON_ADD   "button_add"
+#define LAYOUT_BUTTON_DEL   "button_del"
+#define LAYOUT_ITEM         "item"
 
-#define PART_CONTENT                "swallow.content"
-#define PART_ICON                   "swallow.icon"
-#define PART_DELETE_BUTTON          "swallow.delete_button"
-#define PART_NAME                   "text.name"
+#define PART_CONTENT        "swallow.content"
+#define PART_THUMBNAIL      "swallow.thumbnail"
+#define PART_BUTTON_DEL     "swallow.button_del"
+#define PART_NAME           "text.name"
+
+#define ITEM_PAD_W 40
+#define ITEM_PAD_H 66
 
 #endif /* SPEED_DIAL_LAYOUT_H */
similarity index 62%
rename from lib-phone/res/speeddial/edje/SpeedDialPath.h
rename to lib-phone/res/speed-dial/edje/SpeedDialPath.h
index 6242333..d5e8b09 100644 (file)
 #ifndef SPEED_DIAL_PATH_H
 #define SPEED_DIAL_PATH_H
 
-#define SPEED_DIAL_IMG_DIR         "speeddial/images/"
-#define SPEED_DIAL_EDJ_DIR         "speeddial/edje/"
+#define SPEED_DIAL_IMG_DIR "speed-dial/images/"
+#define SPEED_DIAL_EDJ_DIR "speed-dial/edje/"
 
-#define SPEED_DIAL_LAYOUT_EDJ       SPEED_DIAL_EDJ_DIR"speeddial-layout.edj"
+#define SPEED_DIAL_LAYOUT_EDJ SPEED_DIAL_EDJ_DIR"speed-dial-layout.edj"
 
-#define ICON_BG                     SPEED_DIAL_IMG_DIR"keypad_speed_dial_bg.png"
-#define ICON_ADD                    SPEED_DIAL_IMG_DIR"keypad_speed_dial_add.png"
-#define ICON_DELETE                 SPEED_DIAL_IMG_DIR"keypad_speed_dial_del.png"
+#define ICON_BG  SPEED_DIAL_IMG_DIR"keypad_speed_dial_bg.png"
+#define ICON_ADD SPEED_DIAL_IMG_DIR"keypad_speed_dial_add.png"
+#define ICON_DEL SPEED_DIAL_IMG_DIR"keypad_speed_dial_del.png"
 
 #endif /* SPEED_DIAL_PATH_H */
diff --git a/lib-phone/res/speed-dial/edje/speed-dial-layout.edc b/lib-phone/res/speed-dial/edje/speed-dial-layout.edc
new file mode 100644 (file)
index 0000000..d6c5e7f
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * 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 "SpeedDialLayout.h"
+#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
+
+#define MAIN_LR 32
+#define MAIN_T 70
+#define MAIN_B 80
+
+#define BUTTON_ADD_WH 80
+
+#define BUTTON_DEL_L 3
+#define BUTTON_DEL_WH 60
+
+#define THUMBNAIL_WH 192
+#define NAME_T 12
+#define NAME_H (52*2)
+#define NAME_TEXT_SIZE 37
+
+styles {
+       style {
+               name: "name_style";
+               base: "font=Tizen:style=Regular font_size="NAME_TEXT_SIZE" align=center color=#000000 wrap=mixed ellipsis=1.0";
+       }
+}
+
+color_classes {
+       color_class { //AO001
+               name: "main_bg";
+               color: 250 250 250 255;
+       }
+       color_class { //AO010 (Input color 1)
+               name: "button_add_bg";
+               color: 61 185 204 128;
+       }
+       color_class {
+               name: "button_add_bg_pressed";
+               color: 61 185 204 255;
+       }
+       color_class {
+               name: "button_add_bg_unpressed";
+               color: 61 185 204 0;
+       }
+}
+
+collections {
+       base_scale: 2.6;
+
+       group { LAYOUT_MAIN;
+               parts {
+                       rect { "rect.bg";
+                               desc { "default";
+                                       color_class: "main_bg";
+                               }
+                       }
+                       spacer { "spacer.left_top"; scale;
+                               desc { "default";
+                                       align: 0.0 0.0;
+                                       min: MAIN_LR MAIN_T;
+                                       rel1.relative: 0.0 0.0;
+                                       rel2.relative: 0.0 0.0;
+                               }
+                       }
+                       spacer { "spacer.right_bottom"; scale;
+                               desc { "default";
+                                       align: 1.0 1.0;
+                                       min: MAIN_LR MAIN_B;
+                                       rel1.relative: 1.0 1.0;
+                                       rel2.relative: 1.0 1.0;
+                               }
+                       }
+                       swallow { PART_CONTENT;
+                               desc { "default";
+                                       align: 0.0 0.0;
+                                       rel1 { relative: 1.0 1.0; to: "spacer.left_top"; }
+                                       rel2 { relative: 0.0 0.0; to: "spacer.right_bottom"; }
+                               }
+                       }
+               }
+       }
+       group { LAYOUT_BUTTON_ADD;
+               images {
+                       image: ICON_BG COMP;
+                       image: ICON_ADD COMP;
+               }
+               parts {
+                       image { "image.bg";
+                               desc { "default";
+                                       image.normal: ICON_BG;
+                                       color_class: "button_add_bg";
+                               }
+                       }
+                       image { "image.press_bg";
+                               desc { "default";
+                                       image.normal: ICON_BG;
+                                       color_class: "button_add_bg_unpressed";
+                               }
+                               desc { "pressed";
+                                       image.normal: ICON_BG;
+                                       color_class: "button_add_bg_pressed";
+                               }
+                               desc { "pressed_effect";
+                                       inherit: "pressed";
+                                       rel1.relative: 0.15 0.15;
+                                       rel2.relative: 0.85 0.85;
+                               }
+                       }
+                       image { "image.icon"; scale;
+                               desc { "default";
+                                       min: BUTTON_ADD_WH BUTTON_ADD_WH;
+                                       rel1.relative: 0.5 0.5;
+                                       rel2.relative: 0.5 0.5;
+                                       image.normal: ICON_ADD;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "pressed";
+                               signal: "mouse,down,*";
+                               source: "*";
+                               action: STATE_SET "pressed_effect" 0.0;
+                               target: "image.press_bg";
+                               after: "pressed_effect";
+                       }
+                       program {
+                               name: "pressed_effect";
+                               action: STATE_SET "pressed" 0.0;
+                               target: "image.press_bg";
+                               transition: TRANSITION_GLIDE(0.15);
+                       }
+                       program {
+                               name: "unpressed";
+                               signal: "mouse,up,*";
+                               source: "*";
+                               action: STATE_SET "default" 0.0;
+                               target: "image.press_bg";
+                               transition: TRANSITION_GLIDE(0.45);
+                       }
+               }
+       }
+       group { LAYOUT_BUTTON_DEL;
+               images {
+                       image: ICON_BG COMP;
+                       image: ICON_DEL COMP;
+               }
+               parts {
+                       image { "image.icon";
+                               desc { "default";
+                                       image.normal: ICON_DEL;
+                               }
+                       }
+                       image { "image.press_bg";
+                               desc { "default";
+                                       rel1.relative: 0.05 0.05; //FIXME: Replace with pressed image
+                                       rel2.relative: 0.95 0.95;
+                                       image.normal: ICON_BG;
+                                       color: 0 0 0 0;
+                               }
+                               desc { "pressed";
+                                       inherit: "default";
+                                       color: 0 0 0 77;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "pressed";
+                               signal: "mouse,down,*";
+                               source: "*";
+                               action: STATE_SET "pressed" 0.0;
+                               target: "image.press_bg";
+                       }
+                       program {
+                               name: "unpressed";
+                               signal: "mouse,up,*";
+                               source: "*";
+                               action: STATE_SET "default" 0.0;
+                               target: "image.press_bg";
+                               transition: TRANSITION_GLIDE(0.45);
+                       }
+               }
+       }
+       group { LAYOUT_ITEM;
+               parts {
+                       swallow { PART_THUMBNAIL; scale;
+                               desc { "default";
+                                       align: 0.0 0.0;
+                                       min: THUMBNAIL_WH THUMBNAIL_WH;
+                                       rel1.relative: 0.0 0.0;
+                                       rel2.relative: 0.0 0.0;
+                               }
+                       }
+                       spacer { "spacer.button_del.left"; scale;
+                               desc { "default";
+                                       align: 1.0 0.5;
+                                       min: BUTTON_DEL_L 0;
+                                       rel1 { relative: 0.0 0.0; to_x: PART_THUMBNAIL; }
+                                       rel2 { relative: 0.0 1.0; to_x: PART_THUMBNAIL; }
+                               }
+                       }
+                       swallow { PART_BUTTON_DEL; scale;
+                               desc { "default";
+                                       align: 0.0 0.0;
+                                       min: BUTTON_DEL_WH BUTTON_DEL_WH;
+                                       rel1 { relative: 0.0 0.0; to_x: "spacer.button_del.left"; }
+                                       rel2 { relative: 0.0 0.0; to_x: "spacer.button_del.left"; }
+                               }
+                       }
+                       spacer { "spacer.name.top"; scale;
+                               desc { "default";
+                                       align: 0.5 0.0;
+                                       min: 0 NAME_T;
+                                       rel1 { relative: 0.0 1.0; to_y: PART_THUMBNAIL; }
+                                       rel2 { relative: 1.0 1.0; to_y: PART_THUMBNAIL; }
+                               }
+                       }
+                       textblock { PART_NAME; scale;
+                               desc { "default";
+                                       align: 0.5 0.0;
+                                       min: 0 NAME_H;
+                                       rel1 { relative: 0.0 1.0; to_y: "spacer.name.top"; }
+                                       rel2 { relative: 1.0 1.0; to_y: "spacer.name.top"; }
+                                       text {
+                                               align: 0.5 0.0;
+                                               style: "name_style";
+                                       }
+                               }
+                       }
+               }
+       }
+}
diff --git a/lib-phone/res/speeddial/edje/SpeedDialLayoutMetrics.h b/lib-phone/res/speeddial/edje/SpeedDialLayoutMetrics.h
deleted file mode 100644 (file)
index 93cfe2d..0000000
+++ /dev/null
@@ -1,43 +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 SPEED_DIAL_LAYOUT_METRICS_H
-#define SPEED_DIAL_LAYOUT_METRICS_H
-
-#define VIEW_W              720
-#define VIEW_H              1130
-
-#define LAYOUT_X            32
-#define LAYOUT_Y            70
-
-#define ITEM_W              192
-#define ITEM_H              308
-
-#define ITEM_PAD_X          40
-#define ITEM_PAD_Y          54
-
-#define ICON_SIZE           192
-#define ICON_DELETE_SIZE    60
-
-#define ICON_ADD_SIZE       80
-#define ICON_ADD_POS        (ICON_SIZE-ICON_ADD_SIZE)/2
-
-#define TEXT_H              104
-#define TEXT_Y              (ICON_SIZE+12)
-#define TEXT_FONT_SIZE      37
-
-#endif /* SPEED_DIAL_LAYOUT_METRICS_H */
diff --git a/lib-phone/res/speeddial/edje/speeddial-layout.edc b/lib-phone/res/speeddial/edje/speeddial-layout.edc
deleted file mode 100644 (file)
index c3ee8cd..0000000
+++ /dev/null
@@ -1,215 +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 "SpeedDialLayout.h"
-#include "SpeedDialLayoutMetrics.h"
-
-styles {
-       style {
-               name: "text_style";
-               base: "font=Tizen:style=Regular font_size="TEXT_FONT_SIZE" color=#000000 align=center wrap=word ellipsis=1.0";
-       }
-}
-
-images {
-       image: ICON_BG COMP;
-}
-
-collections {
-       base_scale: 2.6;
-
-       group {
-               name: GROUP_MAIN_LAYOUT;
-
-               parts {
-                       part {
-                               name: "bg";
-                               type: RECT;
-                               description {
-                                       state: "default" 0.0;
-                                       color: 255 255 255 255;
-                               }
-                       }
-                       part {
-                               name: PART_CONTENT;
-                               type: SWALLOW;
-                               description {
-                                       state: "default" 0.0;
-                                       fixed: 1 1;
-                                       rel1.relative: LAYOUT_X/VIEW_W LAYOUT_Y/VIEW_H;
-                                       rel2.relative: 1.0-LAYOUT_X/VIEW_W 1.0-LAYOUT_Y/VIEW_H;
-                               }
-                       }
-               }
-       }
-
-       group {
-               name: GROUP_ITEM_ICON;
-               images.image: ICON_ADD COMP;
-
-               parts {
-                       part {
-                               name: "image.bg";
-                               type: IMAGE;
-                               description {
-                                       state: "default" 0.0;
-                                       color: 61 185 204 127;
-                                       aspect: 1 1;
-                                       aspect_preference: SOURCE;
-                                       image.normal: ICON_BG;
-                               }
-                       }
-                       part {
-                               name: "image.icon";
-                               type: IMAGE;
-                               description {
-                                       state: "default" 0.0;
-                                       aspect: 1 1;
-                                       aspect_preference: SOURCE;
-                                       image.normal: ICON_ADD;
-                                       rel1.relative: ICON_ADD_POS/ICON_SIZE ICON_ADD_POS/ICON_SIZE;
-                                       rel2.relative: (ICON_ADD_SIZE+ICON_ADD_POS)/ICON_SIZE (ICON_ADD_SIZE+ICON_ADD_POS)/ICON_SIZE;
-                               }
-                       }
-                       part {
-                               name: "image.mask";
-                               type: IMAGE;
-                               description {
-                                       state: "default" 0.0;
-                                       visible: 0;
-                                       color: 0 0 0 50;
-                                       aspect: 1 1;
-                                       aspect_preference: SOURCE;
-                                       image.normal: ICON_BG;
-                               }
-                               description {
-                                       state: "pressed" 0.0;
-                                       inherit: "default" 0.0;
-                                       visible: 1;
-                               }
-                       }
-               }
-               programs {
-                       program {
-                               name: "pressed";
-                               signal: "mouse,down,*";
-                               source: "*";
-                               action: STATE_SET "pressed" 0.0;
-                               target: "image.mask";
-                       }
-                       program {
-                               name: "unpressed";
-                               signal: "mouse,up,*";
-                               source: "*";
-                               action: STATE_SET "default" 0.0;
-                               target: "image.mask";
-                       }
-               }
-       }
-
-       group {
-               name: GROUP_DELETE_BUTTON;
-               images.image: ICON_DELETE COMP;
-
-               parts {
-                       part {
-                               name: "image.icon";
-                               type: IMAGE;
-                               description {
-                                       state: "default" 0.0;
-                                       aspect: 1 1;
-                                       aspect_preference: SOURCE;
-                                       image.normal: ICON_DELETE;
-                               }
-                       }
-                       part {
-                               name: "image.mask";
-                               type: IMAGE;
-                               description {
-                                       state: "default" 0.0;
-                                       visible: 0;
-                                       color: 0 0 0 50;
-                                       aspect: 1 1;
-                                       aspect_preference: SOURCE;
-                                       image.normal: ICON_BG;
-                                       rel1.to: "image.icon";
-                                       rel2.to: "image.icon";
-                               }
-                               description {
-                                       state: "pressed" 0.0;
-                                       inherit: "default" 0.0;
-                                       visible: 1;
-                               }
-                       }
-               }
-               programs {
-                       program {
-                               name: "pressed";
-                               signal: "mouse,down,*";
-                               source: "*";
-                               action: STATE_SET "pressed" 0.0;
-                               target: "image.mask";
-                       }
-                       program {
-                               name: "unpressed";
-                               signal: "mouse,up,*";
-                               source: "*";
-                               action: STATE_SET "default" 0.0;
-                               target: "image.mask";
-                       }
-               }
-       }
-
-       group {
-               name: GROUP_ITEM_LAYOUT;
-
-               parts {
-                       part {
-                               name: PART_ICON;
-                               type: SWALLOW;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1.relative: 0.0 0.0;
-                                       rel2.relative: ICON_SIZE/ITEM_W ICON_SIZE/ITEM_H;
-                               }
-                       }
-                       part {
-                               name: PART_DELETE_BUTTON;
-                               type: SWALLOW;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1.relative: 0.0 0.0;
-                                       rel2.relative: ICON_DELETE_SIZE/ITEM_W ICON_DELETE_SIZE/ITEM_H;
-                               }
-                       }
-                       part {
-                               name: PART_NAME;
-                               type: TEXTBLOCK;
-                               scale: 1;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1.relative: 0.0 TEXT_Y/ITEM_H;
-                                       rel2.relative: 1.0 (TEXT_H+TEXT_Y)/ITEM_H;
-                                       text {
-                                               align: 0.5 0.0;
-                                               style: "text_style";
-                                       }
-                               }
-                       }
-               }
-       }
-}
index c37d993..41ea851 100644 (file)
@@ -55,14 +55,14 @@ void SettingsItem::setData(contacts_record_h record)
 Evas_Object *SettingsItem::onCreate(Evas_Object *parent)
 {
        Evas_Object *layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, layoutPath.c_str(), GROUP_ITEM_LAYOUT);
+       elm_layout_file_set(layout, layoutPath.c_str(), LAYOUT_ITEM);
        return layout;
 }
 
 Evas_Object *SettingsItem::createAddButton(Evas_Object *parent)
 {
        Evas_Object *button = elm_image_add(parent);
-       elm_image_file_set(button, layoutPath.c_str(), GROUP_ITEM_ICON);
+       elm_image_file_set(button, layoutPath.c_str(), LAYOUT_BUTTON_ADD);
        evas_object_smart_callback_add(button, "clicked",
                        makeCallback(&SettingsItem::onAddPressed), this);
 
@@ -72,7 +72,7 @@ Evas_Object *SettingsItem::createAddButton(Evas_Object *parent)
 Evas_Object *SettingsItem::createDeleteButton(Evas_Object *parent)
 {
        Evas_Object *button = elm_image_add(parent);
-       elm_image_file_set(button, layoutPath.c_str(), GROUP_DELETE_BUTTON);
+       elm_image_file_set(button, layoutPath.c_str(), LAYOUT_BUTTON_DEL);
        evas_object_smart_callback_add(button, "clicked",
                        makeCallback(&SettingsItem::onDeletePressed), this);
 
@@ -82,8 +82,8 @@ Evas_Object *SettingsItem::createDeleteButton(Evas_Object *parent)
 void SettingsItem::setEmptyLayout()
 {
        Evas_Object *layout = getEvasObject();
-       elm_object_part_content_set(layout, PART_ICON, createAddButton(layout));
-       elm_object_part_content_set(layout, PART_DELETE_BUTTON, nullptr);
+       elm_object_part_content_set(layout, PART_THUMBNAIL, createAddButton(layout));
+       elm_object_part_content_set(layout, PART_BUTTON_DEL, nullptr);
 
        char buffer[TEXT_BUFFER_SIZE];
        snprintf(buffer, sizeof(buffer), "%d", m_Number);
@@ -103,8 +103,8 @@ void SettingsItem::setLayoutData(contacts_record_h record)
        Evas_Object *layout = getEvasObject();
        Thumbnail *thumbnail = Thumbnail::create(layout, Thumbnail::SizeLarge, imagePath);
 
-       elm_object_part_content_set(layout, PART_ICON, thumbnail->getEvasObject());
-       elm_object_part_content_set(layout, PART_DELETE_BUTTON, createDeleteButton(layout));
+       elm_object_part_content_set(layout, PART_THUMBNAIL, thumbnail->getEvasObject());
+       elm_object_part_content_set(layout, PART_BUTTON_DEL, createDeleteButton(layout));
 
        char buffer[TEXT_BUFFER_SIZE];
        snprintf(buffer, sizeof(buffer), "%d. %s", m_Number, name);
index 5ae6544..b067e4a 100644 (file)
 #include "App/Path.h"
 #include "Common/Database/RecordUtils.h"
 #include "Ui/Scale.h"
-#include "Utils/Callback.h"
 
 #include "SpeedDialLayout.h"
-#include "SpeedDialLayoutMetrics.h"
 
 #define ITEM_ROWS 3
 #define ITEM_COLS SPEED_DIAL_ITEM_COUNT / ITEM_ROWS
@@ -56,12 +54,12 @@ SettingsView::~SettingsView()
 Evas_Object *SettingsView::onCreate(Evas_Object *parent)
 {
        Evas_Object *layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, layoutPath.c_str(), GROUP_MAIN_LAYOUT);
+       elm_layout_file_set(layout, layoutPath.c_str(), LAYOUT_MAIN);
 
        Evas_Object *table = elm_table_add(layout);
        elm_object_part_content_set(layout, PART_CONTENT, table);
        elm_table_homogeneous_set(table, EINA_TRUE);
-       elm_table_padding_set(table, Ui::getScaledValue(ITEM_PAD_X), Ui::getScaledValue(ITEM_PAD_Y));
+       elm_table_padding_set(table, Ui::getScaledValue(ITEM_PAD_W), Ui::getScaledValue(ITEM_PAD_H));
 
        for (int i = 0, k = 0; i < ITEM_ROWS; ++i) {
                for (int j = 0; j < ITEM_COLS; ++j, ++k) {