Skip to content

Commit 06d4b7b

Browse files
committed
Update submodule
1 parent 4ed34cc commit 06d4b7b

13 files changed

+124
-67
lines changed

Source/SmartBikeLights

Submodule SmartBikeLights updated 30 files

Source/resources/properties.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
<property id="LC" type="string"></property>
66
<property id="LC2" type="string"></property>
77
<property id="LC3" type="string"></property>
8+
<property id="CN1" type="string">Primary</property>
9+
<property id="CN2" type="string">Secondary</property>
10+
<property id="CN3" type="string">Tertiary</property>
811

912
<!-- Activity color -->
1013
<property id="AC" type="number">43775</property>

Source/resources/settings.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,20 @@
3434
<setting propertyKey="@Properties.LC" title="@Strings.LC">
3535
<settingConfig type="alphaNumeric" maxLength="100000" />
3636
</setting>
37+
<setting propertyKey="@Properties.CN1" title="@Strings.CN1">
38+
<settingConfig type="alphaNumeric" maxLength="20" />
39+
</setting>
3740
<setting propertyKey="@Properties.LC2" title="@Strings.LC2">
3841
<settingConfig type="alphaNumeric" maxLength="100000" />
3942
</setting>
43+
<setting propertyKey="@Properties.CN2" title="@Strings.CN2">
44+
<settingConfig type="alphaNumeric" maxLength="20" />
45+
</setting>
4046
<setting propertyKey="@Properties.LC3" title="@Strings.LC3">
4147
<settingConfig type="alphaNumeric" maxLength="100000" />
4248
</setting>
49+
<setting propertyKey="@Properties.CN3" title="@Strings.CN3">
50+
<settingConfig type="alphaNumeric" maxLength="20" />
51+
</setting>
4352
</settings>
4453
</resources>

Source/resources/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<string id="LC2">Secondary Lights Configuration</string>
55
<string id="LC3">Tertiary Lights Configuration</string>
66

7+
<string id="CN1">Lights Configuration Name</string>
8+
<string id="CN2">Secondary LightsConfiguration Name</string>
9+
<string id="CN3">Tertiary Lights Configuration Name</string>
10+
711
<string id="CC">Current Configuration</string>
812
<string id="Primary">Primary</string>
913
<string id="Secondary">Secondary</string>

