Dbrant has uploaded a new change for review.
https://gerrit.wikimedia.org/r/277251
Change subject: Improve link preview thumbnail gallery alignment.
......................................................................
Improve link preview thumbnail gallery alignment.
The new version of the Support library allows RecyclerViews to have
"wrap_content" dimensions. In our link preview window, this means that we
can now center-align the thumbnail gallery when there are fewer images
than the width of the dialog.
I'm therefore removing the minimum number of images shown in the thumbnail
gallery.
To test: go to the [[Earth]] article, and click on the [[Greek]] link in
the first sentence. Thumbnail galleries with three or more images should
not be affected.
Change-Id: I89b2e55eedc5e4b5380d8f159ee2abf9fd9b151e
---
M app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
M app/src/main/res/layout/dialog_link_preview.xml
2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/51/277251/1
diff --git
a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
index 18d74bc..3aa8740 100755
--- a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
+++ b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
@@ -362,7 +362,7 @@
}
public void onGalleryResult(GalleryCollection result) {
- if (result.getItemList().size() > 2) {
+ if (!result.getItemList().isEmpty()) {
thumbnailGallery.setGalleryCollection(result);
// When the visibility is immediately changed, the images
flicker. Add a short delay.
diff --git a/app/src/main/res/layout/dialog_link_preview.xml
b/app/src/main/res/layout/dialog_link_preview.xml
index 01fcf97..3838982 100755
--- a/app/src/main/res/layout/dialog_link_preview.xml
+++ b/app/src/main/res/layout/dialog_link_preview.xml
@@ -96,9 +96,10 @@
<org.wikipedia.page.gallery.GalleryThumbnailScrollView
android:id="@+id/link_preview_thumbnail_gallery"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="@dimen/linkPreviewImageSize"
android:layout_marginTop="12dp"
+ android:layout_gravity="center_horizontal"
android:visibility="gone" />
<View
--
To view, visit https://gerrit.wikimedia.org/r/277251
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I89b2e55eedc5e4b5380d8f159ee2abf9fd9b151e
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits