Share Panel for IOT profile 62/251062/3 submit/tizen/20210108.103827
authorJagrat Patidar <j1.patidar@samsung.com>
Thu, 7 Jan 2021 09:53:14 +0000 (15:23 +0530)
committerJagrat Patidar <j1.patidar@samsung.com>
Fri, 8 Jan 2021 10:24:39 +0000 (15:54 +0530)
Change-Id: I884b9e1dcd8bd13d3a1e17872f68c1a8a62a3a3e

22 files changed:
Build/flags.mk
inc/conf.h
inc/grid.h
inc/index.h [deleted file]
inc/page.h [deleted file]
inc/scroller.h [deleted file]
inc/share_panel_internal.h
inc/utils.h
project_def.prop
res/edje/item.edc
res/edje/layout.edc
res/edje/page.edc [deleted file]
res/images/close.png [new file with mode: 0644]
res/images/share_panel_bg.png [new file with mode: 0644]
res/images/share_panel_bg_fhd.png [new file with mode: 0644]
src/grid.c
src/index.c [deleted file]
src/page.c [deleted file]
src/scroller.c [deleted file]
src/share_panel.c
src/ui_manager.c
src/utils.c

index 1f3c7f8147a92ccfb2d95b55cf1681554bdd002f..0eb7e41914df20bd26e7224070a48a94f6b8a838 100755 (executable)
@@ -1,16 +1,35 @@
+# Add tools flags defines
 
-DEBUG_OP = -g3 
-CPP_DEBUG_OP = 
+ifeq ($(strip $(BUILD_CONFIG)),Debug)
+OPTIMIZATION_OP := -O0
+DEBUG_OP := -g3 -D_DEBUG
+CPP_OPTIMIZATION_OP := -O0
+CPP_DEBUG_OP := -g3 -D_DEBUG
+LINK_OP :=
+else
+ifeq ($(strip $(BUILD_CONFIG)),Release)
+OPTIMIZATION_OP := -O3
+DEBUG_OP :=
+CPP_OPTIMIZATION_OP := -O3
+CPP_DEBUG_OP :=
+LINK_OP := -s
+endif
+endif
 
-OPTIMIZATION_OP = -O0 
-CPP_OPTIMIZATION_OP = 
+ifeq ($(STRIP_INFO),off)
+LINK_OP :=
+else
+ifeq ($(STRIP_INFO),on)
+LINK_OP := -s
+endif
+endif
 
-COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0 -fPIC 
+COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0
 
-CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) 
+CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) -Wall -c -fmessage-length=0 -std=c++11
 
-LINK_FLAGS = -shared -Wl,--no-undefined 
+LINK_FLAGS = -L"$(PROJ_PATH)/lib" -Wl,--no-undefined $(LINK_OP)
 
 AR_FLAGS = 
 
