summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehun Lim <jehun.lim@samsung.com>2015-10-01 11:02:46 +0900
committerJehun Lim <jehun.lim@samsung.com>2015-10-01 11:02:46 +0900
commit5c13e4f787c5a447d2f69663c658f24bb4bbb915 (patch)
tree11aee804c081e9e329c99145c95b962f0a48bba0
parent42643ae109ad310f9b356d996be1247aaefaa85d (diff)
downloadair_mediahub-5c13e4f787c5a447d2f69663c658f24bb4bbb915.tar.gz
air_mediahub-5c13e4f787c5a447d2f69663c658f24bb4bbb915.tar.bz2
air_mediahub-5c13e4f787c5a447d2f69663c658f24bb4bbb915.zip
detail: add music genre detail view
Change-Id: Id4933d5153ff8cae9413ffede36a320acaf84695 Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
-rw-r--r--include/view.h1
-rw-r--r--res/edc/widgets/gengrid.edc42
-rw-r--r--src/grid/grid_music.c25
-rw-r--r--src/view/detail.c19
4 files changed, 79 insertions, 8 deletions
diff --git a/include/view.h b/include/view.h
index 21e0f03..ef90d13 100644
--- a/include/view.h
+++ b/include/view.h
@@ -62,6 +62,7 @@ enum detail_view_type {
E_DETAIL_MOVIE_GENRE = 0,
E_DETAIL_MUSIC_ALBUM,
E_DETAIL_MUSIC_ARTIST,
+ E_DETAIL_MUSIC_GENRE,
E_DETAIL_MAX
};
diff --git a/res/edc/widgets/gengrid.edc b/res/edc/widgets/gengrid.edc
index 4063fed..6bd69a5 100644
--- a/res/edc/widgets/gengrid.edc
+++ b/res/edc/widgets/gengrid.edc
@@ -2109,25 +2109,55 @@ group {
}
}
part {
+ name: "padding_title_left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.to: "bg";
+ rel2 {
+ to: "bg";
+ relative: 0.0 1.0;
+ }
+ min: 14 0;
+ align: 0.0 0.5;
+ fixed: 1 0;
+ }
+ }
+ part {
+ name: "padding_title_right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "bg";
+ relative: 1.0 0.0;
+ }
+ rel2.to: "bg";
+ min: 14 0;
+ align: 1.0 0.5;
+ fixed: 1 0;
+ }
+ }
+ part {
name: PART_ELM_TEXT_TITLE;
type: TEXT;
scale: 1;
description {
state: "default" 0.0;
rel1 {
- to: "bg";
- relative: 0.5 0.5;
+ to: "padding_title_left";
+ relative: 1.0 0.5;
}
rel2 {
- to: "bg";
- relative: 0.5 0.5;
+ to: "padding_title_right";
+ relative: 0.0 0.5;
}
text {
font: FONT_LIGHT;
size: 28;
- min: 1 0;
align: 0.5 0.5;
- ellipsis: -1;
}
min: 0 28;
align: 0.5 0.5;
diff --git a/src/grid/grid_music.c b/src/grid/grid_music.c
index b4e327c..2bf8a38 100644
--- a/src/grid/grid_music.c
+++ b/src/grid/grid_music.c
@@ -404,6 +404,30 @@ static void _artist_selected_cb(void *data, Elm_Object_Item *it)
viewmgr_push_view(VIEW_DETAIL);
}
+static void _genre_selected_cb(void *data, Elm_Object_Item *it)
+{
+ struct view_update_data vdata;
+ struct group_info *gi;
+
+ if (!it) {
+ _ERR("invalid argument");
+ return;
+ }
+
+ gi = elm_object_item_data_get(it);
+ if (!gi) {
+ _ERR("failed to get group info");
+ return;
+ }
+
+ vdata.list = gi->list;
+ vdata.index = E_DETAIL_MUSIC_GENRE;
+ vdata.id = gi->name;
+
+ viewmgr_update_view(VIEW_DETAIL, UPDATE_CONTENT, &vdata);
+ viewmgr_push_view(VIEW_DETAIL);
+}
+
static struct grid_class _gclass[] = {
[E_MUSIC_SONG] = {
.item_style = STYLE_MUSIC_SONG,
@@ -468,6 +492,7 @@ static struct grid_data _gdata[] = {
.gclass = &_gclass[E_MUSIC_GENRE],
.get_item_list = _get_genre_list,
.free_item_list = _free_group_list,
+ .selected_cb = _genre_selected_cb,
},
/* Other view mode data will be added later */
};
diff --git a/src/view/detail.c b/src/view/detail.c
index 066521b..7d28b1c 100644
--- a/src/view/detail.c
+++ b/src/view/detail.c
@@ -89,6 +89,15 @@ static struct _view_info view_info[E_DETAIL_MAX] = {
.selected = _album_selected,
.detail_update = EINA_TRUE,
},
+ [E_DETAIL_MUSIC_GENRE] = {
+ .grid_style = STYLE_MUSIC_SONG_DETAIL,
+ .grid_item_x = MUSIC_SONG_ITEM_X,
+ .grid_item_y = MUSIC_SONG_ITEM_Y,
+ .get_grid_text = _grid_text_get,
+ .get_grid_content = _grid_content_get,
+ .get_content_info = _get_song_count,
+ .detail_update = EINA_FALSE,
+ },
};
struct _priv {
@@ -192,12 +201,18 @@ static void _media_selected(void *data)
vdata.list = priv->media_list;
vdata.index = util_get_media_index(vdata.list, am);
- if (priv->view_type == E_DETAIL_MOVIE_GENRE) {
+ switch (priv->view_type) {
+ case E_DETAIL_MOVIE_GENRE:
viewmgr_update_view(VIEW_VIEWER, UPDATE_CONTENT, &vdata);
viewmgr_push_view(VIEW_VIEWER);
- } else if (priv->view_type == E_DETAIL_MUSIC_ALBUM) {
+ break;
+ case E_DETAIL_MUSIC_ALBUM:
+ case E_DETAIL_MUSIC_GENRE:
viewmgr_update_view(VIEW_MPLAYER, UPDATE_CONTENT, &vdata);
viewmgr_push_view(VIEW_MPLAYER);
+ break;
+ default:
+ break;
}
}