Add notify util function and edc code for notify style 32/46632/2 accepted/tizen/tv/20150825.060933 submit/tizen/20150824.133824
authorHyojung Jo <hj903.jo@samsung.com>
Mon, 24 Aug 2015 08:51:01 +0000 (17:51 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 25 Aug 2015 00:55:05 +0000 (17:55 -0700)
Change-Id: Ia6b3620c2e62e85bff06a1f1188ef5be9722f1f3
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
include/utils.h
res/apps-theme.edc
res/widget/label.edc [new file with mode: 0644]
res/widget/notify.edc [new file with mode: 0644]
src/utils.c

index a80ffcc4c66cb9c9e46c81895076825a8ece2d6e..0c5178f07742ce0cbbc333f85f84a55575d75eaa 100644 (file)
@@ -28,6 +28,9 @@ Evas_Object *utils_add_gengrid(Evas_Object *parent, Eina_Bool horizontal,
                int width, int height);
 Evas_Object *utils_add_table(Evas_Object *table, const char *part,
                int padding_x, int padding_y);
+Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
+               const char *noti_style, const char *label_style,
+               int timeout);
 bool utils_launch_app(const char *appid);
 
 #endif /* __AIR_APPS_UTILS_H__ */
index e04a32b8538974d4497690d1c3235258b36c5a96..bb9d3e8574450cffe8b93dba26650869cb1a6137 100644 (file)
@@ -20,4 +20,6 @@ collections {
        #include "widget/button.edc"
        #include "widget/gengrid.edc"
        #include "widget/ctxpopup.edc"
+       #include "widget/notify.edc"
+       #include "widget/label.edc"
 }
diff --git a/res/widget/label.edc b/res/widget/label.edc
new file mode 100644 (file)
index 0000000..df26f9f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
+group {
+       name, "elm/label/base/style.toast";
+       parts {
+               part {
+                       name, "elm.text";
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               text {
+                                       font, FONT_TIZENSANS_LIGHT;
+                                       size, 28;
+                                       align, 0.5 0.5;
+                                       min, 0 1;
+                               }
+                               color, 51 51 51 255;
+                       }
+               }
+       }
+}
diff --git a/res/widget/notify.edc b/res/widget/notify.edc
new file mode 100644 (file)
index 0000000..c1756e5
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
+group {
+       name, "elm/notify/bottom_left/style.toast";
+       parts {
+               part {
+                       name, "padding.bottom.left";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 40 40;
+                               rel1.relative, 0.0 1.0;
+                               rel2.relative, 0.0 1.0;
+                               align, 0.0 1.0;
+                               fixed, 1 1;
+                       }
+               }
+
+               part {
+                       name, "base";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 255 255 255 255;
+                               min, 536 70;
+                               max, 536 70;
+                               rel1 {
+                                       to, "padding.bottom.left";
+                                       relative, 1.0 0.0;
+                               }
+                               rel2 {
+                                       to, "padding.bottom.left";
+                                       relative, 1.0 0.0;
+                               }
+                               align, 0.0 1.0;
+                               fixed, 1 1;
+                               visible, 0;
+                       }
+                       description {
+                               state, "visible" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
+
+               part {
+                       name, "part.inside.line.up";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 194 194 194 255;
+                               rel1.to, "base";
+                               rel2 {
+                                       to, "base";
+                                       relative, 1.0 0.0;
+                               }
+                               min, 0 1;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               visible, 0;
+                       }
+                       description {
+                               state, "visible" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
+
+               part {
+                       name, "part.inside.line.left";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 194 194 194 255;
+                               rel1 {
+                                       to, "part.inside.line.up";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2 {
+                                       to, "base";
+                                       relative, 0.0 1.0;
+                               }
+                               min, 1 0;
+                               align, 0.0 0.5;
+                               fixed, 1 0;
+                               visible, 0;
+                       }
+                       description {
+                               state, "visible" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
+
+               part {
+                       name, "part.inside.line.right";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 194 194 194 255;
+                               rel1 {
+                                       to, "part.inside.line.up";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2.to, "base";
+                               min, 1 0;
+                               align, 1.0 0.5;
+                               fixed, 1 0;
+                               visible, 0;
+                       }
+                       description {
+                               state, "visible" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
+
+               part {
+                       name, "part.inside.line.down";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 194 194 194 255;
+                               rel1 {
+                                       to, "part.inside.line.left";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "part.inside.line.right";
+                                       relative, 0.0 1.0;
+                               }
+                               min, 0 1;
+                               align, 0.5 1.0;
+                               fixed, 0 1;
+                               visible, 0;
+                       }
+                       description {
+                               state, "visible" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
+
+               part {
+                       name, "elm.swallow.content";
+                       type, SWALLOW;
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, "base";
+                               rel2.to, "base";
+                       }
+               }
+       }
+
+       programs {
+               program {
+                       signal, "show";
+                       source, "";
+                       action, STATE_SET "visible" 0.0;
+                       target, "base";
+                       target, "part.inside.line.up";
+                       target, "part.inside.line.left";
+                       target, "part.inside.line.right";
+                       target, "part.inside.line.down";
+                       transition, DECELERATE 0.5;
+               }
+               program {
+                       signal, "hide";
+                       source, "";
+                       action, STATE_SET "default" 0.0;
+                       target, "base";
+                       target, "part.inside.line.up";
+                       target, "part.inside.line.left";
+                       target, "part.inside.line.right";
+                       target, "part.inside.line.down";
+               }
+               program {
+                       signal, "elm,hide";
+                       source, "elm";
+                       action, STATE_SET "default" 0.0;
+                       target, "base";
+                       target, "part.inside.line.up";
+                       target, "part.inside.line.left";
+                       target, "part.inside.line.right";
+                       target, "part.inside.line.down";
+                       transition, DECELERATE 0.5;
+               }
+       }
+}
index f9a200122533c7d2a5e52320732f3cb27fa741a7..829dd4253a605275dc010291cf07144f1053bab3 100644 (file)
@@ -186,6 +186,51 @@ Evas_Object *utils_add_table(Evas_Object *parent, const char *part,
        return table;
 }
 
+Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
+               const char *noti_style, const char *label_style, int timeout)
+{
+       Evas_Object *notify, *lbl;
+
+       if (!parent) {
+               _ERR("Invalid argument.");
+               return NULL;
+       }
+
+       notify = elm_notify_add(parent);
+       if (!notify) {
+               _ERR("elm_notify_add failed.");
+               return NULL;
+       }
+
+       evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND,
+                       EVAS_HINT_EXPAND);
+       elm_notify_align_set(notify, 0.0, 1.0);
+       elm_notify_timeout_set(notify, timeout);
+
+       if (noti_style)
+               elm_object_style_set(notify, noti_style);
+
+       lbl = elm_label_add(notify);
+       if (!lbl) {
+               _ERR("elm_label_add failed.");
+               evas_object_del(notify);
+               return NULL;
+       }
+
+       elm_object_content_set(notify, lbl);
+       evas_object_show(lbl);
+
+       if (label_style)
+               elm_object_style_set(lbl, label_style);
+
+       if (text)
+               elm_object_text_set(lbl, text);
+
+       evas_object_show(notify);
+
+       return notify;
+}
+
 bool utils_launch_app(const char *appid)
 {
        app_control_h app_ctrl;