diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-22 17:52:22 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-22 17:52:22 +0200 |
| commit | 9fba091bb394e8e4c7e8ccd0702081bd1a939047 (patch) | |
| tree | d21c451a94452d2b36dfccca35b1b45adfc2bc59 /app/src/main/java/mygram/droid/Api.java | |
| parent | 899b1d9812c61a33554b67e3026850684e686ce1 (diff) | |
| download | mygram-droid-9fba091bb394e8e4c7e8ccd0702081bd1a939047.tar.gz mygram-droid-9fba091bb394e8e4c7e8ccd0702081bd1a939047.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'app/src/main/java/mygram/droid/Api.java')
| -rw-r--r-- | app/src/main/java/mygram/droid/Api.java | 7 |
1 files changed, 7 insertions, 0 deletions
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<String, String> AVATARS = new ConcurrentHashMap<>(); private Api() { } @@ -161,6 +165,9 @@ final class Api { List<Folder> 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; } |
