ptlaunch: Make tap to confirm new pattern more reliable. Also allow for easier creation of single circle patterns.
parent
6b2f8e98d3
commit
854d2f9ade
|
|
@ -4829,7 +4829,7 @@
|
||||||
"id": "ptlaunch",
|
"id": "ptlaunch",
|
||||||
"name": "Pattern Launcher",
|
"name": "Pattern Launcher",
|
||||||
"shortName": "Pattern Launcher",
|
"shortName": "Pattern Launcher",
|
||||||
"version": "0.02",
|
"version": "0.03",
|
||||||
"description": "Directly launch apps from the clock screen with custom patterns.",
|
"description": "Directly launch apps from the clock screen with custom patterns.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tools",
|
"tags": "tools",
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
0.01: Initial creation of the pattern launch app
|
0.01: Initial creation of the pattern launch app
|
||||||
0.02: Turn on lcd when launching an app if the lock screen was disabled in the settings
|
0.02: Turn on lcd when launching an app if the lock screen was disabled in the settings
|
||||||
|
0.03: Make tap to confirm new pattern more reliable. Also allow for easier creation of single circle patterns.
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ From the main menu you can:
|
||||||
- Add a new pattern and link it to an app (first entry)
|
- Add a new pattern and link it to an app (first entry)
|
||||||
- To create a new pattern first select "Add Pattern"
|
- To create a new pattern first select "Add Pattern"
|
||||||
- Now draw any pattern you like, this will later launch the linked app from the clock screen
|
- Now draw any pattern you like, this will later launch the linked app from the clock screen
|
||||||
|
- You can also draw a single-circle pattern (meaning a single tap on one circle) instead of drawing a 'complex' pattern
|
||||||
- If you don't like the pattern, simply re-draw it. The previous pattern will be discarded.
|
- If you don't like the pattern, simply re-draw it. The previous pattern will be discarded.
|
||||||
- If you are happy with the pattern tap on screen or press the button to continue
|
- If you are happy with the pattern tap on screen or press the button to continue
|
||||||
- Now select the app you want to launch with the pattern.
|
- Now select the app you want to launch with the pattern.
|
||||||
|
|
|
||||||
|
|
@ -147,13 +147,26 @@ var createPattern = () => {
|
||||||
setWatch(() => finishHandler(), BTN);
|
setWatch(() => finishHandler(), BTN);
|
||||||
setTimeout(() => Bangle.on("tap", finishHandler), 250);
|
setTimeout(() => Bangle.on("tap", finishHandler), 250);
|
||||||
|
|
||||||
|
positions = [];
|
||||||
var dragHandler = (position) => {
|
var dragHandler = (position) => {
|
||||||
|
log(position);
|
||||||
positions.push(position);
|
positions.push(position);
|
||||||
|
|
||||||
debounce().then(() => {
|
debounce().then(() => {
|
||||||
if (isFinished) {
|
if (isFinished) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This might actually be a 'tap' event.
|
||||||
|
// Use this check in addition to the actual tap handler to make it more reliable
|
||||||
|
if (pattern.length > 0 && positions.length === 2) {
|
||||||
|
if (positions[0].x === positions[1].x && positions[0].y === positions[1].y) {
|
||||||
|
finishHandler();
|
||||||
|
positions = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
E.showMessage("Calculating...");
|
E.showMessage("Calculating...");
|
||||||
var t0 = Date.now();
|
var t0 = Date.now();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue