diff options
author | Eugene Kurzberg <i.kurtsberg@samsung.com> | 2017-11-10 09:46:33 +0200 |
---|---|---|
committer | Eugene Kurzberg <i.kurtsberg@samsung.com> | 2017-11-13 11:12:28 +0200 |
commit | aca278e50724d889caa89011f618c513b9e9d192 (patch) | |
tree | 5d4778ce1f0114528f35a0cbdd1c708172d12802 | |
parent | 2f064bfa9923aa08a9f0e9d1e788ca29fa094677 (diff) | |
download | voice-control-aca278e50724d889caa89011f618c513b9e9d192.tar.gz voice-control-aca278e50724d889caa89011f618c513b9e9d192.tar.bz2 voice-control-aca278e50724d889caa89011f618c513b9e9d192.zip |
TizenRefApp-9766 Switch to floating mode when connection appears during VC launch
Implemented possibility to change view's state during animation.
Change-Id: I3e3b84eacdddfcc80952e29b71f0071c107d765c
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
-rw-r--r-- | voice-app/res/voice/edje/voice-view-layout.edc | 139 |
1 files changed, 94 insertions, 45 deletions
diff --git a/voice-app/res/voice/edje/voice-view-layout.edc b/voice-app/res/voice/edje/voice-view-layout.edc index 5907be7..5756f31 100644 --- a/voice-app/res/voice/edje/voice-view-layout.edc +++ b/voice-app/res/voice/edje/voice-view-layout.edc @@ -73,6 +73,9 @@ collections { public is_visible; public is_minimized; + public requested_visible; + public requested_minimized; + public is_enabled; public is_pressed; public is_dragged; @@ -182,43 +185,65 @@ collections { program { "show_feedback"; script { run_program(PROGRAM:"reset_text"); - if (get_int(is_animating) == 0 && get_int(is_visible) == 0) { - run_program(PROGRAM:"show_bg"); - run_program(PROGRAM:"show_feedback_bg"); - run_program(PROGRAM:"show_feedback_effect"); - run_program(PROGRAM:"show_text"); - run_program(PROGRAM:"on_feedback_shown"); - set_int(is_animating, 1); + if (!get_int(is_visible)) { + if (!get_int(is_animating)) { + run_program(PROGRAM:"show_bg"); + run_program(PROGRAM:"show_feedback_bg"); + run_program(PROGRAM:"show_feedback_effect"); + run_program(PROGRAM:"show_text"); + run_program(PROGRAM:"on_feedback_shown"); + + set_int(is_visible, 1); + set_int(is_animating, 1); + } + set_int(requested_visible, 1); + } + } + } + program { "hide_feedback"; + script { + if (get_int(is_visible) && !get_int(is_minimized)) { + if (!get_int(is_animating)) { + run_program(PROGRAM:"hide_bg"); + run_program(PROGRAM:"hide_feedback_bg"); + run_program(PROGRAM:"hide_feedback_effect"); + run_program(PROGRAM:"hide_text"); + run_program(PROGRAM:"on_feedback_hidden"); + + set_int(is_visible, 0); + set_int(is_animating, 1); + } + set_int(requested_visible, 0); + } + } + } + program { "update_visible_state"; + script { + if (get_int(is_visible) != get_int(requested_visible)) { + run_program(get_int(requested_visible) + ? PROGRAM:"show_feedback" : PROGRAM:"hide_feedback"); } } } program { "on_feedback_shown"; in: FEEDBACK_ANIM_TIME 0; script { - set_int(is_visible, 1); - set_int(is_animating, 0); emit(SIGNAL_FEEDBACK_SHOWN, ""); + run_program(PROGRAM:"on_animation_finished"); run_program(PROGRAM:"scroll_text"); } } - program { "hide_feedback"; + program { "on_feedback_hidden"; + in: FEEDBACK_ANIM_TIME 0; script { - if (get_int(is_animating) == 0 && get_int(is_visible) == 1 && get_int(is_minimized) == 0) { - run_program(PROGRAM:"hide_bg"); - run_program(PROGRAM:"hide_feedback_bg"); - run_program(PROGRAM:"hide_feedback_effect"); - run_program(PROGRAM:"hide_text"); - run_program(PROGRAM:"on_feedback_hidden"); - set_int(is_animating, 1); - } + emit(SIGNAL_FEEDBACK_HIDDEN, ""); + run_program(PROGRAM:"on_animation_finished"); } } - program { "on_feedback_hidden"; - in: FEEDBACK_ANIM_TIME 0; + program { "on_animation_finished"; script { - set_int(is_visible, 0); set_int(is_animating, 0); - emit(SIGNAL_FEEDBACK_HIDDEN, ""); + run_program(PROGRAM:"update_visible_state"); } } program { "show_bg"; @@ -468,6 +493,7 @@ collections { } } program_remove: "on_hide_feedback"; + program_remove: "on_animation_finished"; programs { program { signal: SIGNAL_FEEDBACK_SHOW; @@ -498,46 +524,69 @@ collections { } program { "minimize"; script { - if (get_int(is_animating) == 0 && get_int(is_minimized) == 0 && get_int(is_visible) == 1) { - run_program(PROGRAM:"minimize_bg"); - run_program(PROGRAM:"minimize_feedback_effect"); - run_program(PROGRAM:"minimize_text"); - run_program(PROGRAM:"show_button"); - run_program(PROGRAM:"on_minimized"); - set_int(is_animating, 1); + if (!get_int(is_minimized) && get_int(is_visible)) { + if (!get_int(is_animating)) { + run_program(PROGRAM:"minimize_bg"); + run_program(PROGRAM:"minimize_feedback_effect"); + run_program(PROGRAM:"minimize_text"); + run_program(PROGRAM:"show_button"); + run_program(PROGRAM:"on_minimized"); + + set_int(is_minimized, 1); + set_int(is_animating, 1); + } + set_int(requested_minimized, 1); } } } - program { "on_minimized"; - in: BUTTON_ANIM_TIME 0; + program { "maximize"; script { - set_int(is_minimized, 1); - set_int(is_animating, 0); - emit(SIGNAL_FEEDBACK_HIDDEN, ""); + run_program(PROGRAM:"reset_text"); + if (get_int(is_minimized)) { + if (!get_int(is_animating)) { + run_program(PROGRAM:"maximize_bg"); + run_program(PROGRAM:"maximize_feedback_effect"); + run_program(PROGRAM:"maximize_text"); + run_program(PROGRAM:"hide_button"); + run_program(PROGRAM:"on_maximized"); + + set_int(is_minimized, 0); + set_int(is_animating, 1); + } + set_int(requested_minimized, 0); + } } } - program { "maximize"; + program { "update_minimized_state"; script { - run_program(PROGRAM:"reset_text"); - if (get_int(is_animating) == 0 && get_int(is_minimized) == 1) { - run_program(PROGRAM:"maximize_bg"); - run_program(PROGRAM:"maximize_feedback_effect"); - run_program(PROGRAM:"maximize_text"); - run_program(PROGRAM:"hide_button"); - run_program(PROGRAM:"on_maximized"); - set_int(is_animating, 1); + if (get_int(is_minimized) != get_int(requested_minimized)) { + run_program(get_int(requested_minimized) + ? PROGRAM:"minimize" : PROGRAM:"maximize"); } } } + program { "on_minimized"; + in: BUTTON_ANIM_TIME 0; + script { + emit(SIGNAL_FEEDBACK_HIDDEN, ""); + run_program(PROGRAM:"on_animation_finished"); + } + } program { "on_maximized"; in: BUTTON_ANIM_TIME 0; script { - set_int(is_minimized, 0); - set_int(is_animating, 0); emit(SIGNAL_FEEDBACK_SHOWN, ""); + run_program(PROGRAM:"on_animation_finished"); run_program(PROGRAM:"scroll_text"); } } + program { "on_animation_finished"; + script { + set_int(is_animating, 0); + run_program(PROGRAM:"update_visible_state"); + run_program(PROGRAM:"update_minimized_state"); + } + } program { signal: SIGNAL_FLOATING; source: "*"; |