diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index 4fe0584d2..ea6b0fe43 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -100,4 +100,5 @@ On 2v18.64+ firmware, 'No Messages' now has a 'back' button 0.72: Nav message updastes don't automatically launch navigation menu unless they're new 0.73: Add sharp left+right nav icons -0.74: Add option for driving on left (affects roundabout icons in navigation) \ No newline at end of file +0.74: Add option for driving on left (affects roundabout icons in navigation) +0.75: Handle text with images in messages list by just displaying the first line \ No newline at end of file diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 7aa4d432a..06308d5a2 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -446,7 +446,7 @@ function checkMessages(options) { if (options.clockIfAllRead && newMessages.length==0) return load(); active = "list"; - // Otherwise show a menu + // Otherwise show a list of messages E.showScroller({ h : 48, c : Math.max(MESSAGES.length,3), // workaround for 2v10.219 firmware (min 3 not needed for 2v11) @@ -469,16 +469,20 @@ function checkMessages(options) { .setColor(fg); // only color the icon x += 50; } - var m = msg.title+"\n"+msg.body, longBody=false; if (title) g.setFontAlign(-1,-1).setFont(fontBig).drawString(title, x,r.y+2); + var longBody = false; if (body) { g.setFontAlign(-1,-1).setFont("6x8"); + // if the body includes an image, it probably won't be small enough to allow>1 line + var maxLines = 3; + if (body.includes("\0")) maxLines=1; var l = g.wrapString(body, r.w-(x+14)); - if (l.length>3) { - l = l.slice(0,3); + if (l.length>maxLines) { + l = l.slice(0,maxLines); l[l.length-1]+="..."; } longBody = l.length>2; + // draw the body g.drawString(l.join("\n"), x+10,r.y+20); } if (!longBody && msg.src) g.setFontAlign(1,1).setFont("6x8").drawString(msg.src, r.x+r.w-2, r.y+r.h-2); diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 7fa7cee5d..6f2cb5d2e 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.74", + "version": "0.75", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app",