From 821526ef7aa76fc789e03fc8b94fa867a090f58a Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Wed, 7 Jan 2015 15:52:18 -0800 Subject: [PATCH] Add support to disable/enable Homescreen animation Change-Id: If3b590a98e69fc1af624e2f90a333077ea6e5103 Signed-off-by: Jimmy Huang --- css/style.css | 9 ++++++--- js/main.js | 37 ++++++++++++++++++------------------ packaging/modello-homescreen.changes | 3 +++ 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/css/style.css b/css/style.css index f14a161..a037eea 100644 --- a/css/style.css +++ b/css/style.css @@ -484,7 +484,8 @@ -webkit-animation-duration: 10s; -webkit-animation-delay: 0s; -webkit-animation-timing-function: linear; - -webkit-animation-iteration-count: 1;/*infinite;*/ + -webkit-animation-iteration-count: infinite; + -webkit-animation-play-state: paused; } .rollLeft { @@ -492,7 +493,8 @@ -webkit-animation-duration: 10s; -webkit-animation-delay: 0s; -webkit-animation-timing-function: linear; - -webkit-animation-iteration-count: 1;/*infinite;*/ + -webkit-animation-iteration-count: infinite; + -webkit-animation-play-state: paused; } .liveBg { @@ -500,8 +502,9 @@ -webkit-animation-duration: 7s; -webkit-animation-delay: 0s; -webkit-animation-timing-function: ease-out; - -webkit-animation-iteration-count: 1; + -webkit-animation-iteration-count: infinite; -webkit-transition: opacity 500ms ease-out; + -webkit-animation-play-state: paused; } @-webkit-keyframes rotateR { diff --git a/js/main.js b/js/main.js index b058062..90515db 100644 --- a/js/main.js +++ b/js/main.js @@ -84,27 +84,26 @@ var init = function() { }); + var checkAnimationConfig = function() { + var animation = Configuration.get("animationEnabled"); + if (animation === undefined || animation) { + $(".rollRight").css("-webkit-animation-play-state", "running"); + $(".rollLeft").css("-webkit-animation-play-state", "running"); + $(".liveBg").css("-webkit-animation-play-state", "running"); + } else { + $(".rollRight").css("-webkit-animation-play-state", "paused"); + $(".rollLeft").css("-webkit-animation-play-state", "paused"); + $(".liveBg").css("-webkit-animation-play-state", "paused"); + } + }; + /* fixed webkit animation bugs */ window.setTimeout(function() { - window.setInterval(function() { - $("#innerRing").removeClass("rollLeft"); - $("#outerRing").removeClass("rollRight"); - window.setTimeout(function() { - $("#innerRing").addClass("rollLeft"); - $("#outerRing").addClass("rollRight"); - }, 50); - - }, 10000); - }, 1000); - window.setTimeout(function() { - window.setInterval(function() { - $('#wrapper .step9').removeClass('liveBg'); - window.setTimeout(function() { - $('#wrapper .step9').addClass('liveBg'); - }, 50); - - }, 7000); - }, 500); + checkAnimationConfig(); + Configuration.addUpdateListener(function() { + checkAnimationConfig(); + }); + }, 1000); /* end fixed webkit animation bugs */ }; diff --git a/packaging/modello-homescreen.changes b/packaging/modello-homescreen.changes index bb41073..815076d 100644 --- a/packaging/modello-homescreen.changes +++ b/packaging/modello-homescreen.changes @@ -1,3 +1,6 @@ +* Wed Jan 07 2015 Jimmy Huang accepted/tizen/ivi/20141112.110519-1-g9a41e9e +- Add support to disable/enable Homescreen animation + * Tue Oct 07 2014 Brian Jones submit/tizen_ivi/20141007.175535-1-g0b3ff06 - Fix systemd install path on 64-bit architecture - use systemd macro for path. -- 2.7.4