From 7809fa074e2ea6c4b0b4c20412fbe54a3609d36d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 15 Aug 2019 09:53:08 +0300 Subject: if previous workarounds fail, push passed first image to gallery --- org.fox.ttrss/src/main/AndroidManifest.xml | 4 ++-- .../src/main/java/org/fox/ttrss/GalleryActivity.java | 3 ++- .../src/main/java/org/fox/ttrss/types/GalleryEntry.java | 12 +++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index d8fcb2af..4602c377 100755 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="504" + android:versionName="1.270"> diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java index ebcceaf4..ca2b6a47 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/GalleryActivity.java @@ -252,7 +252,8 @@ public class GalleryActivity extends CommonActivity { // if we were unable to find first image, try again for all media content so that // gallery doesn't lock up because of a pending shared transition if (!collectGalleryContents(imgSrcFirst, doc, uncheckedItems)) - collectGalleryContents("", doc, uncheckedItems); + if (!collectGalleryContents("", doc, uncheckedItems)) + m_items.add(new GalleryEntry(imgSrcFirst, GalleryEntry.GalleryEntryType.TYPE_IMAGE, null)); } findViewById(R.id.gallery_overflow).setOnClickListener(new View.OnClickListener() { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/types/GalleryEntry.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/types/GalleryEntry.java index cb879ba6..0eb45074 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/types/GalleryEntry.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/types/GalleryEntry.java @@ -3,12 +3,22 @@ package org.fox.ttrss.types; import java.io.Serializable; public class GalleryEntry implements Serializable { - public enum GalleryEntryType { TYPE_IMAGE, TYPE_VIDEO }; + public enum GalleryEntryType { TYPE_IMAGE, TYPE_VIDEO } public String url; public GalleryEntryType type; public String coverUrl; + public GalleryEntry() { + // + } + + public GalleryEntry(String url, GalleryEntryType type, String coverUrl) { + this.url = url; + this.type = type; + this.coverUrl = coverUrl; + } + public boolean equals(GalleryEntry obj) { if (obj.url != null && url != null) { return obj.url.equals(url); -- cgit v1.2.3-54-g00ecf