Support Iot headed layout requirement 23/245523/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 12 Oct 2020 02:54:00 +0000 (11:54 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 12 Oct 2020 02:54:00 +0000 (11:54 +0900)
Change-Id: I527b3e1db4e75a3ae66868183b33be79f4070462
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
CMakeLists.txt
res/common/edje/main_layout.edc [new file with mode: 0644]
src/option.cpp

index 3748000..038a1e1 100644 (file)
@@ -291,6 +291,15 @@ ADD_DEPENDENCIES(${PROJECT_NAME} popup_custom.edj)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/res/common/edje/popup_custom.edj DESTINATION
 ${ISE_RESDIR}/edje/common)
 
+ADD_CUSTOM_TARGET(main_layout.edj COMMAND edje_cc
+        -id ${CMAKE_CURRENT_SOURCE_DIR}/edje/common/images
+        ${CMAKE_CURRENT_SOURCE_DIR}/res/common/edje/main_layout.edc
+        ${CMAKE_BINARY_DIR}/res/common/edje/main_layout.edj
+        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/common/edje/main_layout.edc)
+ADD_DEPENDENCIES(${PROJECT_NAME} main_layout.edj)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/res/common/edje/main_layout.edj DESTINATION
+${ISE_RESDIR}/edje/common)
+
 else()
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/res/mobile/edje)
 ADD_CUSTOM_TARGET(w-input-stt.edj COMMAND edje_cc
diff --git a/res/common/edje/main_layout.edc b/res/common/edje/main_layout.edc
new file mode 100644 (file)
index 0000000..050b119
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+#define PADDING_SIZE 40
+#define PADDING_BOTTOM_SIZE 30
+
+collections
+{
+       base_scale: 1.8;
+
+       group { "main_layout";
+               parts {
+                       rect { "base";
+                               desc { "default";
+                                       color: 238 239 241 255;
+                               }
+                       }
+                       spacer { "padding.left"; scale;
+                               desc { "default";
+                                       min: PADDING_SIZE 0;
+                                       max: PADDING_SIZE -1;
+                                       fixed: 1 0;
+                                       align: 0.0 0.0;
+                                       rel.to: "base";
+                               }
+                       }
+                       spacer { "padding.right"; scale;
+                               desc { "default";
+                                       min: PADDING_SIZE 0;
+                                       max: PADDING_SIZE -1;
+                                       fixed: 1 0;
+                                       align: 1.0 0.0;
+                                       rel.to: "base";
+                               }
+                       }
+                       swallow { "elm.swallow.content";
+                               desc { "default";
+                                       rel1 { relative: 1.0 0.0; to: "padding.left"; }
+                                       rel2 { relative: 0.0 0.0;
+                                               to_x: "padding.right";
+                                               to_y: "padding.bottom";
+                                       }
+                               }
+                       }
+                       spacer { "padding.bottom"; scale;
+                               desc { "default";
+                                       min: 0 PADDING_BOTTOM_SIZE;
+                                       max: -1 PADDING_BOTTOM_SIZE;
+                                       fixed: 0 1;
+                                       align: 0.0 1.0;
+                                       rel.to: "base";
+                               }
+                       }
+               }
+       }
+}
index 83c5985..cf53796 100644 (file)
@@ -44,6 +44,7 @@ static ISELanguageManager _language_manager;
 #define IMG_POPUP_DIM_BG                RESDIR"/tv/images/bg_dimmed_bk_95.9.png"
 #define IMG_POPUP_BAR_LINE              RESDIR"/tv/images/img_popup_bar_line.png"
 #define IMG_POPUP_BAR_SHADOW            RESDIR"/tv/images/img_popup_bar_shadow.png"
+#define OPTION_LAYOUT_EDJ               RESDIR"/edje/common/main_layout.edj"
 
 #define BUF_SIZE                    256
 #define OPTION_MAX_LANGUAGES        255
@@ -1127,6 +1128,10 @@ static Elm_Object_Item * append_item(Evas_Object *genlist, enum SETTING_ITEM_ID
 Evas_Object* create_option_main_view(Evas_Object *parent, Evas_Object *naviframe, SCLOptionWindowType type)
 {
     Evas_Object *genlist = NULL;
+#ifdef _COMMON
+    Evas_Object *layout = NULL;
+#endif
+
     if (CHECK_ARRAY_INDEX(type, OPTION_WINDOW_TYPE_MAX)) {
         create_genlist_item_classes(type);
 
@@ -1136,10 +1141,16 @@ Evas_Object* create_option_main_view(Evas_Object *parent, Evas_Object *naviframe
         elm_object_theme_set(genlist, option_elements[type].list_theme);
         evas_object_smart_callback_add(genlist, "pressed", _gl_pressed_cb, NULL);
         evas_object_smart_callback_add(genlist, "released", _gl_released_cb, NULL);
+        elm_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
 #endif
 
 #ifdef _COMMON
         evas_object_smart_callback_add(genlist, "realized", _gl_realized_cb, NULL);
+
+        layout = elm_layout_add(naviframe);
+        elm_layout_file_set(layout, OPTION_LAYOUT_EDJ, "main_layout");
+        elm_object_content_set(layout, genlist);
+        evas_object_show(layout);
 #endif
 
 #ifdef _CIRCLE
@@ -1255,7 +1266,11 @@ Evas_Object* create_option_main_view(Evas_Object *parent, Evas_Object *naviframe
 #endif
     }
 
+#ifdef _COMMON
+    return layout;
+#else
     return genlist;
+#endif
 }
 
 static Evas_Object* create_option_language_view(Evas_Object *naviframe)
@@ -1658,7 +1673,6 @@ option_window_created(Evas_Object *window, SCLOptionWindowType type)
     elm_object_part_content_set(mlayout, "bar_shadow", bar_shadow);
 
     Evas_Object *list = create_option_main_view(mlayout, mlayout, type);
-    elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
     elm_object_part_content_set(mlayout, "part.list", list);
 #else
     Evas_Object *conformant = elm_conformant_add(window);