Page MenuHomePhabricator

SVG and PNG images shown in Gallery shouldn't have their white background spill over into the rest of the view.
Closed, ResolvedPublic1 Estimated Story Points

Description

Description

Steps to reproduce

  1. Go to the tropical storm Brenda article.
  2. Go to the meteorological history section.
  3. Tap the map picture.
    screenshot-2015-07-16-13-23-15-422565192.png (1×1 px, 675 KB)

Expected results

Background is dark.

Actual results

Background is light.

Environments observed

App version: 6637c5f2def55db5fc44b1d3b291f6f1eee0d9cf
Android OS versions: API 22
Device model: emulator
Device language: English

Event Timeline

Niedzielski raised the priority of this task from to Needs Triage.
Niedzielski updated the task description. (Show Details)
Niedzielski subscribed.

Note: this is because we explicitly set the background to white for PNG and SVG images. I've tried to look for a solution where we set only the image boundary to white (while preserving the rest of the background as dark), but haven't had any luck

@Dbrant, maybe we can just make the ImageView height wrap_content and set the parent background to dark.

@Niedzielski But that wouldn't play well with the PhotoView library that provides the zoom & pan functionality. It expects the ImageView to be match_parent.

@Dbrant, hm maybe we can build a LayerListDrawable with a ColorDrawable in the background and a a BitmapDrawable on top, then set the ImageView src to use the Drawable.

Dbrant triaged this task as Medium priority.Jul 17 2015, 3:01 PM
Dbrant moved this task from Needs Triage to Bug Backlog on the Wikipedia-Android-App-Backlog board.
Dbrant renamed this task from Gallery background should be dark to SVG and PNG images shown in Gallery shouldn't have their white background spill over into the rest of the view..Sep 4 2015, 4:55 PM
Dbrant set Security to None.
MBinder_WMF set the point value for this task to 1.May 18 2016, 7:35 PM

Change 368827 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Correctly render explicit background color in ZoomableDraweeView.

https://gerrit.wikimedia.org/r/368827

Change 368827 merged by jenkins-bot:
[apps/android/wikipedia@master] Correctly render explicit background color in ZoomableDraweeView.

https://gerrit.wikimedia.org/r/368827

RHo subscribed.

LGTM.

main-MainActivity-08092017162849.png (1×1 px, 1 MB)

Tested using Nexus 5 (6.0.1) on Wikipedia v2.6.200-alpha-2017-08-08

ABorbaWMF subscribed.

Tested on a Nexus 4 with Android 5.1 and a Pixel with Android 7.1.1

This looks good for me. I tried the example article and a few others.