-EDC_COMPILE_FLAGS = 
\ No newline at end of file
+EDC_COMPILE_FLAGS = -id "$(PROJ_PATH)/edje/images"  -sd "$(PROJ_PATH)/edje/sounds" -fd "$(PROJ_PATH)/edje/fonts"
index 8428a1db1000f46159bbcbff6c960cf9e18774ef..3fa334ff631c7a648b9e058bd8b5d6557295ebce 100755 (executable)
  * @{
  */
 
-#define BASE_WIDTH 480 /**<Base layout width*/
-#define BASE_HEIGHT 800 /**<Base layout height*/
+#define BASE_WIDTH 1280 /**<Base layout width*/
+#define BASE_HEIGHT 245 /**<Base layout height*/
+#define BASE_HEIGHT_FHD 368 /**<Base FHD layout height*/
 
 /* ITEM_ICON is changed from 74 to 63 about 87% decrease because of resolution issues. */
-#define ITEM_ICON_WIDTH 63 /**<Width of the item's icon*/
-#define ITEM_ICON_HEIGHT 63 /**<Height of the item's icon*/
+#define ITEM_ICON_WIDTH 80 /**<Width of the item's icon*/
+#define ITEM_ICON_HEIGHT 80 /**<Height of the item's icon*/
+
+#define ITEM_ICON_WIDTH_FHD 120 /**<Width of the item's icon*/
+#define ITEM_ICON_HEIGHT_FHD 120 /**<Height of the item's icon*/
+
+#define ITEM_WIDTH_FHD 184 /**<Width of the item's icon*/
+#define ITEM_HEIGHT_FHD 200 /**<Height of the item's icon*/
 
 /* ITEM_WIDTH is changed from 123 to 107 about 87% decrease because of resolution issues. */
-#define ITEM_WIDTH 118 /**<Width of the item*/
+#define ITEM_WIDTH 120 /**<Width of the item*/
 /* ITEM_HEIGHT is changed from 166 to 144 about 87% decrease because of resolution issues. */
-#define ITEM_HEIGHT 144 /**<Height of the item*/
+#define ITEM_HEIGHT 120 /**<Height of the item*/
 
 #define INDEX_HEIGHT 50 /**<Height of the index*/
 #define TITLE_HEIGHT 54 /**<Height of the title*/
index bc491a4abdc4f4b0d6c73800e3a90bd139f25ff3..084fed1a8e64b07b2654e1dae2c0781f2a4d3afe 100755 (executable)
 /**
  * @brief Creates grid of applications that meet sharing requirements.
  *
- * @param page The page widget
+ * @param ui_manager share_panel layout
+ *
+ * @param share_panel share_panel handle
  *
  * @return created grid
  */
-extern Evas_Object *_grid_create(Evas_Object *page);
+extern Evas_Object *_grid_create(Evas_Object *ui_manager, share_panel_h share_panel);
 
 /**
  * @brief Destroys the application grid.
diff --git a/inc/index.h b/inc/index.h
deleted file mode 100755 (executable)
index 431cf8e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2020 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 __TIZEN_SHARE_PANEL_INDEX_H__
-#define __TIZEN_SHARE_PANEL_INDEX_H__
-
-#include <Evas.h>
-
-/**
- * @ingroup View
- * @defgroup Index Index
- * @addtogroup Index
- * @{
- */
-
-/**
- * @brief Creates share panel page index.
- *
- * @param ui_manager The parent layout
- * @param count Number of pages
- *
- * @return created index
- */
-extern Evas_Object *_index_create(Evas_Object *ui_manager, unsigned int count);
-
-/**
- * @brief Updates the index status.
- *
- * @param index The index to be updated
- * @param count Number of pages
- */
-extern void _index_update(Evas_Object *index, unsigned int count);
-
-/**
- * @brief Destroys index.
- *
- * @param index The index to be destroyed
- */
-extern void _index_destroy(Evas_Object *index);
-
-/**
- * @brief Sets index page.
- *
- * @param index The index object to be set
- * @param idx The index
- */
-extern void _index_bring_in(Evas_Object *index, int idx);
-
-/**
- * @}
- */
-
-#endif //__TIZEN_SHARE_PANEL_INDEX_H__
diff --git a/inc/page.h b/inc/page.h
deleted file mode 100755 (executable)
index 03f5808..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2020 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 __TIZEN_SHARE_PANEL_PAGE_H__
-#define __TIZEN_SHARE_PANEL_PAGE_H__
-
-#include <Elementary.h>
-
-/**
- * @ingroup View
- * @defgroup Page Page
- * @addtogroup Page
- * @{
- */
-
-/**
- * @brief Creates share panel scroller's page.
- *
- * @param scroller The scroller where to add page
- * @param page_width Width of the page
- * @param page_height Height of the page
- *
- * @return created page
- */
-extern Evas_Object *_page_create(Evas_Object *scroller, int page_width, int page_height);
-
-/**
- * @brief Destroys scroller's page.
- *
- * @param page The page to be destroyed
- */
-extern void _page_destroy(Evas_Object *page);
-
-/**
- * @}
- */
-
-#endif /* __TIZEN_SHARE_PANEL_PAGE_H__ */
diff --git a/inc/scroller.h b/inc/scroller.h
deleted file mode 100755 (executable)
index 52d82b0..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2020 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 __TIZEN_SHARE_PANEL_SCROLLER_H__
-#define __TIZEN_SHARE_PANEL_SCROLLER_H__
-
-#include <Elementary.h>
-
-/**
- * @ingroup View
- * @defgroup Scroller Scroller
- * @addtogroup Scroller
- * @{
- */
-
-/**
- * @brief Enumerations for share panel event error.
- */
-typedef enum {
-       SCROLLER_EVENT_TYPE_INVALID = 0,
-       SCROLLER_EVENT_TYPE_SCROLL,
-       SCROLLER_EVENT_TYPE_APPEND_PAGE,
-       SCROLLER_EVENT_TYPE_REMOVE_PAGE,
-       SCROLLER_EVENT_TYPE_MAX,
-} scroller_event_type_e;
-
-/**
- * @brief Creates application page scroller.
- *
- * @param ui_manager The main parent layout
- * @param share_panel The share panel info structure
- *
- * @return created scroller
- */
-extern Evas_Object *_scroller_create(Evas_Object *ui_manager, share_panel_s *share_panel);
-
-/**
- * @brief Destroys application page scroller.
- *
- * @param scroller The scroller to be destroyed
- */
-extern void _scroller_destroy(Evas_Object *scroller);
-
-/**
- * @brief Appends new page to the scroller.
- *
- * @param scroller The scroller widget
- * @param page The page to be appended
- */
-extern void _scroller_append_page(Evas_Object *scroller, Evas_Object *page);
-
-/**
- * @brief Appends list items into the scroller.
- *
- * @param scroller The scroller widget
- * @param list The list of applications to be appended
- * @param page_width Width of the pages to be appended
- * @param page_height Height of the pages to be appended
- */
-extern void _scroller_append_list(Evas_Object *scroller, Eina_List *list, int page_width, int page_height);
-
-/**
- * @brief Removes list items from the scroller.
- *
- * @param scroller The scroller widget
- * @param list The list of applications to be removed
- */
-extern void _scroller_remove_list(Evas_Object *scroller, Eina_List *list);
-
-/**
- * @brief Gets region of the scroller's index.
- *
- * @param scroller The scroller widget
- *
- * @return index's region
- */
-extern int _scroller_get_region_index(Evas_Object *scroller);
-
-/**
- * @brief Gets the number of pages in scroller's box.
- *
- * @param scroller The scroller widget
- *
- * @return number of pages
- */
-extern unsigned int _scroller_count(Evas_Object *scroller);
-
-/**
- * @brief Registers scroller event callbacks.
- *
- * @param scroller The scroller widget
- * @param event_type The type of the event
- * @param event_cb The callback function to be called
- * @param data The data to be passed to the event callback function
- *
- * @return share_panel_error_e enumeration value
- */
-extern int _scroller_register_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *data), void *data);
-
-/**
- * @brief Unregister scroller event callbacks.
- *
- * @param scroller The scroller widget
- * @param event_type The type of the event
- * @param event_cb The scroller's event callback function to be unregistered
- *
- * @return share_panel_error_e enumeration value
- */
-extern int _scroller_unregister_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *data));
-
-/**
- * @}
- */
-
-#endif /* __TIZEN_SHARE_PANEL_SCROLLER_H__ */
index 983db4a88ff35d9cfd353cd8357477b67fa333ce..6a63a96a91f7b33a2e48c7fbdd1081ab853960fb 100755 (executable)
@@ -47,8 +47,7 @@ enum {
 struct _share_panel {
        Evas_Object *win;
        Evas_Object *ui_manager;
-       Evas_Object *scroller;
-       Evas_Object *index;
+       Evas_Object *grid;
 
        Eina_List *list;
        Ecore_Idler *append_idler;
index c5b84387fa439aacf2f63edc5cd5645323278187..c1623164d78d0f0abfd9ab80bdbf6da050929c80 100755 (executable)
  * @return Absolute path for sub_path
  * @remarks The returned path should be released.
  */
-
 char *utils_get_res_file_path(char *sub_path);
 
+/**
+ * @brief Check if resolution is fhd
+ */
+bool utils_is_fhd();
+
+/**
+ * @brief Set boolean if fhd
+ */
+bool utils_set_fhd();
+
 /**
  * @}
  */
index 6390792a70d2b56f7ec39cf5c903a1844a8c32d7..137e7c0635f0210e16db0e0a8692d62cb3b73a03 100755 (executable)
@@ -9,7 +9,7 @@ type = app
 profile = mobile-4.0
 
 # C/CPP Sources
-USER_SRCS = src/page.c src/grid.c src/index.c src/list.c src/share_panel.c src/ui_manager.c src/utils.c src/scroller.c 
+USER_SRCS = src/grid.c src/list.c src/share_panel.c src/ui_manager.c src/utils.c
 
 # EDC Sources
 USER_EDCS =  
@@ -52,8 +52,8 @@ USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0 
 
-USER_EXT_EDC0_EDCS = res/edje/item.edc res/edje/page.edc res/edje/layout.edc 
-USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images 
+USER_EXT_EDC0_EDCS = res/edje/item.edc res/edje/layout.edc
+USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images res/images
 USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds 
 USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts 
 
index 0ec1109605d30d6644c369572b690e559a36f07e..5a4a9196dbae029a5b9fa983c4eda28f400dc36e 100755 (executable)
@@ -15,7 +15,7 @@
  */
 
 collections {
-       base_scale: 1.7;
+       base_scale: 1.8;
        group {
                name: "grid,icon";
                parts {
@@ -23,12 +23,13 @@ collections {
                                name: "bg";
                                type: RECT;
                                scale: 1;
-                               mouse_events: 0;
                                description {
                                        state: "default" 0.0;
                                        rel1 { relative: 0.0 0.0; }
                                        rel2 { relative: 1.0 1.0; }
-                                       color: 255 255 255 0;
+                                       color: 0 0 0 0;
+                                       min: 80 80;
+                                       max: 80 80;
                                        visible: 1;
                                }
                        }
@@ -36,13 +37,42 @@ collections {
                                name: "icon";
                                type: SWALLOW;
                                scale: 1;
-                               mouse_events: 1;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.5 0.55; to: "bg"; }
-                                       rel2 { relative: 0.5 0.55; to: "bg"; }
-                                       fixed: 1 1;
-                                       align: 0.5 0.5;
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                                       align: 0.5 0.0;
+                                       visible: 1;
+                               }
+                       }
+               }
+       }
+       group {
+               name: "grid,icon,fhd";
+               parts {
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color: 0 0 0 0;
+                                       min: 120 120;
+                                       max: 120 120;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "icon";
+                               type: SWALLOW;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                                       align: 0.5 0.0;
                                        visible: 1;
                                }
                        }
index 6eb47b5498180442759834d90206026e86a415a8..fba1c160a1ef8575d461866272b00cd167ad2d96 100755 (executable)
 styles {
        style {
                name: "text_style";
-               base: "font=Tizen:style=Regular font_size=50 color=#3DBACD align=center wrap=mixed ellipsis=-1";
+               base: "font=Tizen:style=Regular font_size=30 color=#000000 align=center wrap=mixed ellipsis=-1";
+               tag:  "br" "\n";
+               tag:  "hilight" "+ font_weight=Bold";
+               tag:  "b" "+ font_weight=Bold";
+               tag:  "tab" "\t";
+       }
+       style {
+               name: "text_style_fhd";
+               base: "font=Tizen:style=Regular font_size=40 color=#000000 align=center wrap=mixed ellipsis=-1";
                tag:  "br" "\n";
                tag:  "hilight" "+ font_weight=Bold";
                tag:  "b" "+ font_weight=Bold";
@@ -28,9 +36,13 @@ styles {
 }
 
 collections {
-       base_scale: 2.6;
+       base_scale: 1.8;
        group {
                name: "layout";
+               images {
+                       image: share_panel_bg.png COMP;
+                       image: close.png COMP;
+               }
                parts {
                        part {
                                name: "bg";
@@ -41,7 +53,7 @@ collections {
                                        rel1 { relative: 0.0 0.0; }
                                        rel2 { relative: 1.0 1.0; }
                                        visible: 1;
-                                       color: 8 8 8 80;
+                                       color: 0 0 0 0;
                                }
                        }
                        part {
@@ -61,8 +73,8 @@ collections {
                                repeat_events: 1;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.5 1.0; }
-                                       rel2 { relative: 0.5 1.0; }
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
                                        align: 0.5 1.0;
                                        fixed: 1 1;
                                        visible: 1;
@@ -70,14 +82,51 @@ collections {
                                description {
                                        state: "1line" 0.0;
                                        inherit: "default" 0.0;
-                                       rel1 { relative: 0.5 1.15; }
-                                       rel2 { relative: 0.5 1.15; }
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
                                }
                                description {
                                        state: "1line,land" 0.0;
                                        inherit: "default" 0.0;
-                                       rel1 { relative: 0.5 1.25; }
-                                       rel2 { relative: 0.5 1.25; }
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                               }
+                       }
+                       part {
+                               name: "scroller,bg,cover";
+                               type: IMAGE;
+                               description {
+                                       state: "default" 0.0;
+                                       image { normal: share_panel_bg.png;}
+                                       min: 1280 245;
+                                       max: 1280 245;
+                                       align: 0.5 1;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "scroller,bg";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1.to: "scroller,bg,cover";
+                                       rel2.to: "scroller,bg,cover";
+                                       min: 1034 150;
+                                       max: 1034 150;
+                                       visible: 1;
+                                       align: 0.5 0.65;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "scroller";
+                               type: SWALLOW;
+                               scale: 1;
+                               description {
+                                       rel1.to: "scroller,bg";
+                                       rel2.to: "scroller,bg";
+                                       visible: 1;
+                                       align: 0.5 0;
                                }
                        }
                        part {
@@ -85,10 +134,10 @@ collections {
                                type: RECT;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 (BASE_HEIGHT-PANEL_HEIGHT)/BASE_HEIGHT; to: "fixed_bg"; }
-                                       rel2 { relative: 1.0 (BASE_HEIGHT-(SCROLLER_HEIGHT+INDEX_HEIGHT))/BASE_HEIGHT; to: "fixed_bg"; }
+                                       rel1 { relative: 500/1280 0.0; to: "scroller,bg,cover"; }
+                                       rel2 { relative: 780/1280 80/245 ; to: "scroller,bg,cover"; }
                                        visible: 1;
-                                       color: 250 250 250 255;
+                                       color: 0 0 0 0;
                                }
                        }
                        part {
@@ -106,15 +155,144 @@ collections {
                                        }
                                }
                        }
+                       part {
+                               name: "close_bg";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 1150/1280 0.0; to: "scroller,bg,cover"; }
+                                       rel2 { relative: 1 80/245 ; to: "scroller,bg,cover"; }
+                                       visible: 1;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "close";
+                               type: IMAGE;
+                               scale: 1;
+                               description {
+                                       rel1.to: "close_bg";
+                                       rel2.to: "close_bg";
+                                       image { normal: close.png;}
+                                       min: 18 18;
+                                       max: 18 18;
+                                       align: 0.5 0.5;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "close_btn_focus";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 36/130 121/245; to: "close_bg"; }
+                                       rel2 { relative: 94/130 179/245; to: "close_bg"; }
+                                       visible: 1;
+                                       color: 0 0 0 0;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "1line";
+                               signal: "1line";
+                               source: "fixed_bg";
+                               action: STATE_SET "1line" 0.0;
+                               target: "fixed_bg";
+                       }
+                       program {
+                               name: "1line,land";
+                               signal: "1line,land";
+                               source: "fixed_bg";
+                               action: STATE_SET "1line,land" 0.0;
+                               target: "fixed_bg";
+                       }
+                 program { name: "close_area_btn_clicked";
+                  signal: "mouse,clicked,1";
+                  source: "close_btn_focus";
+               }
+               }
+       } //group
+
+       group {
+               name: "layout_fhd";
+               images {
+                       image: share_panel_bg_fhd.png COMP;
+                       image: close.png COMP;
+               }
+               parts {
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       visible: 1;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "event";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "fixed_bg";
+                               type: SWALLOW;
+                               repeat_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                                       align: 0.5 1.0;
+                                       fixed: 1 1;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "1line" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                               }
+                               description {
+                                       state: "1line,land" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg"; }
+                                       rel2 { relative: 1.0 1.0; to: "bg"; }
+                               }
+                       }
+                       part {
+                               name: "scroller,bg,cover";
+                               type: IMAGE;
+                               description {
+                                       state: "default" 0.0;
+                                       image { normal: share_panel_bg_fhd.png;}
+                                       min: 1935 395;
+                                       max: 1935 395;
+                                       align: 0.5 1;
+                                       visible: 1;
+                               }
+                       }
                        part {
                                name: "scroller,bg";
                                type: RECT;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 (BASE_HEIGHT-(SCROLLER_HEIGHT+INDEX_HEIGHT))/BASE_HEIGHT; to: "fixed_bg"; }
-                                       rel2 { relative: 1.0 (BASE_HEIGHT-INDEX_HEIGHT)/BASE_HEIGHT; to: "fixed_bg"; }
+                                       rel1.to: "scroller,bg,cover";
+                                       rel2.to: "scroller,bg,cover";
+                                       min: 1552 300;
+                                       max: 1552 300;
                                        visible: 1;
-                                       color: 250 250 250 255;
+                                       align: 0.5 0.5;
+                                       color: 0 0 0 0;
                                }
                        }
                        part {
@@ -125,45 +303,69 @@ collections {
                                        rel1.to: "scroller,bg";
                                        rel2.to: "scroller,bg";
                                        visible: 1;
-                                       fixed: 1 1;
+                                       align: 0.5 0;
                                }
                        }
                        part {
-                               name: "index,bg";
+                               name: "title,bg";
                                type: RECT;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 (BASE_HEIGHT-INDEX_HEIGHT)/BASE_HEIGHT; to: "fixed_bg"; }
-                                       rel2 { relative: 1.0 1.0; to: "fixed_bg"; }
+                                       rel1 { relative: 800/1935 0.0; to: "scroller,bg,cover"; }
+                                       rel2 { relative: 1120/1935 80/395 ; to: "scroller,bg,cover"; }
                                        visible: 1;
-                                       color: 250 250 250 255;
+                                       color: 0 0 0 0;
                                }
                        }
                        part {
-                               name: "index";
-                               type: SWALLOW;
+                               name: "title";
+                               type: TEXTBLOCK;
                                scale: 1;
                                description {
-                                       rel1.to: "index,bg";
-                                       rel2.to: "index,bg";
+                                       rel1.to: "title,bg";
+                                       rel2.to: "title,bg";
                                        visible: 1;
-                                       fixed: 1 1;
+                                       text {
+                                               style: "text_style_fhd";
+                                               text: "share panel";
+                                               align: 0.5 0.5;
+                                       }
                                }
                        }
                        part {
-                               name: "blocker";
+                               name: "close_bg";
                                type: RECT;
                                description {
                                        state: "default" 0.0;
-                                       rel1.to: "bg";
-                                       rel2.to: "bg";
-                                       visible: 0;
-                                       color: 255 255 255 0;
+                                       rel1 { relative: 1736/1935 0.0; to: "scroller,bg,cover"; }
+                                       rel2 { relative: 1 80/395 ; to: "scroller,bg,cover"; }
+                                       visible: 1;
+                                       color: 0 0 0 0;
                                }
+                       }
+                       part {
+                               name: "close";
+                               type: IMAGE;
+                               scale: 1;
                                description {
-                                       state: "show" 0.0;
-                                       inherit: "default" 0.0;
+                                       rel1.to: "close_bg";
+                                       rel2.to: "close_bg";
+                                       image { normal: close.png;}
+                                       min: 18 18;
+                                       max: 18 18;
+                                       align: 0.5 0.5;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "close_btn_focus";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                 rel1.to: "close_bg";
+                                       rel2.to: "close_bg";
                                        visible: 1;
+                                       color: 0 0 0 0;
                                }
                        }
                }
