sliding clock: separated out v1 and v2 faces

master
adrian w kirk 2022-10-08 23:02:18 +01:00
parent 804f308af1
commit c3cccde249
3 changed files with 26 additions and 11 deletions

View File

@ -625,8 +625,7 @@ const Locale = require('locale');
* clock working in the emulator
*/
class DigitDateTimeFormatter {
constructor() {
}
constructor() {}
format00(num){
const value = (num | 0);

View File

@ -24,7 +24,7 @@ class EnglishDateFormatter extends DateFormatter {
}
defaultRowDefs(){
return [
const row_defs = [
{
type: 'large',
init_coords: [0.05,0.07],
@ -36,14 +36,20 @@ class EnglishDateFormatter extends DateFormatter {
init_coords: [0.05,0.31],
row_direction: [0.0,1.0],
rows: 2
},
{
type: 'small',
init_coords: [0.05,0.75],
row_direction: [0.0,1.0],
rows: 2
}
];
const bangleVersion = (g.getHeight()>200)? 1 : 2;
if(bangleVersion > 1){
row_defs.push(
{
type: 'small',
init_coords: [0.05,0.75],
row_direction: [0.0,1.0],
rows: 2
}
)
};
return row_defs;
}
}

View File

@ -2,12 +2,13 @@
const PREFERENCE_FILE = "slidingtext.settings.json";
const settings = Object.assign({},
require('Storage').readJSON(PREFERENCE_FILE, true) || {});
const bangleVersion = (g.getHeight()>200)? 1 : 2;
// the screen controls are defaulted on for a bangle 1 and off for a bangle 2
if(settings.enable_live_controls == null){
settings.enable_live_controls = (g.getHeight()> 200);
settings.enable_live_controls = bangleVersion < 2;
}
console.log("loaded:" + JSON.stringify(settings));
const locale_mappings = {
const locale_mappings = (bangleVersion > 1)? {
'en' : { date_formatter: 'en' },
'en p': {
date_formatter: 'en',
@ -109,7 +110,16 @@
'es': { date_formatter: 'es'},
'jp': { date_formatter: 'jp'},
'dgt': { date_formatter: 'dgt'},
} : {
'en' : { date_formatter: 'en' },
'en2' : { date_formatter: 'en2' },
'fr': { date_formatter:'fr'},
'de': { date_formatter: 'de'},
'es': { date_formatter: 'es'},
'jp': { date_formatter: 'jp'},
'dgt': { date_formatter: 'dgt'},
}
const locales = Object.keys(locale_mappings);
function writeSettings() {