diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2015-06-22 14:22:01 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-06-22 14:52:29 +0900 |
commit | f7fed81cffcd28b00fcd255275e4de42407bdae1 (patch) | |
tree | 4f57d366dd26a7c26c3aa69365c698f0143dfa5b | |
parent | ce128cedad25d38a08e9f5c95ca2ccf9b9a2521e (diff) | |
download | air_mediahub-f7fed81cffcd28b00fcd255275e4de42407bdae1.tar.gz air_mediahub-f7fed81cffcd28b00fcd255275e4de42407bdae1.tar.bz2 air_mediahub-f7fed81cffcd28b00fcd255275e4de42407bdae1.zip |
viewer: add control buttons and images
Change-Id: I097ac4b84184aedc980ed6f9b5fc46b65affd4b0
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
22 files changed, 506 insertions, 1 deletions
diff --git a/include/define.h b/include/define.h index 8fd4bf9..01e05bf 100644 --- a/include/define.h +++ b/include/define.h @@ -40,5 +40,6 @@ #define COLOR_TEXT_FOCUS 255 255 255 255 #define COLOR_TEXT_SELECTED 64 136 211 255 #define COLOR_TEXT_DISABLED 87 87 87 128 +#define COLOR_BTN_FOCUS 22 120 224 255 #endif /* __AIR_MEDIAHUB_DEFINE_H__ */ diff --git a/include/view/viewer.h b/include/view/viewer.h index 019f5c8..4de2b2b 100644 --- a/include/view/viewer.h +++ b/include/view/viewer.h @@ -31,7 +31,24 @@ #define PART_VIEWER_PROGRESS "part.viewer_progress" #define PART_VIEWER_TOTAL "part.viewer_total" +/* signal */ +#define SIG_SET_PLAY "set,play,icon" +#define SIG_SET_PAUSE "set,pause,icon" + /* images */ #define IMAGE_VIEWER_FAVORITE "ic_title_favorite.png" +#define IMAGE_VIEWER_PREV_FOCUS "btn_view_contr_previous_foc.png" +#define IMAGE_VIEWER_PREV_NORMAL "btn_view_contr_previous_nor.png" +#define IMAGE_VIEWER_REW_FOCUS "btn_view_contr_rewind_foc.png" +#define IMAGE_VIEWER_REW_NORMAL "btn_view_contr_rewind_nor.png" +#define IMAGE_VIEWER_PLAY_FOCUS "btn_view_contr_play_foc.png" +#define IMAGE_VIEWER_PLAY_NORMAL "btn_view_contr_play_nor.png" +#define IMAGE_VIEWER_PAUSE_FOCUS "btn_view_contr_pause_foc.png" +#define IMAGE_VIEWER_PAUSE_NORMAL "btn_view_contr_pause_nor.png" +#define IMAGE_VIEWER_FF_FOCUS "btn_view_contr_forward_foc.png" +#define IMAGE_VIEWER_FF_NORMAL "btn_view_contr_forward_nor.png" +#define IMAGE_VIEWER_NEXT_FOCUS "btn_view_contr_next_foc.png" +#define IMAGE_VIEWER_NEXT_NORMAL "btn_view_contr_next_nor.png" + #endif /* __AIR_MEDIAHUB_VIEW_VIEWER_H__ */ diff --git a/res/edc/images/btn_view_contr_forward_foc.png b/res/edc/images/btn_view_contr_forward_foc.png Binary files differnew file mode 100644 index 0000000..6f66d10 --- /dev/null +++ b/res/edc/images/btn_view_contr_forward_foc.png diff --git a/res/edc/images/btn_view_contr_forward_nor.png b/res/edc/images/btn_view_contr_forward_nor.png Binary files differnew file mode 100644 index 0000000..0fdcfd5 --- /dev/null +++ b/res/edc/images/btn_view_contr_forward_nor.png diff --git a/res/edc/images/btn_view_contr_next_foc.png b/res/edc/images/btn_view_contr_next_foc.png Binary files differnew file mode 100644 index 0000000..f859c5a --- /dev/null +++ b/res/edc/images/btn_view_contr_next_foc.png diff --git a/res/edc/images/btn_view_contr_next_nor.png b/res/edc/images/btn_view_contr_next_nor.png Binary files differnew file mode 100644 index 0000000..c1c80a9 --- /dev/null +++ b/res/edc/images/btn_view_contr_next_nor.png diff --git a/res/edc/images/btn_view_contr_pause_foc.png b/res/edc/images/btn_view_contr_pause_foc.png Binary files differnew file mode 100644 index 0000000..bf16270 --- /dev/null +++ b/res/edc/images/btn_view_contr_pause_foc.png diff --git a/res/edc/images/btn_view_contr_pause_nor.png b/res/edc/images/btn_view_contr_pause_nor.png Binary files differnew file mode 100644 index 0000000..8fda0f2 --- /dev/null +++ b/res/edc/images/btn_view_contr_pause_nor.png diff --git a/res/edc/images/btn_view_contr_play_foc.png b/res/edc/images/btn_view_contr_play_foc.png Binary files differnew file mode 100644 index 0000000..c62f119 --- /dev/null +++ b/res/edc/images/btn_view_contr_play_foc.png diff --git a/res/edc/images/btn_view_contr_play_nor.png b/res/edc/images/btn_view_contr_play_nor.png Binary files differnew file mode 100644 index 0000000..f3e0408 --- /dev/null +++ b/res/edc/images/btn_view_contr_play_nor.png diff --git a/res/edc/images/btn_view_contr_previous_foc.png b/res/edc/images/btn_view_contr_previous_foc.png Binary files differnew file mode 100644 index 0000000..da1bb3b --- /dev/null +++ b/res/edc/images/btn_view_contr_previous_foc.png diff --git a/res/edc/images/btn_view_contr_previous_nor.png b/res/edc/images/btn_view_contr_previous_nor.png Binary files differnew file mode 100644 index 0000000..e5c8d2b --- /dev/null +++ b/res/edc/images/btn_view_contr_previous_nor.png diff --git a/res/edc/images/btn_view_contr_rewind_foc.png b/res/edc/images/btn_view_contr_rewind_foc.png Binary files differnew file mode 100644 index 0000000..8389b19 --- /dev/null +++ b/res/edc/images/btn_view_contr_rewind_foc.png diff --git a/res/edc/images/btn_view_contr_rewind_nor.png b/res/edc/images/btn_view_contr_rewind_nor.png Binary files differnew file mode 100644 index 0000000..b49a2d7 --- /dev/null +++ b/res/edc/images/btn_view_contr_rewind_nor.png diff --git a/res/edc/images/btn_view_slide_next_foc.png b/res/edc/images/btn_view_slide_next_foc.png Binary files differnew file mode 100644 index 0000000..d13d8d4 --- /dev/null +++ b/res/edc/images/btn_view_slide_next_foc.png diff --git a/res/edc/images/btn_view_slide_next_nor.png b/res/edc/images/btn_view_slide_next_nor.png Binary files differnew file mode 100644 index 0000000..9259d23 --- /dev/null +++ b/res/edc/images/btn_view_slide_next_nor.png diff --git a/res/edc/images/btn_view_slide_previous_foc.png b/res/edc/images/btn_view_slide_previous_foc.png Binary files differnew file mode 100644 index 0000000..df8a072 --- /dev/null +++ b/res/edc/images/btn_view_slide_previous_foc.png diff --git a/res/edc/images/btn_view_slide_previous_nor.png b/res/edc/images/btn_view_slide_previous_nor.png Binary files differnew file mode 100644 index 0000000..0f47c20 --- /dev/null +++ b/res/edc/images/btn_view_slide_previous_nor.png diff --git a/res/edc/images/ic_title_favorite.png b/res/edc/images/ic_title_favorite.png Binary files differindex 33e21b0..fdb043f 100644 --- a/res/edc/images/ic_title_favorite.png +++ b/res/edc/images/ic_title_favorite.png diff --git a/res/edc/mediahub-theme.edc b/res/edc/mediahub-theme.edc index b7002c0..8f01d57 100644 --- a/res/edc/mediahub-theme.edc +++ b/res/edc/mediahub-theme.edc @@ -14,5 +14,8 @@ * limitations under the License. */ +#include "../../include/define.h" + collections { + #include "widgets/button.edc" } diff --git a/res/edc/view/viewer.edc b/res/edc/view/viewer.edc index f2179a3..84cb95a 100644 --- a/res/edc/view/viewer.edc +++ b/res/edc/view/viewer.edc @@ -260,9 +260,109 @@ group { } fixed: 1 1; align: 0.5 0.5; + visible: 0; + } + } + part { + name: "control_btn0"; + type: SWALLOW; + clip_to: "bottomarea"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + rel1 { + to: "controls_bg"; + relative: 0.0 0.5; + } + rel2 { + to: "controls_bg"; + relative: 0.0 0.5; + } + fixed: 1 1; + align: 0.0 0.5; + } + } + part { + name: "control_btn1"; + type: SWALLOW; + clip_to: "bottomarea"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + rel1 { + to: "control_btn0"; + relative: 1.0 0.5; + } + rel2 { + to: "control_btn0"; + relative: 1.0 0.5; + } + fixed: 1 1; + align: 0.0 0.5; + } + } + part { + name: "control_btn2"; + type: SWALLOW; + clip_to: "bottomarea"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + rel1 { + to: "control_btn1"; + relative: 1.0 0.5; + } + rel2 { + to: "control_btn1"; + relative: 1.0 0.5; + } + fixed: 1 1; + align: 0.0 0.5; + } + } + part { + name: "control_btn3"; + type: SWALLOW; + clip_to: "bottomarea"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + rel1 { + to: "control_btn2"; + relative: 1.0 0.5; + } + rel2 { + to: "control_btn2"; + relative: 1.0 0.5; + } + fixed: 1 1; + align: 0.0 0.5; + } + } + part { + name: "control_btn4"; + type: SWALLOW; + clip_to: "bottomarea"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + rel1 { + to: "control_btn3"; + relative: 1.0 0.5; + } + rel2 { + to: "control_btn3"; + relative: 1.0 0.5; + } + fixed: 1 1; + align: 0.0 0.5; } } - part { name: "padding_time"; type: SPACER; diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc new file mode 100644 index 0000000..d837845 --- /dev/null +++ b/res/edc/widgets/button.edc @@ -0,0 +1,384 @@ +/* + * 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. + */ + +#define STATE_PLAY 0 +#define STATE_PAUSE 1 + +group { + name: "elm/button/base/viewer_btn_prev"; + data.item, "focus_highlight" "on"; + images { + image: IMAGE_VIEWER_PREV_NORMAL COMP; + image: IMAGE_VIEWER_PREV_FOCUS COMP; + } + parts { + part { + name: "color"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + } + description { + state: "selected" 0.0; + color: COLOR_BTN_FOCUS; + } + } + part { + name: "bg"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + image { + normal: IMAGE_VIEWER_PREV_NORMAL; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_PREV_FOCUS; + } + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + script { + set_state(PART:"bg", "selected", 0.0); + set_state(PART:"color", "selected", 0.0); + } + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + script { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + } +} + +group { + name: "elm/button/base/viewer_btn_rew"; + data.item, "focus_highlight" "on"; + images { + image: IMAGE_VIEWER_REW_NORMAL COMP; + image: IMAGE_VIEWER_REW_FOCUS COMP; + } + parts { + part { + name: "color"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + } + description { + state: "selected" 0.0; + color: COLOR_BTN_FOCUS; + } + } + part { + name: "bg"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + image { + normal: IMAGE_VIEWER_REW_NORMAL; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_REW_FOCUS; + } + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + script { + set_state(PART:"bg", "selected", 0.0); + set_state(PART:"color", "selected", 0.0); + } + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + script { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + } +} + +group { + name: "elm/button/base/viewer_btn_play"; + data.item, "focus_highlight" "on"; + images { + image: IMAGE_VIEWER_PLAY_NORMAL COMP; + image: IMAGE_VIEWER_PLAY_FOCUS COMP; + image: IMAGE_VIEWER_PAUSE_NORMAL COMP; + image: IMAGE_VIEWER_PAUSE_FOCUS COMP; + } + script { + public cur_state; + } + parts { + part { + name: "color"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + } + description { + state: "selected" 0.0; + color: COLOR_BTN_FOCUS; + } + } + part { + name: "bg"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + image { + normal: IMAGE_VIEWER_PLAY_NORMAL; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_PLAY_FOCUS; + } + } + description { + state: "default_pause" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_PAUSE_NORMAL; + } + } + description { + state: "selected_pause" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_PAUSE_FOCUS; + } + } + } + } + programs { + program { + name: "load"; + signal: "load"; + source: ""; + script { + set_int(cur_state, STATE_PLAY); + } + } + program { + name: SIG_SET_PLAY; + signal: SIG_SET_PLAY; + source: ""; + script { + set_int(cur_state, STATE_PLAY); + set_state(PART:"bg", "default", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + program { + name: SIG_SET_PAUSE; + signal: SIG_SET_PAUSE; + source: ""; + script { + set_int(cur_state, STATE_PAUSE); + set_state(PART:"bg", "default_pause", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + script { + new state; + state = get_int(cur_state); + + if (state == STATE_PLAY) + set_state(PART:"bg", "selected", 0.0); + else + set_state(PART:"bg", "selected_pause", 0.0); + + set_state(PART:"color", "selected", 0.0); + } + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + script { + new state; + state = get_int(cur_state); + + if (state == STATE_PLAY) + set_state(PART:"bg", "default", 0.0); + else + set_state(PART:"bg", "default_pause", 0.0); + + set_state(PART:"color", "default", 0.0); + } + } + } +} + +group { + name: "elm/button/base/viewer_btn_ff"; + data.item, "focus_highlight" "on"; + images { + image: IMAGE_VIEWER_FF_NORMAL COMP; + image: IMAGE_VIEWER_FF_FOCUS COMP; + } + parts { + part { + name: "color"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + } + description { + state: "selected" 0.0; + color: COLOR_BTN_FOCUS; + } + } + part { + name: "bg"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + image { + normal: IMAGE_VIEWER_FF_NORMAL; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_FF_FOCUS; + } + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + script { + set_state(PART:"bg", "selected", 0.0); + set_state(PART:"color", "selected", 0.0); + } + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + script { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + } +} + +group { + name: "elm/button/base/viewer_btn_next"; + data.item, "focus_highlight" "on"; + images { + image: IMAGE_VIEWER_NEXT_NORMAL COMP; + image: IMAGE_VIEWER_NEXT_FOCUS COMP; + } + parts { + part { + name: "color"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + } + description { + state: "selected" 0.0; + color: COLOR_BTN_FOCUS; + } + } + part { + name: "bg"; + scale: 1; + description { + state: "default" 0.0; + min: 180 143; + image { + normal: IMAGE_VIEWER_NEXT_NORMAL; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_VIEWER_NEXT_FOCUS; + } + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + script { + set_state(PART:"bg", "selected", 0.0); + set_state(PART:"color", "selected", 0.0); + } + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + script { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + } +} |