@@ -182,20 +384,10 @@ collections {
                                action: STATE_SET "1line,land" 0.0;
                                target: "fixed_bg";
                        }
-                       program {
-                               name: "block,hide";
-                               signal: "hide";
-                               source: "blocker";
-                               action: STATE_SET "default" 0.0;
-                               target: "blocker";
-                       }
-                       program {
-                               name: "block,show";
-                               signal: "show";
-                               source: "blocker";
-                               action: STATE_SET "show" 0.0;
-                               target: "blocker";
-                       }
+                 program { name: "close_area_btn_clicked";
+                  signal: "mouse,clicked,1";
+                  source: "close_btn_focus";
+               }
                }
        } //group
 } //collections
diff --git a/res/edje/page.edc b/res/edje/page.edc
deleted file mode 100755 (executable)
index 8765251..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2020 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.
- */
-
-collections {
-       base_scale: 1.7;
-       group {
-               name: "page";
-               parts {
-                       part {
-                               name: "bg";
-                               type: SWALLOW;
-                               scale: 1;
-                               mouse_events: 0;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.0 0.0; }
-                                       rel2 { relative: 1.0 1.0; }
-                                       visible: 1;
-                               }
-                       }
-                       part {
-                               name: "grid";
-                               type: SWALLOW;
-                               scale: 1;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1.to: "bg";
-                                       rel2.to: "bg";
-                                       visible: 1;
-                                       fixed: 1 1;
-                               }
-                       }
-               }
-       } // group
-} // collections
-
-
-
-// End of file
diff --git a/res/images/close.png b/res/images/close.png
new file mode 100644 (file)
index 0000000..766201e
Binary files /dev/null and b/res/images/close.png differ
diff --git a/res/images/share_panel_bg.png b/res/images/share_panel_bg.png
new file mode 100644 (file)
index 0000000..41bdeea
Binary files /dev/null and b/res/images/share_panel_bg.png differ
diff --git a/res/images/share_panel_bg_fhd.png b/res/images/share_panel_bg_fhd.png
new file mode 100644 (file)
index 0000000..7d87367
Binary files /dev/null and b/res/images/share_panel_bg_fhd.png differ
index 9fad79934879c2fd6d4caaa1dbd6cd62dc548c5b..8338bfe6917ecdc2593618ac17ad96be1a4ad2a8 100755 (executable)
 #include <app_control_internal.h>
 #include <bundle.h>
 #include <aul.h>
+#include <glib.h>
 
 #include "share_panel.h"
 #include "share_panel_internal.h"
-
 #include "conf.h"
 #include "grid.h"
 #include "log.h"
@@ -47,9 +47,13 @@ static char *__text_get(void *data, Evas_Object *obj, const char *part)
        retv_if(!info, NULL);
 
        retv_if(!info->name, NULL);
-       if (!strcmp(part, "elm.text"))
-               return strdup(D_(info->name));
-
+       if (!strcmp(part, "elm.text")) {
+               if (!utils_is_fhd()) {
+                       return g_strdup_printf("<align=center><font_size=%d>%s</font_size></align>", 12, info->name);
+               } else {
+                       return g_strdup_printf("<align=center><font_size=%d>%s</font_size></align>", 18, info->name);
+               }
+       }
        return NULL;
 }
 
@@ -75,7 +79,11 @@ static Evas_Object *__add_icon(Evas_Object *parent, const char *file)
                return NULL;
        }
 
-       evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(ITEM_ICON_WIDTH), ELM_SCALE_SIZE(ITEM_ICON_HEIGHT));
+       if (!utils_is_fhd()) {
+               evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(ITEM_ICON_WIDTH), ELM_SCALE_SIZE(ITEM_ICON_HEIGHT));
+       } else {
+               evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(ITEM_ICON_WIDTH_FHD), ELM_SCALE_SIZE(ITEM_ICON_HEIGHT_FHD));
+       }
 
        elm_image_preload_disabled_set(icon, EINA_TRUE);
        elm_image_smooth_set(icon, EINA_TRUE);
@@ -87,9 +95,13 @@ static Evas_Object *__add_icon(Evas_Object *parent, const char *file)
 
        char *edj_path = utils_get_res_file_path("edje/item.edj");
 
