From 9fba091bb394e8e4c7e8ccd0702081bd1a939047 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 17:52:22 +0200 Subject: Folder pictures, photo/video tile marks, folder in the viewer Home rows and the folder header show the folder's round picture next to its name. Post tiles carry a photo or video mark in the top left, on a dark dot so it reads on bright thumbnails. The viewer shows the current post's folder picture and name in the top left; pictures come from the last loaded folder list, so before one loads only the name shows. Co-Authored-By: Claude Opus 5.5 --- app/src/main/java/mygram/droid/Api.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/src/main/java/mygram/droid/Api.java') diff --git a/app/src/main/java/mygram/droid/Api.java b/app/src/main/java/mygram/droid/Api.java index f603b1b..c7d08eb 100644 --- a/app/src/main/java/mygram/droid/Api.java +++ b/app/src/main/java/mygram/droid/Api.java @@ -35,6 +35,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -46,6 +47,9 @@ final class Api { static final ExecutorService IO = Executors.newFixedThreadPool(4); private static final int TIMEOUT_MS = 15000; private static final int PAGE = 60; + /** Folder slug to picture URL, filled by folders(); the viewer reads it. */ + // ponytail: empty until a folder list has loaded once, so the viewer then shows the name alone. + static final Map AVATARS = new ConcurrentHashMap<>(); private Api() { } @@ -161,6 +165,9 @@ final class Api { List out = new ArrayList<>(); for (int i = 0; i < items.length(); i++) out.add(new Folder(items.getJSONObject(i), Prefs.server())); + for (Folder f : out) + if (f.avatarUrl != null) + AVATARS.put(f.slug, f.avatarUrl); out.sort((a, b) -> Long.compare(b.latest, a.latest)); return out; } -- cgit v1.2.3