Apply layout on mobile ui 61/102561/1
authorYunjin Lee <yunjin-.lee@samsung.com>
Tue, 6 Dec 2016 06:00:08 +0000 (15:00 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Tue, 6 Dec 2016 06:00:08 +0000 (15:00 +0900)
Change-Id: Ib7eb8769d3011008128d54920c0de6344164fd37
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
src/agent/notification-daemon/GuiRunner.cpp
src/agent/notification-daemon/GuiRunner.h
src/agent/notification-daemon/res/popup_custom.edc

index f352507..a078cb1 100644 (file)
@@ -151,51 +151,44 @@ void GuiRunner::initialize()
     elm_win_alpha_set(m_win, EINA_TRUE);
 
 #ifdef MOBILE_UI
+
     // popup
     m_popup = elm_popup_add(m_win);
     if (!m_popup) {
         ALOGE("EFL : Failed to add popup");
         throw Exception("Elementary failed");
     }
+    elm_popup_align_set(m_popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
     elm_object_part_text_set(m_popup, "title,text", popupTitle);
+    evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
-    // box
-    m_box = elm_box_add(m_popup);
-    if (!m_box) {
-        ALOGE("EFL : Failed to add box");
-        throw Exception("Enlightement failed");
-    }
-    evas_object_size_hint_weight_set(m_box, EVAS_HINT_EXPAND, 0);
-    evas_object_size_hint_align_set(m_box, EVAS_HINT_FILL, 0.0);
+    // layout
+    m_layout = elm_layout_add(m_popup);
+    elm_layout_file_set(m_layout, RES_DIR"/popup_custom.edj", "popup_checkview_layout_mobile");
+    evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
     // content
-    m_content = elm_label_add(m_popup);
+    m_content = elm_label_add(m_layout);
     if (!m_content) {
         ALOGE("EFL : Failed to add content");
         throw Exception("Enlightement failed");
     }
-    elm_object_style_set(m_content, "elm.swallow.content");
+    elm_object_style_set(m_content, "popup/default");
     elm_label_line_wrap_set(m_content, ELM_WRAP_MIXED);
-    evas_object_size_hint_weight_set(m_content, EVAS_HINT_EXPAND, 0.0);
+    evas_object_size_hint_weight_set(m_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
     evas_object_size_hint_align_set(m_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
-    evas_object_show(m_content);
-    elm_box_pack_end(m_box, m_content);
+    elm_object_part_content_set(m_layout, "elm.swallow.content", m_content);
 
     // checkbox
-    m_checkbox = elm_check_add(m_popup);
+    m_checkbox = elm_check_add(m_layout);
     if (!m_checkbox) {
         ALOGE("EFL : Failed to add checkbox");
         throw Exception("Enlightement failed");
     }
-    elm_object_part_content_set(m_popup, "checkbox1", m_checkbox);
+    elm_object_part_content_set(m_layout, "elm.swallow.end", m_checkbox);
     elm_object_text_set(m_checkbox, checkBoxText);
     elm_check_state_set(m_checkbox, EINA_FALSE);
-    evas_object_size_hint_align_set(m_checkbox, EVAS_HINT_FILL, 0.0);
     evas_object_show(m_checkbox);
-    elm_box_pack_end(m_box, m_checkbox);
-
-    elm_object_part_content_set(m_popup, "default", m_box);
 
     // buttons
     m_denyButton = elm_button_add(m_popup);
@@ -215,6 +208,9 @@ void GuiRunner::initialize()
     elm_object_part_content_set(m_popup, "button2", m_allowButton);
     elm_object_text_set(m_allowButton, dgettext(PROJECT_NAME,
                                             "IDS_IDLE_BUTTON_ALLOW_ABB7"));
+    elm_object_content_set(m_popup, m_layout);
+    evas_object_show(m_popup);
+
 #elif defined(CIRCLE_UI)
     Evas_Object *icon;
 
index af364dc..d84fd8e 100644 (file)
@@ -73,7 +73,6 @@ private:
     Evas_Object *m_popup = nullptr;
     Evas_Object *m_layout = nullptr;
     Evas_Object *m_layoutInner = nullptr;
-    Evas_Object *m_box = nullptr;
     Evas_Object *m_content = nullptr;
     Evas_Object *m_checkbox = nullptr;
     Evas_Object *m_allowButton = nullptr;
index 041572d..d128d22 100644 (file)
@@ -14,6 +14,7 @@
  *  limitations under the License.
  *
  */
+
 collections {
     base_scale: 1.3;
 //Height = 480 - (2 + 83 + 68)
@@ -121,4 +122,89 @@ group { name: "popup_checkview_internal";
       }
    }
 }
+group { "popup_checkview_layout_mobile";
+   parts {
+      spacer { "spacer_t";
+         scale: 1;
+         desc { "default";
+            align: 0.5 0.5;
+            rel1.relative: 0.00 0.00;
+            rel2.relative: 1.00 0.04;
+         }
+      }
+      spacer { "spacer_b";
+         scale: 1;
+         desc { "default";
+            align: 0.5 0.5;
+            rel1.relative: 0.00 0.94;
+            rel2.relative: 1.00 1.00;
+         }
+      }
+      spacer { "spacer_l";
+         scale: 1;
+         desc { "default";
+            align: 0.5 0.5;
+            rel1.to_y: "spacer_t";
+            rel2.to_y: "spacer_b";
+            rel1.relative: 0.91 1.00;
+            rel2.relative: 1.00 0.00;
+         }
+      }
+      spacer { "spacer_r";
+         scale: 1;
+         desc { "default";
+            align: 0.5 0.5;
+            rel1.to_y: "spacer_t";
+            rel2.to_y: "spacer_b";
+            rel1.relative: 0.00 1.00;
+            rel2.relative: 0.09 0.00;
+         }
+      }
+      swallow { "elm.swallow.content";
+         scale: 1;
+         desc { "default";
+            visible: 1;
+            align: 0.5 0.5;
+            rel1.to_x: "spacer_rr";
+            rel1.to_y: "spacer_t";
+            rel2.to_x: "spacer_ll";
+            rel1.relative: 1.00 1.00;
+            rel2.relative: 0.00 0.64;
+         }
+      }
+      swallow { "elm.swallow.end";
+         scale: 1;
+         desc { "default";
+            visible: 1;
+            align: 0.5 0.5;
+            rel1.to_x: "spacer_r";
+            rel1.to_y: "elm.swallow.content";
+            rel2.to_x: "spacer_l";
+            rel2.to_y: "spacer_b";
+            rel1.relative: 1.00 1.00;
+            rel2.relative: 0.00 0.00;
+         }
+      }
+      spacer { "spacer_rr";
+         scale: 1;
+         desc { "default";
+            align: 0.5 0.5;
+            rel1.to_y: "spacer_t";
+            rel2.to_y: "spacer_b";
+            rel1.relative: 0.00 1.00;
+            rel2.relative: 0.05 0.00;
+         }
+      }
+      spacer { "spacer_ll";
+         scale: 1;
+         desc { "default";
+            align: 0.5 0.5;
+            rel1.to_y: "spacer_t";
+            rel2.to_y: "spacer_b";
+            rel1.relative: 0.95 1.00;
+            rel2.relative: 1.00 0.00;
+         }
+      }
+   }
+}
 }