Source/source-generated/AppSettings.Settings.mc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module AppSettings {
88
const colorValues = [16711680, 11141120, 16733440, 16755200, 65280, 43520, 43775, 255, 11141375, 16711935];
99
const colorNames = [:Red, :DarkRed, :Orange, :Yellow, :Green, :DarkGreen, :Blue, :DarkBlue, :Purple, :Pink];
1010
const configurationNames = [:Primary, :Secondary, :Tertiary];
11+
const configurationNameValues = ["CN1", "CN2", "CN3"];
1112
const configurationValues = [1, 2, 3];
1213
const settingValues = ["IL", "AC", "CC"];
1314

@@ -38,7 +39,7 @@ module AppSettings {
3839
Menu2.addItem(new WatchUi.MenuItem(Rez.Strings.AC, (colorIndex < 0 ? null : Rez.Strings[colorNames[colorIndex]]), 1, null));
3940
// Current configuration
4041
var configurationIndex = configurationValues.indexOf((Properties.getValue("CC")));
41-
Menu2.addItem(new WatchUi.MenuItem(Rez.Strings.CC, (configurationIndex < 0 ? null : Rez.Strings[configurationNames[configurationIndex]]), 2, null));
42+
Menu2.addItem(new WatchUi.MenuItem(Rez.Strings.CC, (configurationIndex < 0 ? null : Properties.getValue(configurationNameValues[configurationIndex])), 2, null));
4243
}
4344

4445
public function onSelect(index, menuItem) {
@@ -50,8 +51,8 @@ module AppSettings {
5051
Application.getApp().onSettingsChanged();
5152
} else {
5253
openSubMenu(index == 1
53-
? new ListMenu("Color", key, menuItem, colorValues, colorNames)
54-
: new ListMenu("Configuration", key, menuItem, configurationValues, configurationNames));
54+
? new ListMenu("Color", key, menuItem, colorValues, colorNames, null)
55+
: new ListMenu("Configuration", key, menuItem, configurationValues, configurationNames, configurationNameValues));
5556
}
5657
}
5758
}
@@ -62,19 +63,21 @@ module AppSettings {
6263
private var _key;
6364
private var _values;
6465
private var _names;
66+
private var _nameKeys;
6567

66-
public function initialize(title, key, menuItem, values, names) {
68+
public function initialize(title, key, menuItem, values, names, nameKeys) {
6769
BaseMenu.initialize();
6870
Menu2.setTitle(title);
6971
_key = key;
7072
_menuItem = menuItem.weak();
7173
_values = values;
7274
_names = names;
73-
var currentValue = Properties.getValue(key);
75+
_nameKeys = nameKeys;
7476
for (var i = 0; i < values.size(); i++) {
7577
var value = values[i];
76-
var name = names[i];
77-
Menu.addItem(new WatchUi.MenuItem(Rez.Strings[name], null, value, null));
78+
var name = nameKeys != null ? Properties.getValue(nameKeys[i]) : null;
79+
name = name == null ? Rez.Strings[names[i]] : name;
80+
Menu.addItem(new WatchUi.MenuItem(name, null, value, null));
7881
}
7982
}
8083

@@ -91,7 +94,9 @@ module AppSettings {
9194
// Set parent sub label
9295
var index = _values.indexOf(newValue);
9396
if (_menuItem.stillAlive() && index >= 0) {
94-
_menuItem.get().setSubLabel(Rez.Strings[_names[index]]);
97+
var name = _nameKeys != null ? Properties.getValue(_nameKeys[index]) : null;
98+
name = name == null ? Rez.Strings[_names[index]] : name;
99+
_menuItem.get().setSubLabel(name);
95100
}
96101

97102
close();

Source/source-generated/BikeLightsControlView.HighResolution.mc

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class BikeLightsControlView extends BikeLightsView {
172172
}
173173

174174
if (_menuOpening) {
175-
_menuOpening = !openMenu();
175+
_menuOpening = self has :openMenu ? !openMenu() : false; // If self has :openMenu is added to the if statement an exception is thrown on runtime for FR245
176176
}
177177

178178
_updateUiCounter = (_updateUiCounter + 1) % 60;
@@ -212,8 +212,8 @@ class BikeLightsControlView extends BikeLightsView {
212212

213213
var isInitialized = _initializedLights > 0;
214214
BikeLightsView.onNetworkStateUpdate(networkState);
215-
if (self has :openMenu && !isInitialized && _initializedLights > 0) {
216-
_menuOpening = !openMenu();
215+
if (!isInitialized && _initializedLights > 0) {
216+
_menuOpening = self has :openMenu ? !openMenu() : false; // If self has :openMenu is added to the if statement an exception is thrown on runtime for FR245
217217
}
218218

219219
WatchUi.requestUpdate();
@@ -247,8 +247,11 @@ class BikeLightsControlView extends BikeLightsView {
247247
return;
248248
}
249249

250-
_timer.stop();
251-
_timer = null;
250+
if (_timer != null) {
251+
_timer.stop();
252+
_timer = null;
253+
}
254+
252255
release();
253256
}
254257

@@ -327,14 +330,6 @@ class BikeLightsControlView extends BikeLightsView {
327330
drawBattery(dc, fgColor, lightX, _batteryY, batteryStatus);
328331
}
329332

330-
(:touchScreen)
331-
protected function onLightPanelModeChange(lightData, lightType, lightMode, controlMode) {
332-
var newControlMode = lightMode < 0 ? 1 /* NETWORK */
333-
: controlMode != 2 ? 2 /* MANUAL */
334-
: null;
335-
setLightAndControlMode(lightData, lightType, lightMode, newControlMode);
336-
}
337-
338333
protected function getLightProperty(id, lightType, defaultValue) {
339334
return defaultValue;
340335
}

Source/source-generated/BikeLightsControlView.MediumResolution.mc

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class BikeLightsControlView extends BikeLightsView {
172172
}
173173

174174
if (_menuOpening) {
175-
_menuOpening = !openMenu();
175+
_menuOpening = self has :openMenu ? !openMenu() : false; // If self has :openMenu is added to the if statement an exception is thrown on runtime for FR245
176176
}
177177

178178
_updateUiCounter = (_updateUiCounter + 1) % 60;
@@ -212,8 +212,8 @@ class BikeLightsControlView extends BikeLightsView {
212212

213213
var isInitialized = _initializedLights > 0;
214214
BikeLightsView.onNetworkStateUpdate(networkState);
215-
if (self has :openMenu && !isInitialized && _initializedLights > 0) {
216-
_menuOpening = !openMenu();
215+
if (!isInitialized && _initializedLights > 0) {
216+
_menuOpening = self has :openMenu ? !openMenu() : false; // If self has :openMenu is added to the if statement an exception is thrown on runtime for FR245
217217
}
218218

219219
WatchUi.requestUpdate();
@@ -247,8 +247,11 @@ class BikeLightsControlView extends BikeLightsView {
247247
return;
248248
}
249249

250-
_timer.stop();
251-
_timer = null;
250+
if (_timer != null) {
251+
_timer.stop();
252+
_timer = null;
253+
}
254+
252255
release();
253256
}
254257

@@ -327,14 +330,6 @@ class BikeLightsControlView extends BikeLightsView {
327330
drawBattery(dc, fgColor, lightX, _batteryY, batteryStatus);
328331
}
329332

330-
(:touchScreen)
331-
protected function onLightPanelModeChange(lightData, lightType, lightMode, controlMode) {
332-
var newControlMode = lightMode < 0 ? 1 /* NETWORK */
333-
: controlMode != 2 ? 2 /* MANUAL */
334-
: null;
335-
setLightAndControlMode(lightData, lightType, lightMode, newControlMode);
336-
}
337-
338333
protected function getLightProperty(id, lightType, defaultValue) {
339334
return defaultValue;
340335
}

Source/source-generated/BikeLightsView.Rectangle.mc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class BikeLightsView extends WatchUi.View {
514514
: _lightNetwork.getBatteryStatus(light.identifier);
515515
if (status == null) { /* Disconnected */
516516
updateLightTextAndMode(lightData, -1);
517-
return 6;
517+
return 7; /* Disconnected */
518518
}
519519

520520
return status.batteryStatus;

Source/source-generated/BikeLightsView.Round.mc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class BikeLightsView extends WatchUi.View {
514514
: _lightNetwork.getBatteryStatus(light.identifier);
515515
if (status == null) { /* Disconnected */
516516
updateLightTextAndMode(lightData, -1);
517-
return 6;
517+
return 7; /* Disconnected */
518518
}
519519

520520
return status.batteryStatus;

Source/source-generated/BikeLightsView.RoundHighResolution.mc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class BikeLightsView extends WatchUi.View {
514514
: _lightNetwork.getBatteryStatus(light.identifier);
515515
if (status == null) { /* Disconnected */
516516
updateLightTextAndMode(lightData, -1);
517-
return 6;
517+
return 7; /* Disconnected */
518518
}
519519

520520
return status.batteryStatus;

0 commit comments

Comments
 (0)