diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2019-04-08 18:16:07 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2019-04-10 09:50:06 +0900 |
commit | 8cc6188eaf2b333e169eab6f58857adcb7e47568 (patch) | |
tree | 44084784ccee6dc136e57cc78625f9a993d12eb8 /launcher/qml/ChangeItemPosition.js |
Add demo3 launcher source code for cluster modeneedlefish_13.93.0needlefish/13.93.0marlin_12.93.0marlin_12.92.0marlin_12.91.0marlin_12.90.1marlin_12.90.0marlin/12.93.0marlin/12.92.0marlin/12.91.0marlin/12.90.1marlin/12.90.0lamprey_11.92.0lamprey_11.91.0lamprey/11.92.0lamprey/11.91.0koi_10.93.0koi_10.92.0koi_10.91.0koi/10.93.0koi/10.92.0koi/10.91.0jellyfish_9.99.4jellyfish_9.99.3jellyfish_9.99.2jellyfish_9.99.1jellyfish/9.99.4jellyfish/9.99.3jellyfish/9.99.2jellyfish/9.99.1icefish_8.99.5icefish_8.99.4icefish_8.99.3icefish_8.99.2icefish_8.99.1icefish/8.99.5icefish/8.99.4icefish/8.99.3icefish/8.99.2icefish/8.99.1halibut_8.0.6halibut_8.0.5halibut_8.0.4halibut_8.0.3halibut_8.0.2halibut_8.0.1halibut_8.0.0halibut_7.99.3halibut_7.99.2halibut_7.99.1halibut/8.0.6halibut/8.0.5halibut/8.0.4halibut/8.0.3halibut/8.0.2halibut/8.0.1halibut/8.0.0halibut/7.99.3halibut/7.99.2halibut/7.99.19.99.49.99.39.99.29.99.18.99.58.99.48.99.38.99.28.99.18.0.68.0.58.0.48.0.38.0.28.0.18.0.07.99.37.99.27.99.113.93.012.93.012.92.012.91.012.90.112.90.011.92.011.91.010.93.010.92.010.91.0halibut
Add demo3 launcher source code for cluster mode.
[Patch Set 2]Update LICENSE file.
Change-Id: I9026690d30229b2587f4a6f02198cc88ba776f1d
BUG-AGL: SPEC-2261
Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'launcher/qml/ChangeItemPosition.js')
-rw-r--r-- | launcher/qml/ChangeItemPosition.js | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/launcher/qml/ChangeItemPosition.js b/launcher/qml/ChangeItemPosition.js new file mode 100644 index 0000000..9fae07c --- /dev/null +++ b/launcher/qml/ChangeItemPosition.js @@ -0,0 +1,89 @@ +function next() { + repeater.currentItem += 1; + if (repeater.currentItem > repeater.count - 1) + { + repeater.currentItem = 0; + } + var count = 0; + + for (var i = 0; i < repeater.count; i++) + { + var item = repeater.itemAt(i); + item.currentState -= 1; + if ( item.currentState < 1 ) + { + item.currentState = repeater.count; + } + if ( item.currentState >= 1 && item.currentState <= 10 ) + { + item.state = "pos" + item.currentState + } else if ( item.currentState === 15 ){ + item.state = "pos11"; + } else if ( item.currentState === 16 ){ + item.state = "pos12"; + } else if ( item.currentState === 17 ){ + item.state = "pos13"; + } else if ( item.currentState >= 18 ){ + item.state = "pos0"; + } else { + item.state = "pos10"; + } + } +} + +function prev() { + repeater.currentItem -= 1; + if (repeater.currentItem < 0) + { + repeater.currentItem = repeater.count - 1; + } + var count = repeater.count; + for (var i = 0; i < repeater.count; i++) + { + var item = repeater.itemAt(i); + item.currentState += 1; + if ( item.currentState > repeater.count ) + { + item.currentState = 1; + } + if ( item.currentState >= 1 && item.currentState <= 10 ) + { + item.state = "pos" + item.currentState + } else if ( item.currentState === 15 ){ + item.state = "pos11"; + } else if ( item.currentState === 16 ){ + item.state = "pos12"; + } else if ( item.currentState === 17 ){ + item.state = "pos13"; + } else if ( item.currentState >= 18 ){ + item.state = "pos0"; + } else { + item.state = "pos10"; + } + } +} + +function move(pos, item) { + var distance = firstPox - pos; + if(distance > 200) { + next() + firstPox = pos + iconMoved = true + item.iconReleased() + } else if (distance < -200) { + prev() + firstPox = pos + iconMoved = true + item.iconReleased() + } +} + +function getCenterItem() { + var item; + for (var i = 0; i < repeater.count; i++) + { + item = repeater.itemAt(i) + if (item.state === "pos5" || item.state === "pos14") + return item + } +} |