From 069bb5617db22815242e70af9d3ff79df032ae90 Mon Sep 17 00:00:00 2001 From: Daniel Dakhno Date: Sat, 12 Feb 2022 00:08:35 +0100 Subject: [PATCH] Fossil HR: test branch for watchface with deeper menu --- .gitmodules | 2 +- .../main/assets/fossil_hr/battery_layout.json | 1 + .../assets/fossil_hr/complication_layout.json | 1 + .../main/assets/fossil_hr/image_layout.json | 1 + .../main/assets/fossil_hr/menu_layout.json | 207 ++++++++++++++++++ .../assets/fossil_hr/openSourceWatchface.bin | Bin 3438 -> 7620 bytes .../devices/qhybrid/FossilAppWriter.java | 6 +- .../qhybrid/HybridHRWatchfaceFactory.java | 23 +- 8 files changed, 222 insertions(+), 19 deletions(-) create mode 100644 app/src/main/assets/fossil_hr/battery_layout.json create mode 100644 app/src/main/assets/fossil_hr/complication_layout.json create mode 100644 app/src/main/assets/fossil_hr/image_layout.json create mode 100644 app/src/main/assets/fossil_hr/menu_layout.json diff --git a/.gitmodules b/.gitmodules index 4c058130a..19b292ea4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "fossil-hr-watchface"] path = external/fossil-hr-watchface - url = https://github.com/arjan-s/fossil-hr-watchface + url = https://codeberg.org/Freeyourgadget/fossil-hr-watchface [submodule "jerryscript"] path = external/jerryscript url = https://github.com/jerryscript-project/jerryscript diff --git a/app/src/main/assets/fossil_hr/battery_layout.json b/app/src/main/assets/fossil_hr/battery_layout.json new file mode 100644 index 000000000..4d35d4c85 --- /dev/null +++ b/app/src/main/assets/fossil_hr/battery_layout.json @@ -0,0 +1 @@ +[{"id":0,"type":"complication_background","background":"#background","goal_ring":{"is_enable":"#goal_ring","end_angle":"#fi","is_invert":"#$e"},"dimension":{"type":"rigid","width":"#size.w","height":"#size.h"},"placement":{"type":"absolute","left":"#pos.Ue","top":"#pos.Qe"},"visible":true,"inversion":false},{"id":1,"parent_id":0,"type":"complication_content","icon":"icBattery","text_low":"#ci","dimension":{"type":"rigid","width":76,"height":76},"placement":{"type":"relative"},"visible":true,"inversion":"#$e"},{"id":2,"parent_id":1,"type":"solid","placement":{"type":"absolute","left":29,"top":23},"color":"#nt","dimension":{"type":"rigid","height":6,"width":"#it"},"visible":true,"inversion":false},{"id":3,"parent_id":1,"type":"image","image_name":"icBattCharging","draw_mode":1,"placement":{"type":"absolute","left":34,"top":21},"dimension":{"width":6,"height":9},"visible":"#et","inversion":false}] diff --git a/app/src/main/assets/fossil_hr/complication_layout.json b/app/src/main/assets/fossil_hr/complication_layout.json new file mode 100644 index 000000000..42be572d2 --- /dev/null +++ b/app/src/main/assets/fossil_hr/complication_layout.json @@ -0,0 +1 @@ +[{"id":0,"type":"complication_background","background":"#background","goal_ring":{"is_enable":"#goal_ring","end_angle":"#fi","is_invert":"#$e"},"dimension":{"type":"rigid","width":"#size.w","height":"#size.h"},"placement":{"type":"absolute","left":"#pos.Ue","top":"#pos.Qe"},"visible":true,"inversion":false},{"id":1,"parent_id":0,"type":"complication_content","icon":"#icon","text_high":"#dt","text_low":"#ci","dimension":{"type":"rigid","width":76,"height":76},"placement":{"type":"relative"},"visible":true,"inversion":"#$e"}] \ No newline at end of file diff --git a/app/src/main/assets/fossil_hr/image_layout.json b/app/src/main/assets/fossil_hr/image_layout.json new file mode 100644 index 000000000..1ed732279 --- /dev/null +++ b/app/src/main/assets/fossil_hr/image_layout.json @@ -0,0 +1 @@ +[{"id":0,"type":"container","direction":1,"main_alignment":1,"cross_alignment":1,"dimension":{"type":"rigid","width":240,"height":240},"placement":{"type":"absolute","left":0,"top":0},"visible":true,"inversion":false},{"id":1,"parent_id":0,"type":"image","image_name":"#name","draw_mode":1,"placement":{"type":"absolute","left":"#pos.Ue","top":"#pos.Qe"},"dimension":{"width":"#size.w","height":"#size.h"},"visible":true,"inversion":false}] \ No newline at end of file diff --git a/app/src/main/assets/fossil_hr/menu_layout.json b/app/src/main/assets/fossil_hr/menu_layout.json new file mode 100644 index 000000000..6be3d627d --- /dev/null +++ b/app/src/main/assets/fossil_hr/menu_layout.json @@ -0,0 +1,207 @@ +[ + { + "id": 0, + "type": "container", + "direction": 1, + "main_alignment": 0, + "cross_alignment": 1, + "dimension": { + "type": "rigid", + "width": 240, + "height": 240 + }, + "placement": { + "type": "absolute", + "left": 0, + "top": 0 + }, + "visible": true, + "inversion": false + }, + { + "id": 1, + "parent_id": 0, + "type": "container", + "direction": 1, + "main_alignment": 1, + "cross_alignment": 2, + "dimension": { + "type": "rigid", + "width": 130, + "height": 34 + }, + "placement": { + "type": "absolute", + "left": 75, + "top": 45 + }, + "visible": true, + "inversion": false + }, + { + "id": 2, + "parent_id": 1, + "type": "text", + "text": "#top_short_press_label", + "ppem": 17, + "color": 3, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 3, + "parent_id": 1, + "type": "text", + "text": "#top_long_press_label", + "ppem": 17, + "color": 3, + "ascent": 17, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 4, + "parent_id": 0, + "type": "container", + "direction": 1, + "main_alignment": 1, + "cross_alignment": 2, + "dimension": { + "type": "rigid", + "width": 80, + "height": 34 + }, + "placement": { + "type": "absolute", + "left": 135, + "top": 103 + }, + "visible": true, + "inversion": false + }, + { + "id": 5, + "parent_id": 4, + "type": "text", + "text": "#middle_short_press_label", + "ppem": 17, + "color": 3, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 6, + "parent_id": 4, + "type": "text", + "text": "#middle_long_press_label", + "ppem": 17, + "color": 3, + "ascent": 17, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 7, + "parent_id": 0, + "type": "container", + "direction": 1, + "main_alignment": 1, + "cross_alignment": 2, + "dimension": { + "type": "rigid", + "width": 130, + "height": 34 + }, + "placement": { + "type": "absolute", + "left": 75, + "top": 161 + }, + "visible": true, + "inversion": false + }, + { + "id": 8, + "parent_id": 7, + "type": "text", + "text": "#bottom_short_press_label", + "ppem": 17, + "color": 3, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 9, + "parent_id": 7, + "type": "text", + "text": "#bottom_long_press_label", + "ppem": 17, + "color": 3, + "ascent": 17, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 10, + "parent_id": 0, + "type": "text", + "text": "#menu_title", + "ppem": 25, + "color": 3, + "ascent": 35, + "placement": { + "type": "relative" + }, + "visible": true, + "inversion": false + }, + { + "id": 11, + "parent_id": 0, + "type": "text_page", + "text": "#message_to_display", + "ppem": 17, + "color": 3, + "ascent": 17, + "cross_alignment": 2, + "line_width": [ + 80, + 85, + 90, + 90, + 85, + 80 + ], + "dimension": { + "type": "rigid", + "width": 80, + "height": 100 + }, + "placement": { + "type": "absolute", + "left": 20, + "top": 60 + }, + "visible": true, + "inversion": false + } + ] + \ No newline at end of file diff --git a/app/src/main/assets/fossil_hr/openSourceWatchface.bin b/app/src/main/assets/fossil_hr/openSourceWatchface.bin index e6cbe5917d80c7e0d46d50cdc482c998623b2bab..69b9f5d6549c3d460f59f11b2f8783a0086f5d35 100644 GIT binary patch literal 7620 zcmaJ_>vJ2|bw76>SiHdnKypb@5(!D>!W2nc6#$2j6HBqkmFrlI9j8v)DYOI@AZ!po z@Q|#ynL2G!+R4=8^fi4qeX<|b$xK~m(xJvPEjgnv@eF6^|A6hce&~mMOMmC?E+sim zIdgdL-h1x3=Y7t_3opO?HH-W|J4Yli4iF3lpyC_Q(ufvy ztOFJ!zymDez#@+BGQ@xz$Cw~``}4p{65YqSoixr)0N=zu?p@4dZ4x-o2x?7Zd>3mo zxMLRcDd5gw{O_Or%s7L!v)Eg}S-@fe-+)k8ibix^w^U2XUm`0$XD8={m9S!YE0xb%87n-bUByyrB$iG`6 zx}w;$cSW_uUPW8eizNPIoeYU@2%#FrP8s^EK!0q19zRF)Kj;3JY*A5*nzE+bbbrT= zEZ@`CDT{N0B0|x!xqaa6u0hXLoVfzs19qPUzz?JizW{mw<2j6g-K)U8=HJ6U^giyp zs^%SCs~DxI6{*C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03vj$Zy;+ z^@hPHv5CyYDibTp6Fj~Ps9n6EgpLiVmZ>P0B_?iGl!|mja-QT3ma1j6uND4Z$bXqZ zT?I+XX5-qxf875c!$0pgKSq48E1@R5_iTTPUM^J^*xwN%g>QdTs_|rwg?md4b;}i5j83H$$G^i|lsW zX;|m?lhklL-;0)F&p|&LxwINyuiLiwtwAL7r~5pFcQ$E~Vr}R&L#NlWe8*`ZOO?98 z9yJ0qgXgPh>>Q`?Z)?5qrJKR zu@^dR;IZpWo!jdK2&@(KLz?+-eaG|rkpuiVI;j}(wiA*zs>C@MCx`piPCtqQ-*R>x zKf=qY+wFQEu2IOK=kbc<$m>~7ryK2Cy(mP&Kna?d4yQE&O0E+Pl!LN@F+7e~MM*+k z0E0xFKoUj!U3_^!BGBbE?|DCi1`M(#>h^oBnbYcxkQ@>V`3!LzRmkF%)Xw42=!Y?z zlH~V0J5HFQogipCwvW0G$`yk@Dj_KZu7y#o48c;K3!>`;zDDrR>wE6N6h|Ox@egOe z<$T`tLhvWX>Kvju>U$QPM_{GZ2z&=v*maI8yad*+*Yj|Bg6eI%$8l%{9cPky`@P8N z0B>H10iA*Ro*mU&R@1JZ>XH;Xb}#Vr|G783QzFh5MlHNnP8nWMMjd1~APQeAJdY98 zfDO-P1j@*74)1N(gU_JZj2Vu8Ho#_Nk%`Zpp%7yhzeHZop;bf1Jx^yVokw81HKx-WPpdEy;*=fT8vTFw6o*g!DxQmy| z=n1%d``)dOt$PpdJ|ux2KFHIs$S9iU`W?KT9^xB4r6^57*YPd8+m(lv!4%c~#Ex15 UJ%P_=JAh9{pX0tqsM0?D8wyG&L;wH) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/FossilAppWriter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/FossilAppWriter.java index fc8b199c7..8ff214dd5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/FossilAppWriter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/FossilAppWriter.java @@ -39,11 +39,11 @@ public class FossilAppWriter { private String version; private LinkedHashMap code; private LinkedHashMap icons; - private LinkedHashMap layout; + private LinkedHashMap layout; private LinkedHashMap displayName; private LinkedHashMap config; - public FossilAppWriter(Context context, String version, LinkedHashMap code, LinkedHashMap icons, LinkedHashMap layout, LinkedHashMap displayName, LinkedHashMap config) { + public FossilAppWriter(Context context, String version, LinkedHashMap code, LinkedHashMap icons, LinkedHashMap layout, LinkedHashMap displayName, LinkedHashMap config) { this.mContext = context; if (this.mContext == null) throw new AssertionError("context cannot be null"); this.version = version; @@ -63,7 +63,7 @@ public class FossilAppWriter { public byte[] getWapp() throws IOException { byte[] codeData = loadFiles(code); byte[] iconsData = loadFiles(icons); - byte[] layoutData = loadStringFiles(layout); + byte[] layoutData = loadFiles(layout); byte[] displayNameData = loadStringFiles(displayName); byte[] configData = loadStringFiles(config); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java index b0cdfd227..3246a3d55 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java @@ -185,22 +185,15 @@ public class HybridHRWatchfaceFactory { } catch (IOException e) { LOG.warn("Unable to read asset file", e); } - LinkedHashMap layout = new LinkedHashMap<>(); - try { - layout.put("complication_layout", getComplicationLayout()); - } catch (JSONException e) { - LOG.warn("Could not generate complication_layout", e); - } - try { - layout.put("image_layout", getImageLayout()); - } catch (JSONException e) { - LOG.warn("Could not generate image_layout", e); - } - try { - if (includeWidget("widgetBattery") > 0) layout.put("battery_layout", getBatteryLayout()); - } catch (JSONException e) { - LOG.warn("Could not generate battery_layout", e); + LinkedHashMap layout = new LinkedHashMap<>(); + layout.put("complication_layout", context.getAssets().open("fossil_hr/complication_layout.json")); + layout.put("image_layout", context.getAssets().open("fossil_hr/image_layout.json")); + layout.put("menu_layout", context.getAssets().open("fossil_hr/menu_layout.json")); + + if (includeWidget("widgetBattery") > 0) { + layout.put("battery_layout", context.getAssets().open("fossil_hr/battery_layout.json")); } + LinkedHashMap displayName = new LinkedHashMap<>(); displayName.put("display_name", watchfaceName); displayName.put("theme_class", "complications");