[MediaWiki-commits] [Gerrit] Improve link preview thumbnail gallery alignment. - change (apps...wikipedia)
jenkins-bot has submitted this change and it was merged. 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(-) Approvals: Niedzielski: Looks good to me, approved jenkins-bot: Verified 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 @@ https://gerrit.wikimedia.org/r/277251 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89b2e55eedc5e4b5380d8f159ee2abf9fd9b151e Gerrit-PatchSet: 2 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: DbrantGerrit-Reviewer: BearND Gerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Niedzielski Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve link preview thumbnail gallery alignment. - change (apps...wikipedia)
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 @@ 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___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits