Support for optional fullscreen mode.

pull/1441/head
David Peer 2022-02-13 10:16:32 +01:00
parent eebec3b832
commit 1bb3885b2c
9 changed files with 43 additions and 20 deletions

View File

@ -14,4 +14,5 @@
0.14: Added altitude as an option to display.
0.15: Using wpedom to count steps.
0.16: Improved stability. Wind can now be shown.
0.17: Settings for mph/kph and other minor improvements.
0.17: Settings for mph/kph and other minor improvements.
0.18: Fullscreen mode can now be enabled or disabled in the settings.

View File

@ -11,7 +11,7 @@ with Gadgetbride and the weather app must be installed.
## Features
* LCARS Style watch face.
* Full screen mode - widgets are still loaded but not shown.
* Enable or disable fullscreen mode (widgets are always loaded, but hidden if fullscreen).
* Tab on left/right to switch between different screens.
* Cusomizable data that is shown on screen 1 (steps, weather etc.)
* Shows random and real images of planets.
@ -33,7 +33,7 @@ with Gadgetbride and the weather app must be installed.
## Multiple screens support
Access different screens via tap on the left/ right side of the screen
![](screenshot.png)
![](screenshot_1.png)
![](screenshot_2.png)

View File

@ -7,6 +7,7 @@ let settings = {
dataRow2: "Temp",
dataRow3: "Battery",
speed: "kph",
fullscreen: false,
};
let saved_settings = storage.readJSON(SETTINGS_FILE, 1) || settings;
for (const key in saved_settings) {
@ -30,6 +31,7 @@ let lcarsViewPos = 0;
// let hrmValue = 0;
var plotMonth = false;
/*
* Requirements and globals
*/
@ -217,7 +219,7 @@ function drawHorizontalBgLine(color, x1, x2, y, h){
function drawInfo(){
if(lcarsViewPos != 0){
if(lcarsViewPos != 0 || !settings.fullscreen){
return;
}
@ -304,15 +306,26 @@ function drawPosition0(){
var currentDate = new Date();
var timeStr = locale.time(currentDate,1);
g.setFontAntonioLarge();
g.drawString(timeStr, 27, 10);
if(settings.fullscreen){
g.drawString(timeStr, 27, 10);
} else {
g.drawString(timeStr, 27, 30);
}
// Write date
g.setColor(cWhite);
g.setFontAntonioMedium();
var dayStr = locale.dow(currentDate, true).toUpperCase();
dayStr += " " + currentDate.getDate();
dayStr += " " + locale.month(currentDate, 1).toUpperCase();
g.drawString(dayStr, 30, 56);
if(settings.fullscreen){
var dayStr = locale.dow(currentDate, true).toUpperCase();
dayStr += " " + currentDate.getDate();
dayStr += " " + locale.month(currentDate, 1).toUpperCase();
g.drawString(dayStr, 30, 56);
} else {
var dayStr = locale.dow(currentDate, true).toUpperCase();
var date = currentDate.getDate();
g.drawString(dayStr, 128, 33);
g.drawString(date, 128, 53);
}
// Draw data
g.setFontAlign(-1, -1, 0);
@ -451,6 +464,13 @@ function draw(){
} else if (lcarsViewPos == 1) {
drawPosition1();
}
// After drawing the watch face, we can draw the widgets
if(settings.fullscreen){
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
} else {
Bangle.drawWidgets();
}
}
@ -653,16 +673,7 @@ Bangle.on('touch', function(btn, e){
// Show launcher when middle button pressed
Bangle.setUI("clock");
Bangle.loadWidgets();
/*
* we are not drawing the widgets as we are taking over the whole screen
* so we will blank out the draw() functions of each widget and change the
* area to the top bar doesn't get cleared.
*/
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
// Clear the screen once, at startup and draw clock
g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear();
draw();
// After drawing the watch face, we can draw the widgets
// Bangle.drawWidgets();

View File

@ -9,6 +9,7 @@
dataRow2: "Steps",
dataRow3: "Temp",
speed: "kph",
fullscreen: false,
};
let saved_settings = storage.readJSON(SETTINGS_FILE, 1) || settings;
for (const key in saved_settings) {
@ -52,6 +53,14 @@
save();
},
},
'Full Screen': {
value: settings.fullscreen,
format: () => (settings.fullscreen ? 'Yes' : 'No'),
onchange: () => {
settings.fullscreen = !settings.fullscreen;
save();
},
},
'Speed': {
value: 0 | speedOptions.indexOf(settings.speed),
min: 0, max: 1,

View File

@ -3,13 +3,15 @@
"name": "LCARS Clock",
"shortName":"LCARS",
"icon": "lcars.png",
"version":"0.17",
"version":"0.18",
"readme": "README.md",
"supports": ["BANGLEJS2"],
"description": "Library Computer Access Retrieval System (LCARS) clock.",
"type": "clock",
"tags": "clock",
"screenshots": [{"url":"screenshot.png"}],
"screenshots": [
{"url":"screenshot_1.png"},
{"url":"screenshot_3.png"}],
"storage": [
{"name":"lcars.app.js","url":"lcars.app.js"},
{"name":"lcars.img","url":"lcars.icon.js","evaluate":true},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

BIN
apps/lcars/screenshot_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
apps/lcars/screenshot_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB