From a6638cc2ffc54224ec30fa679cd50c9afb4effda Mon Sep 17 00:00:00 2001 From: Felipe <60966475+fevieira27@users.noreply.github.com> Date: Sun, 1 May 2022 19:53:14 +0100 Subject: [PATCH] Add files via upload --- resources-legacyherofirstavenger/bitmaps.xml | 4 + .../images/MoveToBeActive.png | Bin 0 -> 4594 bytes resources-legacysagadarthvader/bitmaps.xml | 4 + .../images/MoveToBeActive.png | Bin 0 -> 4594 bytes source/AnalogSettingsView.mc | 73 +++++++++--------- source/AnalogView.mc | 20 +++-- source/MtbA_functions.mc | 31 +++++--- 7 files changed, 74 insertions(+), 58 deletions(-) create mode 100644 resources-legacyherofirstavenger/bitmaps.xml create mode 100644 resources-legacyherofirstavenger/images/MoveToBeActive.png create mode 100644 resources-legacysagadarthvader/bitmaps.xml create mode 100644 resources-legacysagadarthvader/images/MoveToBeActive.png diff --git a/resources-legacyherofirstavenger/bitmaps.xml b/resources-legacyherofirstavenger/bitmaps.xml new file mode 100644 index 0000000..2bd9bbb --- /dev/null +++ b/resources-legacyherofirstavenger/bitmaps.xml @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/resources-legacyherofirstavenger/images/MoveToBeActive.png b/resources-legacyherofirstavenger/images/MoveToBeActive.png new file mode 100644 index 0000000000000000000000000000000000000000..9d834fe4da098b8007932423312b98aa64d07fcd GIT binary patch literal 4594 zcmcgw30M=?7LK?fn=C4zSjQl;nPsvk5)lj*Dw_~A2nv&#$pT3xOacTDTEzu@C|W5M zYoQcTwBmwK1Zv#@aYGcbRYZB}!@?7n)+dOyZ^GvCwEFce^L@$8-1FbF-T$0>lQp5i zA6uGDG$WBnmI3~vFyiiP{Fsg+zCZfuKqPS+qxFx}kw{cRKy@BwDDh4rk<5COVu@Z7 z6exf(H5EcIDM~e{wFH_(^71xlAvhk@15#A3)CkEBzCTI^l!%bLkR3!1(#}B@O8-REwA0d0s0=x_YLV+69Lx4f8(&z*RA-PYlfOs|z)5t&{L?16C`xp%ZlAusv z4u+!uhf1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cRV~w*U6?AEx{_M! zH&Z*I(kZC zmz$iqaACXh^7h7gm{R;AXRb!0DYu+mHawq66jt)aVf)TbS6^}?FD|aEkA#anL^E4MO=|!}>zebDgK^_~ zdV1z}9be*jIQ&SH;?lN&@+o*~bbb58AKjr-BV@yD%TI%?SuiK{H+ye)iZ6Y2#=6%x)+UPAZRilDPTg z{cobqpFX^2c4}%h7-blZF#bEo-ERdotX3d!bAMmJ?RrmZZ@~xHGMeNPa<*fZ;4&{0D576 z!p0UwQ5 + + \ No newline at end of file diff --git a/resources-legacysagadarthvader/images/MoveToBeActive.png b/resources-legacysagadarthvader/images/MoveToBeActive.png new file mode 100644 index 0000000000000000000000000000000000000000..9d834fe4da098b8007932423312b98aa64d07fcd GIT binary patch literal 4594 zcmcgw30M=?7LK?fn=C4zSjQl;nPsvk5)lj*Dw_~A2nv&#$pT3xOacTDTEzu@C|W5M zYoQcTwBmwK1Zv#@aYGcbRYZB}!@?7n)+dOyZ^GvCwEFce^L@$8-1FbF-T$0>lQp5i zA6uGDG$WBnmI3~vFyiiP{Fsg+zCZfuKqPS+qxFx}kw{cRKy@BwDDh4rk<5COVu@Z7 z6exf(H5EcIDM~e{wFH_(^71xlAvhk@15#A3)CkEBzCTI^l!%bLkR3!1(#}B@O8-REwA0d0s0=x_YLV+69Lx4f8(&z*RA-PYlfOs|z)5t&{L?16C`xp%ZlAusv z4u+!uhf1fwbUFv%@~I$)#bq;R01P?o7KZAuL>xx_k_d~=gO2I+Vd%@$e86-9 zJ~UaY!1S0-fxROML*my`p;yY@VbCaf4T>6+?|>R5Lr|??4vs>43>RaVYLGjjgT4U_ z29*i8EmUd{ELrDn418b$DuVQ=kZdFph0dnXnPLW0zybvfx+fhJ(CPiqAcC3*q=()B zbHxmTbv%M~uYoZ{DNA`T6oCaY3|B+M!YS2|9HnVB@;+-pL4p8{P7i5dG(aRI6RuK~ zN<_eC!z?xmgA^tkky21P3#CZ;Fr9+%cv6Ug%1{)B2j`10IMGNd&ExQxOqk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ats() has :batteryInDays){ - if (Storage.getValue(19) != null ){ - boolean = Storage.getValue(19); + if (System.getSystemStats() has :batteryInDays){ + if (Storage.getValue(19) != null ){ + boolean = Storage.getValue(19); + } else { + boolean = false; + } + unitsMenu.addItem(new WatchUi.ToggleMenuItem("Battery Estimate", {:enabled=>"ON", :disabled=>"OFF"}, 19, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); + } + if (checkWeather){ + if (Storage.getValue(6) != null ){ + boolean = Storage.getValue(6); + } else { + boolean = true; + } + unitsMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Type", {:enabled=>"Real Temperature", :disabled=>"Feels Like"}, 6, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); + if (Storage.getValue(16) != null ){ + boolean = Storage.getValue(16); + } else { + boolean = false; + } + unitsMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Unit", {:enabled=>"Always Celsius", :disabled=>"User Settings"}, 16, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); + if (Storage.getValue(15) != null ){ + boolean = Storage.getValue(15); + } else { + boolean = true; + } + unitsMenu.addItem(new WatchUi.ToggleMenuItem("Wind Speed Unit", {:enabled=>"km/h or mph", :disabled=>"m/s"}, 15, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); + if (Storage.getValue(21)[19]){ + if (Storage.getValue(20) != null ){ + boolean = Storage.getValue(20); } else { boolean = false; - } - unitsMenu.addItem(new WatchUi.ToggleMenuItem("Battery Estimate", {:enabled=>"ON", :disabled=>"OFF"}, 19, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); - } - if (checkWeather){ - if (Storage.getValue(6) != null ){ - boolean = Storage.getValue(6); - } else { - boolean = true; } - unitsMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Type", {:enabled=>"Real Temperature", :disabled=>"Feels Like"}, 6, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); - if (Storage.getValue(16) != null ){ - boolean = Storage.getValue(16); - } else { - boolean = false; - } - unitsMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Unit", {:enabled=>"Always Celsius", :disabled=>"User Settings"}, 16, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); - if (Storage.getValue(15) != null ){ - boolean = Storage.getValue(15); - } else { - boolean = true; - } - unitsMenu.addItem(new WatchUi.ToggleMenuItem("Wind Speed Unit", {:enabled=>"km/h or mph", :disabled=>"m/s"}, 15, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); - if (Storage.getValue(21)[19]){ - if (Storage.getValue(20) != null ){ - boolean = Storage.getValue(20); - } else { - boolean = true; - } - unitsMenu.addItem(new WatchUi.ToggleMenuItem("Atm. Pres. Type", {:enabled=>"Mean Sea-Level", :disabled=>"Standard"}, 20, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); - } + unitsMenu.addItem(new WatchUi.ToggleMenuItem("Atm. Pres. Type", {:enabled=>"Mean Sea Level", :disabled=>"Local Pressure"}, 20, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); } + } + if (Storage.getValue(24) != null ){ + boolean = Storage.getValue(24); } else { - unitsMenu.addItem(new WatchUi.ToggleMenuItem("None available", {:enabled=>"None", :disabled=>"None"}, null, null, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); + boolean = false; } + var info = Time.Gregorian.info(Time.now(), Time.FORMAT_LONG); + unitsMenu.addItem(new WatchUi.ToggleMenuItem("Date Format", {:enabled=>Lang.format("$2$ $1$", [info.month, info.day]), :disabled=>Lang.format("$1$ $2$", [info.month, info.day])}, 24, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT})); + WatchUi.pushView(unitsMenu, new AnalogSettingsViewTest(), WatchUi.SLIDE_BLINK ); } else { WatchUi.requestUpdate(); diff --git a/source/AnalogView.mc b/source/AnalogView.mc index e6ca874..2a4ad41 100644 --- a/source/AnalogView.mc +++ b/source/AnalogView.mc @@ -29,11 +29,13 @@ class AnalogView extends WatchUi.WatchFace function initialize() { WatchFace.initialize(); + var currentVersion=401; - //var checks as Array = Storage.getValue(21); - //if (checks==null or checks.size()<20) { - if (Storage.getValue(21)==null or Storage.getValue(21).size()<20) { - var checks as Array = Storage.getValue(21); + if (Storage.getValue(23)==null or Storage.getValue(23) = Storage.getValue(21); + var checks as Array; checks = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; if (System.getDeviceSettings() has :requiresBurnInProtection){ checks[0]=System.getDeviceSettings().requiresBurnInProtection; @@ -56,7 +58,7 @@ class AnalogView extends WatchUi.WatchFace if (Activity.getActivityInfo() has :currentOxygenSaturation){ checks[11]=true; } if (Activity.getActivityInfo() has :altitude) { checks[16]=true; } if (Activity.getActivityInfo() has :meanSeaLevelPressure) { checks[18]=true; } - if (Activity.getActivityInfo() has :ambientPressure) { checks[19]=true; } + if (Activity.getActivityInfo() has :rawAmbientPressure) { checks[19]=true; } } if (ActivityMonitor has :getHeartRateHistory) { checks[10]=true; } if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getBodyBatteryHistory)) { checks[15]=true; } @@ -100,7 +102,7 @@ class AnalogView extends WatchUi.WatchFace var accentColor = Storage.getValue(1); // If this device supports BufferedBitmap, allocate the buffers we use for drawing - if(Toybox.Graphics has :BufferedBitmap or :BufferedBitmapReference) { + if(Graphics has :BufferedBitmap or :BufferedBitmapReference) { // Allocate a full screen size buffer with a palette of only 4 colors to draw // the background image of the watchface. This is used to facilitate blanking // the second hand during partial updates of the display @@ -131,7 +133,7 @@ class AnalogView extends WatchUi.WatchFace // Handle the update event - function onUpdate(dc) { + function onUpdate(dc as Dc) as Void { var targetDc = null; var width; var height; @@ -242,10 +244,6 @@ class AnalogView extends WatchUi.WatchFace MtbA.drawBatteryIcon(dc, width*0.69, height / 2.11, width*0.82, height / 2.06+(width==218 ? 1 : 0), width, height, accentColor); MtbA.drawBatteryText(dc, width*0.76, height / 2.14 - 1, width); -System.println(width); -System.println(dc.getFontHeight(Graphics.FONT_TINY)); //29-19 F6 / 27-19 VA4 / -System.println(dc.getFontHeight(Graphics.FONT_XTINY)); - //Data Points var FontAdj= 0; if (Storage.getValue(14)==true){ diff --git a/source/MtbA_functions.mc b/source/MtbA_functions.mc index 203c714..c42e266 100644 --- a/source/MtbA_functions.mc +++ b/source/MtbA_functions.mc @@ -223,7 +223,13 @@ class MtbA_functions { // Draw the date string into the provided buffer at the specified location function drawDateString( dc, x, y ) { var info = Time.Gregorian.info(Time.now(), Time.FORMAT_LONG); - var dateStr = Lang.format("$1$, $2$ $3$", [info.day_of_week, info.month, info.day]); + var dateStr; + + if (Storage.getValue(24)==true){ + dateStr = Lang.format("$1$, $3$ $2$", [info.day_of_week, info.month, info.day]); + } else { + dateStr = Lang.format("$1$, $2$ $3$", [info.day_of_week, info.month, info.day]); + } if (x*2 == 260){ y = y + 3; @@ -489,8 +495,9 @@ class MtbA_functions { else { formattedNotificationAmount = notificationAmount.format("%d"); } - dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT); + // Text + dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT); dc.drawText( xText, yText, fontSize, formattedNotificationAmount, Graphics.TEXT_JUSTIFY_LEFT); if(width==280 or width==240){ //Fenix 6X & Enduro @@ -718,13 +725,13 @@ class MtbA_functions { var estimateFlag = Storage.getValue(19); var battery; - if (estimateFlag == true and System.getSystemStats().batteryInDays!=null){ - battery = Math.ceil(System.getSystemStats().batteryInDays); - } else { - battery = Math.ceil(System.getSystemStats().battery); + battery = Math.ceil(System.getSystemStats().battery); + if (estimateFlag == true){ + if (System.getSystemStats().batteryInDays!=null and System.getSystemStats().batteryInDays!=0){ //trying to make sure that we don't get an error if batteryInDays not supported by watch + battery = System.getSystemStats().batteryInDays; + } } - var offset = 0, offsetLED = 0; if (width==390) { // Venu & D2 Air offset = -2; @@ -943,7 +950,7 @@ class MtbA_functions { unit = "?"; } - if (stepDistance >= 10) { + if (stepDistance >= 100) { distStr = stepDistance.format("%.0f"); } else { //(stepDistance <10) distStr = stepDistance.format("%.1f"); @@ -1231,9 +1238,9 @@ class MtbA_functions { } else { if (check[19]) { //elevation = Activity.getActivityInfo().altitude; - if(Activity.getActivityInfo().ambientPressure!=null){ - //System.println(Activity.getActivityInfo().ambientPressure); - //System.println(Activity.getActivityInfo().meanSeaLevelPressure ); + if(Activity.getActivityInfo().rawAmbientPressure!=null){ + pressure = Activity.getActivityInfo().rawAmbientPressure; + } else if (Activity.getActivityInfo().ambientPressure!=null){ pressure = Activity.getActivityInfo().ambientPressure; } } @@ -1266,7 +1273,7 @@ class MtbA_functions { } dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT); - dc.drawText(xText, yText, fontSize, pressure /*+ unit*/, Graphics.TEXT_JUSTIFY_LEFT); // pressure in hPa + dc.drawText(xText, yText, fontSize, pressure, Graphics.TEXT_JUSTIFY_LEFT); // pressure in hPa }