tweak animations
parent
246360efc1
commit
73562b08f0
|
|
@ -223,9 +223,8 @@ const showText = function(showAll) {
|
|||
const removeMessage = function() {
|
||||
const removeAndReset = () => {
|
||||
const id = msgBoxes[messageNum].msg.id;
|
||||
const idx = Bangle.findIndex(m => m.id === id);
|
||||
const idx = Bangle.MESSAGES.findIndex(m => m.id === id);
|
||||
Bangle.MESSAGES.splice(idx, 1); // remove from Bangle.MESSAGES
|
||||
//Bangle.MESSAGES = Bangle.MESSAGES.filter(m => m.id !== id); // remove from Bangle.MESSAGES
|
||||
msgBoxes.splice(messageNum, 1); // remove from msgBoxes
|
||||
if (!msgBoxes.length) {
|
||||
Bangle.setUI();
|
||||
|
|
@ -268,9 +267,10 @@ const showText = function(showAll) {
|
|||
}
|
||||
firstTouch = true;
|
||||
return new Promise((resolve, _reject) => {
|
||||
let multiplier = 1;
|
||||
let animate = () => {
|
||||
msgBoxes[messageNum].yOffset -= step;
|
||||
msgBoxes[messageNum + 1].yOffset -= step;
|
||||
msgBoxes[messageNum].yOffset -= step * multiplier;
|
||||
msgBoxes[messageNum + 1].yOffset -= step * multiplier;
|
||||
if (msgBoxes[messageNum + 1].yOffset <= 0) {
|
||||
if (!removeCurrent) {
|
||||
if (messageNum < msgBoxes.length) {
|
||||
|
|
@ -285,6 +285,7 @@ const showText = function(showAll) {
|
|||
msgBoxes[messageNum].draw();
|
||||
msgBoxes[messageNum + 1].draw();
|
||||
drawFooter();
|
||||
multiplier *= 2;
|
||||
timeouts.animID = setTimeout(animate, delay);
|
||||
}
|
||||
};
|
||||
|
|
@ -300,9 +301,10 @@ const showText = function(showAll) {
|
|||
}
|
||||
firstTouch = true;
|
||||
return new Promise((resolve, _reject) => {
|
||||
let multiplier = 1;
|
||||
let animate = () => {
|
||||
msgBoxes[messageNum].yOffset += step;
|
||||
msgBoxes[messageNum - 1].yOffset += step;
|
||||
msgBoxes[messageNum].yOffset += step * multiplier;
|
||||
msgBoxes[messageNum - 1].yOffset += step * multiplier;
|
||||
if (msgBoxes[messageNum - 1].yOffset >= 0) {
|
||||
if (!removeCurrent) {
|
||||
if (messageNum > 0) {
|
||||
|
|
@ -317,6 +319,7 @@ const showText = function(showAll) {
|
|||
msgBoxes[messageNum].draw();
|
||||
msgBoxes[messageNum - 1].draw();
|
||||
drawFooter();
|
||||
multiplier *= 2;
|
||||
timeouts.animID = setTimeout(animate, delay);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue