/* Style */
#define STYLE_MENU_BTN "style.menu.button"
+#define STYLE_APP "style.app"
/* Font */
#define FONT_TIZENSANS_REGULAR "TizenSans"
#define STR_APPS "Apps"
#define STR_MYAPPS "My Apps"
#define STR_APPSTORE "App Store"
+#define STR_NULL "(NULL)"
/* Count */
#define MENU_COUNT 2
+/* Size */
+#define SIZE_GRID_WIDTH (212+26)
+#define SIZE_GRID_HEIGHT (294+26)
+
#endif /* __AIR_APPS_DEFINE_H__ */
collections {
#include "widget/button.edc"
+ #include "widget/gengrid.edc"
}
scale, 1;
description {
state, "default" 0.0;
- min, 0 134;
- rel1 {
- to, "title.bg";
- relative, 0.0 1.0;
- }
- rel2.to, "title.bg";
- fixed, 0 1;
- align, 0.5 0.0;
+ min, 62 318;
+ rel2.relative, 0.0 0.0;
+ fixed, 1 1;
+ align, 0.0 0.0;
}
}
scale, 1;
description {
state, "default" 0.0;
- min, 0 614;
rel1 {
to, "padding.grid";
- relative, 0.0 1.0;
+ relative, 1.0 1.0;
}
- rel2.to, "padding.grid";
- fixed, 0 1;
- align, 0.5 0.0;
}
}
}
--- /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/gengrid/item/style.app/default";
+ data.item, "focus_highlight" "on";
+ data.item, "texts" "elm.text";
+ data.item, "contents" "elm.swallow.icon";
+ parts {
+ part {
+ name, "padding.bottom.right";
+ type, SPACER;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 26 26;
+ rel1.relative, 1.0 1.0;
+ fixed, 1 1;
+ align, 1.0 1.0;
+ }
+ }
+
+ part {
+ name, "bg";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ color, 255 255 255 255;
+ min, 212 294;
+ rel2 {
+ to, "padding.bottom.right";
+ relative, 0.0 0.0;
+ }
+ fixed, 1 1;
+ }
+ }
+
+ part {
+ name, "text.bg";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ /* FIXME: The color is temporarily defined. */
+ color, 0 119 246 80;
+ min, 212 82;
+ rel1.to, "padding.bottom.right";
+ rel2 {
+ to, "padding.bottom.right";
+ relative, 0.0 0.0;
+ }
+ align, 1.0 1.0;
+ fixed, 1 1;
+ }
+ }
+
+ part {
+ name, "padding.elm.text";
+ type, SPACER;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 18 0;
+ rel1.to, "text.bg";
+ rel2 {
+ to, "text.bg";
+ relative, 0.0 1.0;
+ }
+ align, 0.0 0.5;
+ fixed, 1 0;
+ }
+ }
+
+ part {
+ name, "elm.text";
+ type, TEXT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ color, 255 255 255 255;
+ min, 176 82;
+ rel1 {
+ to, "padding.elm.text";
+ relative, 1.0 0.0;
+ }
+ rel2 {
+ to, "padding.elm.text";
+ relative, 1.0 0.0;
+ }
+ align, 0.0 0.0;
+ fixed, 1 1;
+ text {
+ font, FONT_TIZENSANS_LIGHT;
+ size, 28;
+ align, 0.0 0.5;
+ }
+ }
+ }
+
+ part {
+ name, "padding.elm.icon";
+ type, SPACER;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 56 56;
+ rel2.relative, 0.0 0.0;
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+
+ part {
+ name, "elm.swallow.icon";
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 100 100;
+ rel1 {
+ to, "padding.elm.icon";
+ relative, 1.0 1.0;
+ }
+ rel2.to, "padding.elm.icon";
+ align, 0.0 0.0;
+ fixed, 1 1;
+ }
+ }
+ }
+}
#include <gridmgr.h>
#include <app_debug.h>
+#include "define.h"
+#include "data/app.h"
+
static char *_text_get(void *data, Evas_Object *obj, const char *part)
{
- /* It will implemented later. */
+ struct app_data *adata;
+
+ if (!data) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+ adata = data;
- return NULL;
+ return get_app_name(adata);
}
static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part)
{
- /* It will implemented later. */
+ struct app_data *adata;
+ Evas_Object *img;
+ char *icon;
+
+ if (!data || !obj) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+ adata = data;
+
+ icon = get_app_icon(adata);
+
+ img = elm_image_add(obj);
+ if (!img) {
+ _ERR("elm_image_add failed.");
+ return NULL;
+ }
+
+ if (!icon || !strcmp(icon, STR_NULL))
+ /* FIXME: The default icon image should be registerd. */
+ elm_image_file_set(img, NULL, NULL);
+ else
+ elm_image_file_set(img, icon, NULL);
- return NULL;
+ return img;
}
static struct grid_class _gclass = {
- .item_style = "default",
+ .item_style = STYLE_APP,
.text_get = _text_get,
.content_get = _content_get,
.state_get = NULL,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_gengrid_multi_select_set(grid, EINA_FALSE);
+ elm_gengrid_horizontal_set(grid, EINA_TRUE);
+ elm_gengrid_align_set(grid, 0.0, 0.0);
+ elm_gengrid_item_size_set(grid,
+ elm_config_scale_get() * SIZE_GRID_WIDTH,
+ elm_config_scale_get() * SIZE_GRID_HEIGHT);
+
gclass = get_myapps_grid_class();
if (!gclass) {
_ERR("Get myapps grid class failed.");