Skip to content

Commit 9d2670c

Browse files
authored
Add files via upload
1 parent 7e801bf commit 9d2670c

File tree

10 files changed

+79
-17
lines changed

10 files changed

+79
-17
lines changed

resources-venu3s/bitmaps.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<resources>
2+
<bitmap id="LauncherIcon" filename="images/MoveToBeActive.png"
3+
dithering="none" />
4+
</resources>
6.16 KB
Loading

resources-venu3s/images/garmin5.png

4.11 KB
Loading

resources-venu3s/jsonData.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<resources>
2+
<!-- <ata id="mPosition">[189, 106, 168, 246, 154, 58, 317, 82, 298, 142, 322, 147, 62, 86, 232, 237, 187, 192, 213, 208, 241, 208, 237, 274]</jsonData> -->
3+
<!-- Venu 0 1 2 3 4 5 6 7 8 9 10 11 , 12, 13, 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 -->
4+
<jsonData id="mPosition">[177, 100, 157, 231, 141, 54, 297, 260, 280, 129, 298, 133, 66, 84, 216, 221, 174, 179, 187, 185, 222, 191, 259, 257]</jsonData> <!-- default for Venu 2s or 360x360 -->
5+
<!--
6+
0= DnD Icon X
7+
1= DnD, Bluetooth and Alarm Icons Y
8+
2= Bluetooth Icon X
9+
3= Alarm Icon X
10+
4= Garmin Logo X
11+
5= Garmin Logo Y
12+
6= Date Y with Logo / Location Y no Logo
13+
7= Temperature Y no Logo
14+
8= Right icon X
15+
9= Top icon Y
16+
10= Right text X
17+
11= Top text Y
18+
12= Left icon X
19+
13= Left text X
20+
14= Bottom icon Y
21+
15= Bottom text Y
22+
16= Middle icon Y
23+
17= Middle text Y
24+
18= Weather icon X
25+
19= Weather icon X2 // used by some bigger weather icons (eg. partly cloudy day)
26+
20= Weather icon Y + Temperature Y
27+
21= Temperature X
28+
22= Weather icon Y no Logo
29+
23= Location Y with Logo
30+
-->
31+
</resources>

resources-vivoactive5/bitmaps.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<resources>
2+
<bitmap id="LauncherIcon" filename="images/MoveToBeActive.png"
3+
dithering="none" />
4+
</resources>
6.16 KB
Loading
4.11 KB
Loading

settings/AnalogSettingsView.mc

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AnalogSettingsViewTest extends WatchUi.Menu2 {
1818
function initialize() {
1919
Menu2.initialize(null);
2020

21-
var currentVersion=430;
21+
var currentVersion=431;
2222
if (Storage.getValue(23)==null or Storage.getValue(23)<currentVersion){
2323
Storage.setValue(23,currentVersion);
2424

@@ -203,7 +203,7 @@ class DrawableMenuTitle extends WatchUi.Drawable {
203203

204204
// Draw the application icon and main menu title
205205
function draw(dc) {
206-
var mIndex;
206+
var mIndex, width=dc.getWidth();
207207

208208
if (Storage.getValue(2) == false or Storage.getValue(2) == null){
209209
mIndex = 0;
@@ -213,15 +213,24 @@ class DrawableMenuTitle extends WatchUi.Drawable {
213213

214214
var appIcon = Application.loadResource(Rez.Drawables.LauncherIcon);
215215
var bitmapWidth = appIcon.getWidth();
216-
var labelWidth = dc.getTextWidthInPixels("Config", Graphics.FONT_SMALL); // Aqui pra corrigir background?
216+
var labelWidth = dc.getTextWidthInPixels("Config", Graphics.FONT_SMALL);
217217

218-
var bitmapX = (dc.getWidth() - (bitmapWidth + 2 + labelWidth)) / 3; // 2 = spacing
218+
if(labelWidth==117 and dc has :drawScaledBitmap){ // Venu 3s
219+
bitmapWidth=55;
220+
}
221+
222+
if (width>=390) { // Venu 3 watch allows full width to menu header, as opposed to all other watches which is half width. This condition corrects it.
223+
width = width*1.25;
224+
}
225+
var bitmapX = (width - (bitmapWidth + 2 + labelWidth)) / 3; // 2 = spacing between logo and text
219226
var bitmapY = (dc.getHeight() - appIcon.getHeight()) / 2;
220-
var labelX = bitmapX + bitmapWidth + 2; // 2 = spacing
227+
var labelX = bitmapX + bitmapWidth + 2; // 2 = spacing between logo and text
221228
var labelY = dc.getHeight() / 2;
222229

223230
//var color = mColors[mIndex];
224231
//dc.setColor(color, color);
232+
//System.println(width);
233+
//System.println(labelWidth);
225234

226235
var mColors = Application.loadResource(Rez.JsonData.mColors);
227236

@@ -230,9 +239,16 @@ class DrawableMenuTitle extends WatchUi.Drawable {
230239

231240
//dc.clearClip(); //clear instead?
232241
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_BLACK); // removing the background color and all the data points from the background, leaving just the hour hands and hashmarks
233-
dc.fillRectangle(0, 0, dc.getWidth(), dc.getHeight()); //width & height?
242+
dc.fillRectangle(0, 0, width, dc.getHeight()); //width & height?
234243

235-
dc.drawBitmap(bitmapX, bitmapY, appIcon);
244+
if(labelWidth==117 and dc has :drawScaledBitmap){ // Venu 3s
245+
dc.drawScaledBitmap(bitmapX, bitmapY, 55, 55, appIcon); // making icon smaller on this watch, since dc width on top of the screen is quite small constrasting to the big default icon size (70x70)
246+
} else if (labelWidth==117){ // Vivoactive 5, which doesn't have ScaledBitmap and icon is too big. Removing it and showing only text.
247+
labelX = (width - (labelWidth)) / 2;
248+
} else {
249+
dc.drawBitmap(bitmapX, bitmapY, appIcon);
250+
}
251+
236252
dc.setColor(mColors[mIndex], Graphics.COLOR_TRANSPARENT);
237253
dc.drawText(labelX, labelY, Graphics.FONT_SMALL, "Config", Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER);
238254
}
@@ -311,6 +327,7 @@ class CustomDataPoint extends WatchUi.Drawable {
311327
}
312328

313329

330+
314331
// Advance to the next color state for the drawable, or return the icon string for the menu to use as its label if id=-1
315332
function nextState(id, size) {
316333
var checkWeather = Storage.getValue(21)[2];

source/AnalogView.mc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class AnalogView extends WatchUi.WatchFace
4343
}
4444
}
4545

46-
var currentVersion=430;
46+
var currentVersion=431;
4747

4848
if (Storage.getValue(23)==null or Storage.getValue(23)<currentVersion){
49-
//Storage.setValue(23,currentVersion);
49+
Storage.setValue(23,currentVersion);
5050
var checks = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
5151
if (System.getSystemStats() has :batteryInDays){
5252
checks[0]=true;
@@ -114,6 +114,7 @@ class AnalogView extends WatchUi.WatchFace
114114
}*/
115115

116116
// If this device supports BufferedBitmap, allocate the buffers we use for drawing
117+
//if(Graphics has :BufferedBitmap or :BufferedBitmapReference) {
117118
if(Toybox.Graphics has :BufferedBitmap or Toybox.Graphics has :BufferedBitmapReference) {
118119
// Allocate a full screen size buffer with a palette of only 4 colors to draw
119120
// the background image of the watchface. This is used to facilitate blanking
@@ -172,7 +173,7 @@ class AnalogView extends WatchUi.WatchFace
172173

173174
var labels=Storage.getValue(5);
174175

175-
if(inLowPower and canBurnIn) {
176+
if(inLowPower and canBurnIn) { // aod on
176177
if (dc has :setAntiAlias) {
177178
dc.setAntiAlias(false);
178179
}

source/MtbA_functions.mc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,16 @@ class MtbA_functions {
773773
battery = Math.ceil(System.getSystemStats().battery);
774774
}
775775

776+
//System.println(dc.getTextDimensions("100",0)[1]);
777+
//System.println(width);
778+
776779
var offset = 0, offsetLED = 0;
777780
if (width==390) { // Venu & D2 Air
778-
offset = -2;
781+
if (dc.getTextDimensions("100",0)[1]==33){ // Venu, D2 Air & Approach S70 42mm
782+
offset = -2;
783+
} else { // epix Pro Gen 2 42mm & MARQ Gen 2
784+
offset = -1;
785+
}
779786
} else if (width==280) { // Enduro & Fenix 6X Pro
780787
offset = 0.75;
781788
} else if (width==218 or width==240) { // Vivoactive 4S & Fenix 6S & Vivoactive 3 Music
@@ -793,7 +800,9 @@ class MtbA_functions {
793800
} else if (width==360) { // Venu 2 & 2s
794801
offset = -1;
795802
} else if (width>=416) {
796-
offset = -1;
803+
if (width==454 and dc.getTextDimensions("100",0)[1]==35){ // Venu 3
804+
offset = 1;
805+
}
797806
offsetLED = -1;
798807
}
799808

@@ -1170,7 +1179,7 @@ class MtbA_functions {
11701179
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
11711180
var calories=0;
11721181

1173-
if (type==2){ // Active Calories formula by markdotai and topcaser (https://forums.garmin.com/developer/connect-iq/f/discussion/208338/active-calories/979052), with small adjustments
1182+
if (type==2){ // Active Calories formula by markdotai and topcaser (https://forums.garmin.com/developer/connect-iq/f/discussion/208338/active-calories/979052), with small adjustments by MtbA
11741183

11751184
var today = Gregorian.info(Time.now(), Time.FORMAT_MEDIUM);
11761185
var profile = UserProfile.getProfile();
@@ -2018,19 +2027,15 @@ function drawSunriseSunset(dc, xIcon, yIcon, xText, yText, width) {
20182027

20192028
var icon, time;
20202029
if (myTime.hour > sunrise.hour and myTime.hour < sunset.hour){
2021-
//System.println("sunset ?");
20222030
icon = "?";
20232031
time = sunset;
20242032
} else if (myTime.hour == sunrise.hour and myTime.min > sunrise.min){
2025-
//System.println("sunset ?");
20262033
icon = "?";
20272034
time = sunset;
20282035
} else if (myTime.hour == sunset.hour and myTime.min > sunset.min){
2029-
//System.println("sunrise >");
20302036
icon = ">";
20312037
time = sunrise;
20322038
} else {
2033-
//System.println("sunrise >");
20342039
icon = ">";
20352040
time = sunrise;
20362041
}

0 commit comments

Comments
 (0)