const char *text, const char *style);
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, const char *key, const char *value);
#endif /* __AIR_FAVORITE_UTILS_H__ */
#include "widgets/gengrid_apps.edc"
#include "widgets/gengrid_webs.edc"
#include "widgets/button.edc"
+ #include "widgets/notify.edc"
+ #include "widgets/label.edc"
}
--- /dev/null
+/*
+ * 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;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * 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;
+ }
+ }
+}
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, const char *key, const char *value)
{
app_control_h app_ctrl;
#include <viewmgr.h>
#include <inputmgr.h>
#include <app_contents.h>
+#include <app_define.h>
#include <app_debug.h>
#include "define.h"
static void _livetv_selected(void)
{
- if (!utils_launch_app(STR_LIVETV_APP_ID, NULL, NULL)) {
+ if (!utils_launch_app(APP_ID_LIVETV, NULL, NULL)) {
_ERR("Launch live tv failed.");
return;
}
}
}
+static void _update_grid_item_list(struct _priv *priv, struct grid_data *gdata)
+{
+ gdata->list = gdata->create_item_list();
+ if (!gdata->list) {
+ elm_object_part_text_set(priv->base, PART_NO_CONTENTS,
+ STR_NO_CONTENTS);
+ return;
+ }
+
+ if (!gridmgr_append_list(priv->gmgr, gdata->id, gdata->list))
+ _ERR("Gridmgr append list failed.");
+}
+
static bool _load_current_grid(struct _priv *priv, int id)
{
struct grid_data *gdata;
- Eina_List *list = NULL;
Evas_Object *prev_grid;
if (!priv || !priv->gmgr || !priv->base) {
prev_grid = elm_object_part_content_unset(priv->base, PART_GENGRID);
evas_object_hide(prev_grid);
- if (!gdata->list) {
- list = gdata->create_item_list();
- if (!list) {
- elm_object_part_text_set(priv->base, PART_NO_CONTENTS,
- STR_NO_CONTENTS);
- _draw_content_count(priv->base, 0, id);
-
- return true;
- }
-
- if (!gridmgr_append_list(priv->gmgr, gdata->id, list)) {
- _ERR("Gridmgr append list failed.");
- return false;
- }
-
- gdata->list = list;
- }
-
elm_object_part_content_set(priv->base, PART_GENGRID, gdata->grid);
evas_object_show(gdata->grid);
+ if (!gdata->list)
+ _update_grid_item_list(priv, gdata);
+
_draw_content_count(priv->base, eina_list_count(gdata->list), id);
return true;
gdata = data;
if (update_type == UPDATE_GRID) {
- if (!priv || !priv->gmgr || !priv->base)
- return;
-
- gdata->list = gdata->create_item_list();
- if (!gdata->list)
- elm_object_part_text_set(priv->base, PART_NO_CONTENTS,
- STR_NO_CONTENTS);
- else
- gridmgr_append_list(priv->gmgr, gdata->id, gdata->list);
-
+ _update_grid_item_list(priv, gdata);
_draw_content_count(priv->base, eina_list_count(gdata->list),
priv->cur_menu_id);
}