diff --git a/CHANGELOG.md b/CHANGELOG.md index bcf90b4..b1b9088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ Versions after 2.17 are `MAJOR.MINOR.PATCH` (2.17 is followed by 2.17.1 or 2.18. `docs/testing.md`, "Versions and releases"); the headings below keep the numbers as they were released. +## 2.24.1 — 2026-11-17 + +- The snapshot's note in a black cell is shorter and on two lines ("black in the copy:" / "a + dark picture, or video this device cannot copy"): in 2.24.0 one line was cut off in a 2×2 + grid. + ## 2.24.0 — 2026-11-17 - **Network** has a **Web page password** (the last field, empty by default): when set, the page diff --git a/android/app/build.gradle b/android/app/build.gradle index 4b368ae..a12efb0 100755 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,8 +26,8 @@ android { applicationId "com.openipc.decoder" minSdk 21 targetSdk 36 - versionCode 57 - versionName "2.24.0" + versionCode 58 + versionName "2.24.1" // Keep only these locales of the libraries' resources, as in the other OpenIPC apps resourceConfigurations += ['en', 'ru', 'zh-rCN'] diff --git a/android/app/src/main/java/com/openipc/decoder/Snapshots.java b/android/app/src/main/java/com/openipc/decoder/Snapshots.java index 1a4a345..c8ee8c0 100644 --- a/android/app/src/main/java/com/openipc/decoder/Snapshots.java +++ b/android/app/src/main/java/com/openipc/decoder/Snapshots.java @@ -204,8 +204,8 @@ static byte[] render(List cells, int side, int width, boolean labels) { } /** Said in a cell whose copy came out black. */ - static final String NOT_COPIED = - "black in the copy: a dark picture, or video this device does not let be copied"; + static final String[] NOT_COPIED = { + "black in the copy:", "a dark picture, or video this device cannot copy"}; /** * Whether a copied frame is black all over: at least 98 % of a sample of its pixels darker @@ -236,15 +236,20 @@ static boolean dark(int argb) { return ((argb >> 16) & 0xFF) <= 8 && ((argb >> 8) & 0xFF) <= 8 && (argb & 0xFF) <= 8; } - private static void drawNote(Canvas canvas, String note, int x, int y, int cw, int ch, + /** Lines centred in the cell, smaller than a label (a sentence), each cut to the cell. */ + private static void drawNote(Canvas canvas, String[] note, int x, int y, int cw, int ch, TextPaint text) { float size = text.getTextSize(); - text.setTextSize(Math.max(12, size * 0.6f)); // a sentence, not a label - String line = TextUtils.ellipsize(note, text, cw - 8, TextUtils.TruncateAt.END).toString(); + text.setTextSize(Math.max(12, size * 0.6f)); text.setColor(0xFFB0B0B0); - float w = text.measureText(line); - canvas.drawText(line, x + Math.max(4, (cw - w) / 2), y + (ch + text.getTextSize()) / 2f, - text); + float lineH = text.getTextSize() * 1.3f; + float top = y + (ch - lineH * note.length) / 2f + text.getTextSize(); + for (int i = 0; i < note.length; i++) { + String line = TextUtils.ellipsize(note[i], text, cw - 8, + TextUtils.TruncateAt.END).toString(); + float w = text.measureText(line); + canvas.drawText(line, x + Math.max(4, (cw - w) / 2), top + i * lineH, text); + } text.setTextSize(size); } diff --git a/docs/debug.md b/docs/debug.md index 8ba55de..baea46f 100644 --- a/docs/debug.md +++ b/docs/debug.md @@ -61,7 +61,7 @@ The device's addresses are in `addresses` of `/stats.json`, and the [U cell](usa A JPEG laid out like the screen, at the screen's resolution (at most 1920 wide, at least 640), made from the frames the app shows now. A cell without video is black with its status. With labels (the default) the text of each cell is drawn in; `?labels=0` gives the frames only, which is what the page uses. It is taken only when asked for and reused for 1 s, so several viewers cost one capture. `503` when there is nothing to show. Needs Android 7.0+ (PixelCopy). -A device may show some cells on a hardware video plane that no copy can read (on the SberBox, Amlogic, two of four cells, which two is up to the device; `adb shell screencap` sees them black too). Such a cell, live on the screen but black in the copy, says *black in the copy: a dark picture, or video this device does not let be copied*, labels or not. +A device may show some cells on a hardware video plane that no copy can read (on the SberBox, Amlogic, two of four cells, which two is up to the device; `adb shell screencap` sees them black too). Such a cell, live on the screen but black in the copy, says *black in the copy: a dark picture, or video this device cannot copy* (two lines), labels or not. ## Stream checks in the single view