[Share-panel] Change the height of share-panel according to the apps' count 98/47198/1
authorJin Yoon <jinny.yoon@samsung.com>
Tue, 1 Sep 2015 03:02:27 +0000 (12:02 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Tue, 1 Sep 2015 03:02:27 +0000 (12:02 +0900)
Change-Id: Ib57f26655cf8ddb1a54fee9b61e59b5271d20910

include/conf.h
include/share_panel_internal.h
res/edje/layout.edc
src/share_panel.c
src/ui_manager.c

index 0f3caef..6e62b5c 100644 (file)
@@ -31,7 +31,9 @@
 
 #define INDEX_HEIGHT 50
 #define TITLE_HEIGHT 54
-#define SCROLLER_HEIGHT 320
+#define SCROLLER_HEIGHT 300
+
+#define LINE_MAX 4
 
 /* PANEL_HEIGHT is changed from 368 to 320 about 87% decrease because of resolution issues. */
 #define PANEL_HEIGHT (SCROLLER_HEIGHT+INDEX_HEIGHT+TITLE_HEIGHT)
index ddc6257..cc51b40 100644 (file)
@@ -57,6 +57,7 @@ struct _share_panel {
        int page_width;
        int page_height;
        int show_state;
+       int list_count;
 };
 typedef struct _share_panel share_panel_s;
 
index d955161..926d3e3 100644 (file)
@@ -19,7 +19,7 @@
 styles {
        style {
                name: "text_style";
-               base: "font=Tizen:style=Regular font_size=38 color=#3DBACD align=center wrap=mixed ellipsis=-1";
+               base: "font=Tizen:style=Regular font_size=50 color=#3DBACD align=center wrap=mixed ellipsis=-1";
                tag:  "br" "\n";
                tag:  "hilight" "+ font_weight=Bold";
                tag:  "b" "+ font_weight=Bold";
@@ -28,7 +28,7 @@ styles {
 }
 
 collections {
-       base_scale: 1.7;
+       base_scale: 2.6;
        group {
                name: "layout";
                parts {
@@ -66,6 +66,18 @@ collections {
                                        fixed: 1 1;
                                        visible: 1;
                                }
+                               description {
+                                       state: "1line" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 0.5 1.15; }
+                                       rel2 { relative: 0.5 1.15; }
+                               }
+                               description {
+                                       state: "1line,land" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 0.5 1.25; }
+                                       rel2 { relative: 0.5 1.25; }
+                               }
                        }
                        part {
                                name: "title,bg";
@@ -138,5 +150,21 @@ collections {
                                }
                        }
                }
+               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";
+                       }
+               }
        } //group
 } //collections
index a243296..05bb103 100644 (file)
@@ -76,9 +76,28 @@ static void _rotate_cb(void *data, Evas_Object *obj, void *event)
 
        ret_if(!obj);
        ret_if(!share_panel);
+       ret_if(!share_panel->list_count);
+       ret_if(!share_panel->ui_manager);
 
        angle = elm_win_rotation_get(obj);
        _D("Angle is %d degree", angle);
+
+       if (share_panel->list_count > LINE_MAX) {
+               return;
+       }
+
+       switch(angle) {
+       case 0:
+       case 180:
+               elm_object_signal_emit(share_panel->ui_manager, "1line", "fixed_bg");
+               break;
+       case 90:
+       case 270:
+               elm_object_signal_emit(share_panel->ui_manager, "1line,land", "fixed_bg");
+               break;
+       default:
+               _E("cannot reach here");
+       }
 }
 
 
index b66c2ec..c156a4b 100644 (file)
@@ -216,6 +216,16 @@ Evas_Object *_ui_manager_create(share_panel_s *share_panel)
                ui_app_exit();
        }
 
+       share_panel->list_count = eina_list_count(share_panel->list);
+
+       if (share_panel->list_count <= LINE_MAX) {
+               if (share_panel->root_width < share_panel->root_height) {
+                       elm_object_signal_emit(ui_manager, "1line", "fixed_bg");
+               } else {
+                       elm_object_signal_emit(ui_manager, "1line,land", "fixed_bg");
+               }
+       }
+
        _scroller_append_list(share_panel->scroller
                , share_panel->list
                , share_panel->page_width