diff --git a/apps/spotrem/app.js b/apps/spotrem/app.js index 00a33613f29..219e2a4eef1 100644 --- a/apps/spotrem/app.js +++ b/apps/spotrem/app.js @@ -103,6 +103,8 @@ let audioHandler = (e)=>{audioLevels = e; print(audioLevels);}; Bangle.on('audio', audioHandler); Bangle.musicControl("volumegetlevel"); +let tempMask = ()=>{E.stopEventPropagation&&E.stopEventPropagation(); setTimeout(()=>{Bangle.removeListener('drag',tempMask);}, 150);}; // FIXME: Temporary fix/hack before redoing input to not rely on setUI's "updown" mode. + // Navigation input on the main layout let setUI = function() { // Bangle.setUI code from rigrig's smessages app for volume control: https://git.tubul.net/rigrig/BangleApps/src/branch/personal/apps/smessages/app.js @@ -119,12 +121,14 @@ let setUI = function() { //if (ud) Bangle.musicControl(ud>0 ? "volumedown" : "volumeup"); if (ud) { + Bangle.prependListener('drag', tempMask); + let callback = (mode, fb)=>{ if (mode == "map") Bangle.musicControl({cmd:"volumesetlevel", extra:Math.round(100*fb/30)}); if (mode == "incr") Bangle.musicControl(fb>0 ? "volumedown" : "volumeup"); if (mode =="remove") {audioLevels.c = fb; print(audioLevels.c);} }; - require("SliderInput").interface(callback, {useMap:true, oversizeL:0.25, steps:audioLevels.u, currLevel:audioLevels.c}); + setTimeout(()=>{require("SliderInput").interface(callback, {useMap:true, steps:audioLevels.u, currLevel:audioLevels.c});},200); } } );