-       elm_layout_file_set(icon_layout, edj_path, "grid,icon");
+       if (!utils_is_fhd()) {
+               elm_layout_file_set(icon_layout, edj_path, "grid,icon");
+       } else {
+               elm_layout_file_set(icon_layout, edj_path, "grid,icon,fhd");
+       }
        evas_object_size_hint_weight_set(icon_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(icon_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_align_set(icon_layout, 0.5, 1);
        evas_object_show(icon_layout);
 
        elm_object_part_content_set(icon_layout, "icon", icon);
@@ -105,7 +117,7 @@ static Evas_Object *__content_get(void *data, Evas_Object *obj, const char *part
 
        retv_if(!info, NULL);
 
-       if (!strcmp(part, "elm.swallow.end")) {
+       if (!strcmp(part, "elm.end")) {
                Evas_Object *bg = evas_object_rectangle_add(evas_object_evas_get(obj));
                retv_if(!bg, NULL);
 
@@ -113,7 +125,7 @@ static Evas_Object *__content_get(void *data, Evas_Object *obj, const char *part
                evas_object_color_set(bg, 0, 0, 0, 0);
                evas_object_show(bg);
                return bg;
-       } else if (!strcmp(part, "elm.swallow.icon")) {
+       } else if (!strcmp(part, "elm.icon")) {
                retv_if(!info->icon, NULL);
                return __add_icon(obj, info->icon);
        } else if (!strcmp(part, "selected")) {
@@ -234,25 +246,30 @@ static void __lang_changed_cb(void *data, Evas_Object *grid, void *event_info)
        }
 }
 
-Evas_Object *_grid_create(Evas_Object *page)
+Evas_Object *_grid_create(Evas_Object *ui_manager, share_panel_h share_panel)
 {
        Evas_Object *grid = NULL;
 
-       retv_if(!page, NULL);
+       retv_if(!ui_manager, NULL);
 
-       grid = elm_gengrid_add(page);
+       grid = elm_gengrid_add(ui_manager);
        if (!grid) {
                _grid_destroy(grid);
                return NULL;
        }
 
        evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_align_set(grid, 0.5, EVAS_HINT_FILL);
 
-       elm_gengrid_item_size_set(grid, ELM_SCALE_SIZE(ITEM_WIDTH), ELM_SCALE_SIZE(ITEM_HEIGHT));
-       elm_gengrid_align_set(grid, 0.0, 0.0);
-       elm_gengrid_horizontal_set(grid, EINA_FALSE);
+       if (!utils_is_fhd()) {
+           elm_gengrid_item_size_set(grid, ELM_SCALE_SIZE(ITEM_WIDTH), ELM_SCALE_SIZE(ITEM_HEIGHT));
+       } else {
+           elm_gengrid_item_size_set(grid, ELM_SCALE_SIZE(ITEM_WIDTH_FHD), ELM_SCALE_SIZE(ITEM_HEIGHT_FHD));
+       }
+       elm_gengrid_align_set(grid, 0.5, 0.65);
+       elm_gengrid_horizontal_set(grid, EINA_TRUE);
        elm_gengrid_multi_select_set(grid, EINA_FALSE);
+       elm_gengrid_scroller_policy_set(grid, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
 
        grid_info.gic = elm_gengrid_item_class_new();
        if (!grid_info.gic) {
@@ -264,11 +281,27 @@ Evas_Object *_grid_create(Evas_Object *page)
        grid_info.gic->func.content_get = __content_get;
        grid_info.gic->func.state_get = NULL;
        grid_info.gic->func.del = __del;
-       grid_info.gic->item_style = "type2";
+       grid_info.gic->item_style = "1line_out";
 
        evas_object_smart_callback_add(grid, "language,changed", __lang_changed_cb, NULL);
 
        elm_scroller_movement_block_set(grid, ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
+
+       Elm_Object_Item *temp = NULL;
+       for (int i=0; i<share_panel->list_count; i++) {
+               Evas_Object *item = NULL;
+               item_s *item_info = eina_list_nth(share_panel->list, i);
+
+               if(i == 0){
+                       temp = _grid_append_item(grid, item_info);
+               } else {
+                       _grid_append_item(grid, item_info);
+               }
+       }
+
+       if (temp) {
+               elm_gengrid_item_show(temp, ELM_GENGRID_ITEM_SCROLLTO_NONE);
+       }
        evas_object_show(grid);
 
        return grid;
@@ -277,7 +310,6 @@ Evas_Object *_grid_create(Evas_Object *page)
 void _grid_destroy(Evas_Object *grid)
 {
        ret_if(!grid);
-
        evas_object_del(grid);
 }
 
diff --git a/src/index.c b/src/index.c
deleted file mode 100755 (executable)
index b765153..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2020 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 <Elementary.h>
-
-#include "log.h"
-#include "index.h"
-
-#define PRIVATE_DATA_KEY_CUR "pdkc"
-
-
-
-void _index_destroy(Evas_Object *index)
-{
-       ret_if(NULL == index);
-
-       evas_object_data_del(index, PRIVATE_DATA_KEY_CUR);
-       elm_index_item_clear(index);
-       evas_object_del(index);
-}
-
-
-
-Evas_Object *_index_create(Evas_Object *ui_manager, unsigned int count)
-{
-       Evas_Object *index = NULL;
-       register int i = 0;
-
-       retv_if(NULL == ui_manager, NULL);
-
-       index = elm_index_add(ui_manager);
-       retv_if(NULL == index, NULL);
-       elm_object_style_set(index, "pagecontrol");
-
-       elm_index_horizontal_set(index, EINA_TRUE);
-       elm_index_autohide_disabled_set(index, EINA_TRUE);
-
-       for (; i < count; i++) {
-               elm_index_item_append(index, NULL, NULL, (void *) i);
-       }
-       elm_index_level_go(index, 0);
-       evas_object_data_set(index, PRIVATE_DATA_KEY_CUR, NULL);
-       evas_object_show(index);
-
-       return index;
-}
-
-
-
-void _index_update(Evas_Object *index, unsigned int count)
-{
-       register int i = 0;
-       int cur_index = 0;
-
-       elm_index_item_clear(index);
-
-       for (; i < count; i++) {
-               elm_index_item_append(index, NULL, NULL, (void *) i);
-       }
-       elm_index_level_go(index, 0);
-       evas_object_show(index);
-
-       cur_index = (int) evas_object_data_get(index, PRIVATE_DATA_KEY_CUR);
-       _index_bring_in(index, cur_index);
-}
-
-
-
-void _index_bring_in(Evas_Object *index, int idx)
-{
-       Elm_Object_Item *idx_it;
-
-       idx_it = elm_index_item_find(index, (void *) idx);
-       ret_if(NULL == idx_it);
-       elm_index_item_selected_set(idx_it, EINA_TRUE);
-
-       evas_object_data_set(index, PRIVATE_DATA_KEY_CUR, (void *) idx);
-}
diff --git a/src/page.c b/src/page.c
deleted file mode 100755 (executable)
index 35593d4..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2020 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 <Elementary.h>
-
-#include "share_panel_internal.h"
-#include "conf.h"
-#include "log.h"
-#include "page.h"
-#include "utils.h"
-
-Evas_Object *_page_create(Evas_Object *scroller, int page_width, int page_height)
-{
-       Evas_Object *page = NULL;
-       Evas_Object *page_bg = NULL;
-       Evas *e = NULL;
-
-       char *edj_path = utils_get_res_file_path("edje/page.edj");
-
-       page = elm_layout_add(scroller);
-       if(!page) {
-               free(edj_path);
-               return NULL;
-       }
-       elm_layout_file_set(page, edj_path, "page");
-
-       e = evas_object_evas_get(scroller);
-       goto_if(!e, ERROR);
-
-       page_bg = evas_object_rectangle_add(e);
-       goto_if(!page_bg, ERROR);
-       evas_object_size_hint_weight_set(page_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_min_set(page_bg, page_width, page_height);
-       evas_object_size_hint_max_set(page_bg, page_width, page_height);
-       evas_object_color_set(page_bg, 0, 0, 0, 0);
-       evas_object_repeat_events_set(page_bg, EINA_TRUE);
-       evas_object_show(page_bg);
-       elm_object_part_content_set(page, "bg", page_bg);
-
-       evas_object_show(page);
-       free(edj_path);
-       return page;
-
-ERROR:
-       free(edj_path);
-       _page_destroy(page);
-       return NULL;
-}
-
-
-
-void _page_destroy(Evas_Object *page)
-{
-       Evas_Object *bg = NULL;
-
-       ret_if(!page);
-
-       bg = elm_object_part_content_unset(page, "bg");
-       if (bg) {
-               evas_object_del(bg);
-       }
-
-       evas_object_del(page);
-}
diff --git a/src/scroller.c b/src/scroller.c
deleted file mode 100755 (executable)
index fa0bea4..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (c) 2020 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 <Elementary.h>
-
-#include "share_panel.h"
-#include "share_panel_internal.h"
-#include "conf.h"
-#include "grid.h"
-#include "log.h"
-#include "page.h"
-#include "scroller.h"
-
-#define PRIVATE_SCROLLER_IS_SCROLLING "p_is_sc"
-#define PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST "pdkec"
-
-
-struct _event_cb {
-       int event_type;
-       void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *user_data);
-       void *user_data;
-};
-typedef struct _event_cb event_cb_s;
-
-
-static void __anim_start_cb(void *data, Evas_Object *scroller, void *event_info)
-{
-       _D("start the scroller(%p) animation", scroller);
-       evas_object_data_set(scroller, PRIVATE_SCROLLER_IS_SCROLLING, (void *)1);
-}
-
-
-static void __anim_stop_cb(void *data, Evas_Object *scroller, void *event_info)
-{
-       _D("stop the scroller(%p) animation", scroller);
-       evas_object_data_del(scroller, PRIVATE_SCROLLER_IS_SCROLLING);
-}
-
-
-static void __drag_start_cb(void *data, Evas_Object *scroller, void *event_info)
-{
-       _D("start to drag the scroller(%p)", scroller);
-}
-
-
-static void __drag_stop_cb(void *data, Evas_Object *scroller, void *event_info)
-{
-       _D("stop to drag the scroller(%p) animation", scroller);
-}
-
-
-static void __scroll_cb(void *data, Evas_Object *scroller, void *event_info)
-{
-       share_panel_h share_panel = data;
-       Eina_List *event_cb_list = NULL;
-       const Eina_List *l = NULL;
-       const Eina_List *ln = NULL;
-       event_cb_s *event_cb_info = NULL;
-
-       ret_if(!share_panel);
-       ret_if(!scroller);
-
-       event_cb_list = evas_object_data_get(scroller, PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST);
-       ret_if(!event_cb_list);
-
-       EINA_LIST_FOREACH_SAFE(event_cb_list, l, ln, event_cb_info) {
-               if (SCROLLER_EVENT_TYPE_SCROLL == event_cb_info->event_type) {
-                       if (event_cb_info->event_cb) {
-                               event_cb_info->event_cb(scroller, SCROLLER_EVENT_TYPE_SCROLL, NULL, event_cb_info->user_data);
-                       }
-               }
-       }
-}
-
-
-Evas_Object *_scroller_create(Evas_Object *ui_manager, share_panel_h share_panel)
-{
-       Evas_Object *box = NULL;
-       Evas_Object *scroller = NULL;
-
-       retv_if(!ui_manager, NULL);
-       retv_if(!share_panel, NULL);
-
-       scroller = elm_scroller_add(ui_manager);
-       retv_if(!scroller, NULL);
-
-       elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_FALSE);
-       elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
-       elm_scroller_page_scroll_limit_set(scroller, 1, 1);
-       elm_scroller_content_min_limit(scroller, EINA_FALSE, EINA_TRUE);
-       elm_scroller_single_direction_set(scroller, ELM_SCROLLER_SINGLE_DIRECTION_HARD);
-
-       elm_scroller_page_size_set(scroller, share_panel->page_width, -1);
-
-       elm_object_style_set(scroller, "effect");
-       evas_object_show(scroller);
-       elm_object_scroll_lock_y_set(scroller, EINA_TRUE);
-
-       evas_object_smart_callback_add(scroller, "scroll,anim,start", __anim_start_cb, NULL);
-       evas_object_smart_callback_add(scroller, "scroll,anim,stop", __anim_stop_cb, NULL);
-       evas_object_smart_callback_add(scroller, "scroll,drag,start", __drag_start_cb, NULL);
-       evas_object_smart_callback_add(scroller, "scroll,drag,stop", __drag_stop_cb, share_panel);
-       evas_object_smart_callback_add(scroller, "scroll", __scroll_cb, share_panel);
-
-       box = elm_box_add(scroller);
-       goto_if(!box, ERROR);
-
-       elm_box_horizontal_set(box, EINA_TRUE);
-       elm_box_align_set(box, 0.5, 0.5);
-       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_show(box);
-
-       elm_object_content_set(scroller, box);
-
-       return scroller;
-
-ERROR:
-       if (scroller) {
-               evas_object_del(scroller);
-       }
-       return NULL;
-}
-
-
-void _scroller_destroy(Evas_Object *scroller)
-{
-       Evas_Object *box = NULL;
-       Eina_List *list = NULL;
-       ret_if(!scroller);
-
-       box = elm_object_content_unset(scroller);
-       if (box) {
-               list = elm_box_children_get(box);
-               if (list) {
-                       _scroller_remove_list(scroller, list);
-                       eina_list_free(list);
-               }
-               evas_object_del(box);
-       }
-
-       evas_object_del(scroller);
-}
-
-
-void _scroller_append_page(Evas_Object *scroller, Evas_Object *page)
-{
-       Evas_Object *box = NULL;
-       Eina_List *event_cb_list = NULL;
-       const Eina_List *l = NULL;
-       const Eina_List *ln = NULL;
-       event_cb_s *event_cb_info = NULL;
-
-       box = elm_object_content_get(scroller);
-       ret_if(!box);
-
-       elm_box_pack_end(box, page);
-
-       event_cb_list = evas_object_data_get(scroller, PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST);
-       ret_if(!event_cb_list);
-
-       EINA_LIST_FOREACH_SAFE(event_cb_list, l, ln, event_cb_info) {
-               if (SCROLLER_EVENT_TYPE_APPEND_PAGE == event_cb_info->event_type) {
-                       if (event_cb_info->event_cb) {
-                               event_cb_info->event_cb(scroller, SCROLLER_EVENT_TYPE_APPEND_PAGE, NULL, event_cb_info->user_data);
-                       }
-               }
-       }
-}
-
-void _scroller_append_list(Evas_Object *scroller, Eina_List *list, int page_width, int page_height)
-{
-       Evas_Object *page = NULL;
-       Evas_Object *grid = NULL;
-       int count = 0;
-       int i;
-
-       ret_if(!scroller);
-       ret_if(!list);
-
-       /* We'll implement this part */
-       count = eina_list_count(list);
-       if (!count) {
-               _D("no apps");
-               return;
-       }
-
-       _D("list count is %d", count);
-
-       for (i = 0; i < count; i++) {
-               Evas_Object *item = NULL;
-               if (i % 8 == 0) {
-                       page = _page_create(scroller, page_width, page_height);
-                       ret_if(!page);
-                       _scroller_append_page(scroller, page);
-                       grid = _grid_create(page);
-                       ret_if(!grid);
-                       elm_object_part_content_set(page, "grid", grid);
-               }
-               item = _grid_append_item(grid, eina_list_nth(list, i));
-               ret_if(!item);
-       }
-}
-
-
-void _scroller_remove_list(Evas_Object *scroller, Eina_List *list)
-{
-       Evas_Object *page = NULL;
-       Evas_Object *grid = NULL;
-       const Eina_List *l, *ln;
-
-       ret_if(!scroller);
-       ret_if(!list);
-
-       EINA_LIST_FOREACH_SAFE(list, l, ln, page) {
-               grid = elm_object_part_content_unset(page, "grid");
-               continue_if(!grid);
-               _grid_destroy(grid);
-               _page_destroy(page);
-       }
-}
-
-
-int _scroller_get_region_index(Evas_Object *scroller)
-{
-       int index = 0;
-       int x = 0;
-       int page_w = 0;
-
-       retv_if(!scroller, 0);
-
-       elm_scroller_region_get(scroller, &x, NULL, NULL, NULL);
-       elm_scroller_page_size_get(scroller, &page_w, NULL);
-
-       index = x / page_w;
-       x = x % page_w;
-       if (x > (page_w / 2)) {
-               index++;
-       }
-
-       return index;
-}
-
-
-unsigned int _scroller_count(Evas_Object *scroller)
-{
-       Evas_Object *box = NULL;
-       Eina_List *list = NULL;
-       int count = 0;
-
-       retv_if(!scroller, 0);
-
-       box = elm_object_content_get(scroller);
-       retv_if(!box, 0);
-
-       list = elm_box_children_get(box);
-       retv_if(!list, 0);
-
-       count = eina_list_count(list);
-       eina_list_free(list);
-
-       return count;
-}
-
-int _scroller_register_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *user_data), void *user_data)
-{
-       Eina_List *event_cb_list = NULL;
-       event_cb_s *event_cb_info = NULL;
-
-       retv_if(!scroller, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-       retv_if(event_type <= SCROLLER_EVENT_TYPE_INVALID, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-       retv_if(event_type >= SCROLLER_EVENT_TYPE_MAX, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-       retv_if(!event_cb, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-
-       event_cb_info = calloc(1, sizeof(event_cb_s));
-       retv_if(!event_cb_info, SHARE_PANEL_ERROR_OUT_OF_MEMORY);
-
-       event_cb_info->event_type = event_type;
-       event_cb_info->event_cb = event_cb;
-       event_cb_info->user_data = user_data;
-
-       event_cb_list = evas_object_data_get(scroller, PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST);
-       event_cb_list = eina_list_append(event_cb_list, event_cb_info);
-       evas_object_data_set(scroller, PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST, event_cb_list);
-
-       return SHARE_PANEL_ERROR_NONE;
-}
-
-
-int _scroller_unregister_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *user_data))
-{
-       Eina_List *event_cb_list = NULL;
-       const Eina_List *l = NULL;
-       const Eina_List *ln = NULL;
-       event_cb_s *event_cb_info = NULL;
-
-       retv_if(!scroller, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-       retv_if(event_type <= SCROLLER_EVENT_TYPE_INVALID, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-       retv_if(event_type >= SCROLLER_EVENT_TYPE_MAX, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-       retv_if(!event_cb, SHARE_PANEL_ERROR_INVALID_PARAMETER);
-
-       event_cb_list = evas_object_data_get(scroller, PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST);
-       retv_if(!event_cb_list, SHARE_PANEL_ERROR_NOT_INITIALIZED);
-
-       EINA_LIST_FOREACH_SAFE(event_cb_list, l, ln, event_cb_info) {
-               if (event_cb_info->event_type == event_type
-                       && event_cb_info->event_cb == event_cb) {
-                       event_cb_list = eina_list_remove(event_cb_list, event_cb_info);
-                       break;
-               }
-       }
-
-       evas_object_data_set(scroller, PRIVATE_DATA_KEY_EVENT_CALLBACK_LIST, event_cb_list);
-
-       return SHARE_PANEL_ERROR_NONE;
-}
index 25198d4cc21e59f9981c8444397b10f1802eac4e..4f6197b98793f7763470193035e0acd1a5a4f6cc 100755 (executable)
@@ -25,7 +25,6 @@
 #include "conf.h"
 #include "ui_manager.h"
 #include "log.h"
-#include "scroller.h"
 #include "utils.h"
 
 #ifdef EAPI
@@ -36,7 +35,6 @@
 #define SHARE_PANEL_DOMAIN "share-panel"
 #define TRANSIT_DURATION 0.5f
 
-
 typedef struct custom_effect {
        Evas_Coord from_h;
        Evas_Coord to_h;
@@ -118,6 +116,8 @@ static Evas_Object *__create_win(share_panel_h share_panel)
        elm_win_screen_size_get(win, NULL, NULL, &share_panel->root_width, &share_panel->root_height);
        _D("screen size is (%d, %d)", share_panel->root_width, share_panel->root_height);
 
+       utils_set_fhd(share_panel->root_width);
+
        elm_object_event_callback_add(win, _back_key_pressed, share_panel);
        evas_object_smart_callback_add(win, "wm,rotation,changed", _rotate_cb, share_panel);
 
@@ -164,11 +164,7 @@ EAPI int share_panel_create(app_control_h control, share_panel_h *share_panel)
 
        goto_if(!__create_win(panel), ERROR);
 
-       if (panel->root_width > panel->root_height) {
-               panel->page_width = panel->root_height;
-       } else {
-               panel->page_width = panel->root_width;
-       }
+       panel->page_width = panel->root_width;
        panel->page_height = ELM_SCALE_SIZE(SCROLLER_HEIGHT);
 
        int err = app_control_is_reply_requested(control, &panel->reply_requested);
@@ -271,7 +267,7 @@ EAPI int share_panel_hide(share_panel_h share_panel)
 
 static bool _create_cb(void *data)
 {
-       elm_app_base_scale_set(1.7);
+       elm_app_base_scale_set(1.8);
 
        return true;
 }
index 0abe1361786f9827f6f0736c773296f699b7ded5..2540055b63b3f375d128bb6e2e02dfc63f7fe103 100755 (executable)
@@ -17,6 +17,7 @@
 #include <app.h>
 #include <Elementary.h>
 #include <notification.h>
+#include <glib.h>
 
 #include "share_panel_internal.h"
 #include "share_panel.h"
 #include "log.h"
 #include "grid.h"
 #include "list.h"
-#include "page.h"
-#include "index.h"
-#include "scroller.h"
 #include "conf.h"
 #include "ui_manager.h"
 #include "utils.h"
 
 #define GROUP_LAYOUT "layout"
+#define GROUP_LAYOUT_FHD "layout_fhd"
+#define _EDJ(obj) elm_layout_edje_get(obj)
 
 
 static void __resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -46,49 +46,6 @@ static void __resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
        _D("%s resize(%d, %d, %d, %d)", data, x, y, w, h);
 }
 
-
-static void _scroll_cb(Evas_Object *scroller, int event_type, void *event_info, void *data)
-{
-       Evas_Object *index = data;
-       int region_index = 0;
-
-       ret_if(!index);
-
-       region_index = _scroller_get_region_index(scroller);
-       _index_bring_in(index, region_index);
-
-       _D("Scroller region index is %d", region_index);
-}
-
-
-static void _append_page_cb(Evas_Object *scroller, int event_type, void *event_info, void *data)
-{
-       Evas_Object *index = data;
-       unsigned int count = 0;
-
-       ret_if(!index);
-
-       count = _scroller_count(scroller);
-       _index_update(index, count);
-
-       _D("Index was updated as %d", count);
-}
-
-
-static void _remove_page_cb(Evas_Object *scroller, int event_type, void *event_info, void *data)
-{
-       Evas_Object *index = data;
-       unsigned int count = 0;
-
-       ret_if(!index);
-
-       count = _scroller_count(scroller);
-       _index_update(index, count);
-
-       _D("Index was updated as %d", count);
-}
-
-
 static void __click_back_btn_cb(void *data, Evas_Object *obj, void *event_info)
 {
        share_panel_s *share_panel = data;
@@ -137,8 +94,14 @@ Evas_Object *__create_bg_rect(Evas_Object *ui_manager, int width, int height)
        retv_if(!ui_bg, NULL);
 
        evas_object_size_hint_weight_set(ui_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_min_set(ui_bg, ELM_SCALE_SIZE(BASE_WIDTH), ELM_SCALE_SIZE(BASE_HEIGHT));
-       evas_object_size_hint_max_set(ui_bg, ELM_SCALE_SIZE(BASE_WIDTH), ELM_SCALE_SIZE(BASE_HEIGHT));
+
+       if(!utils_is_fhd()) {
+               evas_object_size_hint_min_set(ui_bg, ELM_SCALE_SIZE(BASE_WIDTH), ELM_SCALE_SIZE(BASE_HEIGHT));
+               evas_object_size_hint_max_set(ui_bg, ELM_SCALE_SIZE(BASE_WIDTH), ELM_SCALE_SIZE(BASE_HEIGHT));
+       } else {
+               evas_object_size_hint_min_set(ui_bg, ELM_SCALE_SIZE(width), ELM_SCALE_SIZE(BASE_HEIGHT_FHD));
+               evas_object_size_hint_max_set(ui_bg, ELM_SCALE_SIZE(width), ELM_SCALE_SIZE(BASE_HEIGHT_FHD));
+       }
        evas_object_color_set(ui_bg, 0, 0, 0, 0);
        evas_object_show(ui_bg);
        elm_object_part_content_set(ui_manager, "fixed_bg", ui_bg);
@@ -154,6 +117,17 @@ void __destroy_bg_rect(Evas_Object *bg)
        evas_object_del(bg);
 }
 
+static void
+_ui_manager_sharepanel_close_cb(void *data, Evas_Object * obj,
+                                                 const char *emission, const char *source)
+{
+       share_panel_s *share_panel = data;
+       if (emission) {
+               if (!g_strcmp0(emission, "mouse,clicked,1")) {
+                       __click_back_btn_cb(share_panel, NULL, NULL);
+               }
+       }
+}
 
 Evas_Object *_ui_manager_create(share_panel_s *share_panel)
 {
@@ -167,7 +141,12 @@ Evas_Object *_ui_manager_create(share_panel_s *share_panel)
 
        char *edj_path = utils_get_res_file_path("edje/layout.edj");
 
-       elm_layout_file_set(ui_manager, edj_path, GROUP_LAYOUT);
+       if (!utils_is_fhd()) {
+               elm_layout_file_set(ui_manager, edj_path, GROUP_LAYOUT);
+       } else {
+               elm_layout_file_set(ui_manager, edj_path, GROUP_LAYOUT_FHD);
+       }
+
        evas_object_size_hint_weight_set(ui_manager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(ui_manager, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_show(ui_manager);
@@ -183,27 +162,6 @@ Evas_Object *_ui_manager_create(share_panel_s *share_panel)
        elm_object_part_text_set(ui_manager, "title", _("IDS_AM_HEADER_SHARE"));
        elm_object_domain_translatable_part_text_set(ui_manager, "title", PROJECT, "IDS_AM_HEADER_SHARE");
 
-       share_panel->index = _index_create(ui_manager, 0);
-       goto_if(!share_panel->index, ERROR);
-       elm_object_part_content_set(ui_manager, "index", share_panel->index);
-
-       share_panel->scroller = _scroller_create(ui_manager, share_panel);
-       goto_if(!share_panel->scroller, ERROR);
-       elm_object_part_content_set(ui_manager, "scroller", share_panel->scroller);
-
-       if (SHARE_PANEL_ERROR_NONE != _scroller_register_event_cb(share_panel->scroller,
-                       SCROLLER_EVENT_TYPE_SCROLL, _scroll_cb, share_panel->index)) {
-               _E("cannot register the scroller event");
-       }
-       if (SHARE_PANEL_ERROR_NONE != _scroller_register_event_cb(share_panel->scroller,
-                       SCROLLER_EVENT_TYPE_APPEND_PAGE, _append_page_cb, share_panel->index)) {
-               _E("cannot register the scroller event");
-       }
-       if (SHARE_PANEL_ERROR_NONE != _scroller_register_event_cb(share_panel->scroller,
-                       SCROLLER_EVENT_TYPE_REMOVE_PAGE, _remove_page_cb, share_panel->index)) {
-               _E("cannot register the scroller event");
-       }
-
        share_panel->list = _list_create(share_panel);
        if (!share_panel->list) {
                notification_status_message_post(_("IDS_BT_POP_NO_APPLICATIONS_AVAILABLE_TO_OPEN_FILES"));
@@ -211,29 +169,9 @@ Evas_Object *_ui_manager_create(share_panel_s *share_panel)
        }
 
        share_panel->list_count = eina_list_count(share_panel->list);
+       share_panel->grid = _grid_create(ui_manager, share_panel);
 
-       if (1 == share_panel->list_count) {
-               item_s *item_info = NULL;
-               int ret = 0;
-
-               _D("Only one item on the list. Launching.");
-
-               item_info = eina_list_nth(share_panel->list, 0);
-               goto_if(!item_info, ERROR);
-
-               ret = _app_control_launch(item_info);
-
-               if (ret < 0) {
-                       _E("Fail to launch app(%d)", ret);
-               }
-
-               ui_app_exit();
-       }
-
-       _scroller_append_list(share_panel->scroller
-               , share_panel->list
-               , share_panel->page_width
-               , share_panel->page_height);
+       elm_object_part_content_set(ui_manager, "scroller", share_panel->grid);
 
        edje = elm_layout_edje_get(ui_manager);
        goto_if(!edje, ERROR);
@@ -246,6 +184,8 @@ Evas_Object *_ui_manager_create(share_panel_s *share_panel)
                }
        }
 
+       edje_object_signal_callback_add(_EDJ(ui_manager), "mouse,clicked,1",
+                                                                       "close_btn_focus", _ui_manager_sharepanel_close_cb, share_panel);
        edje_object_message_signal_process(edje);
 
        free(edj_path);
@@ -269,21 +209,10 @@ void _ui_manager_destroy(Evas_Object *ui_manager)
        ret_if(!share_panel);
 
        if (share_panel->list) {
-               _scroller_remove_list(share_panel->scroller, share_panel->list);
+               _grid_destroy(share_panel->grid);
                _list_destroy(share_panel->list);
        }
 
-       if (share_panel->scroller) {
-               _scroller_unregister_event_cb(share_panel->scroller, SCROLLER_EVENT_TYPE_SCROLL, _scroll_cb);
-               _scroller_unregister_event_cb(share_panel->scroller, SCROLLER_EVENT_TYPE_APPEND_PAGE, _append_page_cb);
-               _scroller_unregister_event_cb(share_panel->scroller, SCROLLER_EVENT_TYPE_REMOVE_PAGE, _remove_page_cb);
-               _scroller_destroy(share_panel->scroller);
-       }
-
-       if (share_panel->index) {
-               _index_destroy(share_panel->index);
-       }
-
        button = elm_object_part_content_unset(ui_manager, "effect");
        if(button) {
                __destroy_back_btn(button);
index 4592d0913f0459bba8383653e9650177793e5bae..ecbd895104beed4a8d5eb5141cfb40e047ad964e 100755 (executable)
 #include <stdio.h>
 
 #include "log.h"
+#include "conf.h"
 
+static bool g_fhd = false;
 
+bool utils_is_fhd()
+{
+       if(g_fhd)return true;
+
+       return false;
+}
+
+bool utils_set_fhd(int width)
+{
+       if (width <= BASE_WIDTH) {
+               g_fhd = false;
+       } else {
+               g_fhd = true;
+       }
+}
 char *utils_get_res_file_path(char *sub_path)
 {
        char *res_path = app_get_resource_path();