#ifndef __TIZEN_SHARE_PANEL_CONF_H__
#define __TIZEN_SHARE_PANEL_CONF_H__
+#define BASE_WIDTH 480
#define BASE_HEIGHT 800
/* ITEM_ICON is changed from 74 to 63 about 87% decrease because of resolution issues. */
#define INDEX_HEIGHT 50
#define TITLE_HEIGHT 54
+#define SCROLLER_HEIGHT 320
/* PANEL_HEIGHT is changed from 368 to 320 about 87% decrease because of resolution issues. */
-#define PANEL_HEIGHT (320+INDEX_HEIGHT)
+#define PANEL_HEIGHT (SCROLLER_HEIGHT+INDEX_HEIGHT+TITLE_HEIGHT)
*/
extern int share_panel_hide(share_panel_h share_panel);
-extern void share_panel_resize(share_panel_h share_panel, int width, int height);
/**
* @}
*/
}
}
part {
+ name: "fixed_bg";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 1.0; }
+ rel2 { relative: 0.5 1.0; }
+ align: 0.5 1.0;
+ fixed: 1 1;
+ visible: 1;
+ }
+ }
+ part {
name: "title,bg";
type: RECT;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 ((BASE_HEIGHT - (PANEL_HEIGHT + TITLE_HEIGHT)) / BASE_HEIGHT); to: "bg"; }
- rel2 { relative: 1.0 0.0; to: "scroller,bg"; }
- align: 0.5 1.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"; }
visible: 1;
color: 250 250 250 255;
}
type: RECT;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 ((BASE_HEIGHT - PANEL_HEIGHT) / BASE_HEIGHT); to: "bg"; }
- rel2 { relative: 1.0 ((BASE_HEIGHT - INDEX_HEIGHT) / BASE_HEIGHT); to: "bg"; }
+ 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"; }
visible: 1;
color: 250 250 250 255;
}
rel1.to: "scroller,bg";
rel2.to: "scroller,bg";
visible: 1;
+ fixed: 1 1;
}
}
part {
type: RECT;
description {
state: "default" 0.0;
- rel1 { relative: 0.0 ((BASE_HEIGHT - INDEX_HEIGHT) / BASE_HEIGHT); to: "bg"; }
- rel2 { relative: 1.0 1.0; to: "bg"; }
+ rel1 { relative: 0.0 (BASE_HEIGHT-INDEX_HEIGHT)/BASE_HEIGHT; to: "fixed_bg"; }
+ rel2 { relative: 1.0 1.0; to: "fixed_bg"; }
visible: 1;
color: 250 250 250 255;
}
rel1.to: "index,bg";
rel2.to: "index,bg";
visible: 1;
+ fixed: 1 1;
}
}
}
-EAPI void share_panel_resize(share_panel_h share_panel, int width, int height)
-{
- ret_if(!share_panel);
-
- if (width > height) {
- _D("resize the share-panel to land");
- } else {
- _D("resize the share-panel to port");
- }
-
- _ui_manager_resize(share_panel->ui_manager, width, height);
-}
-
-
-
static Eina_Bool _back_key_pressed(void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info)
{
Evas_Event_Key_Down *ev = event_info;
angle = elm_win_rotation_get(obj);
_D("Angle is %d degree", angle);
-
- switch (angle) {
- case 0:
- case 180:
- share_panel_resize(share_panel, share_panel->root_width, share_panel->root_height);
- break;
- case 90:
- case 270:
- share_panel_resize(share_panel, share_panel->root_height, share_panel->root_width);
- break;
- default:
- _E("cannot reach here");
- }
}
share_panel->win = elm_win_add(NULL, "Share Panel", ELM_WIN_BASIC);
retv_if(!share_panel->win, NULL);
+ elm_win_alpha_set(share_panel->win, EINA_TRUE);
if (elm_win_wm_rotation_supported_get(share_panel->win)) {
int rots[4] = {0, 90, 180, 270};
- elm_win_wm_rotation_available_rotations_set(share_panel->win, rots, 4);
+ elm_win_wm_rotation_available_rotations_set(share_panel->win, rots, (sizeof(rots) / sizeof(int)));
}
elm_win_screen_size_get(share_panel->win, NULL, NULL, &share_panel->root_width, &share_panel->root_height);
elm_win_indicator_mode_set(share_panel->win, ELM_WIN_INDICATOR_HIDE);
elm_win_borderless_set(share_panel->win, EINA_TRUE);
- elm_win_alpha_set(share_panel->win, EINA_TRUE);
evas_object_show(share_panel->win);
return share_panel->win;
+Evas_Object *__create_bg_rect(Evas_Object *ui_manager, int width, int height)
+{
+ Evas_Object *ui_bg = NULL;
+
+ ui_bg = evas_object_rectangle_add(evas_object_evas_get(ui_manager));
+ 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));
+ 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);
+
+ return ui_bg;
+}
+
+
+
+void __destroy_bg_rect(Evas_Object *bg)
+{
+ ret_if(!bg);
+
+ evas_object_del(bg);
+}
+
+
+
Evas_Object *_ui_manager_create(share_panel_s *share_panel)
{
Evas_Object *ui_manager = NULL;
evas_object_data_set(ui_manager, DATA_KEY_SHARE_PANEL_INFO, share_panel);
+ goto_if(!__create_bg_rect(ui_manager, share_panel->root_width, share_panel->root_height), ERROR);
+
goto_if(!__create_back_btn(ui_manager, share_panel), ERROR);
elm_object_part_text_set(ui_manager, "title", _("IDS_AM_HEADER_SHARE"));
void _ui_manager_destroy(Evas_Object *ui_manager)
{
Evas_Object *button = NULL;
+ Evas_Object *bg = NULL;
share_panel_s *share_panel = NULL;
ret_if(!ui_manager);
if(button) {
__destroy_back_btn(button);
}
+
+ bg = elm_object_part_content_unset(ui_manager, "fixed_bg");
+ if(bg) {
+ __destroy_bg_rect(bg);
+ }
+
evas_object_del(ui_manager);
}
evas_object_size_hint_max_set(ui_manager, width, height);
evas_object_resize(ui_manager, width, height);
evas_object_move(ui_manager, 0, 0);
+ edje_object_message_signal_process(elm_layout_edje_get(ui_manager));
}