mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-15 23:03:58 +08:00
Reverting image source null so the fix can go all once later
Summary: Image source null which is in RC D8628053 has a bug which has a fix but didn't make to RC. Reverting so it can be cleaned up before going in RC. Reviewed By: achen1 Differential Revision: D8751687 fbshipit-source-id: e08b23a031455be23047880871813bdc840542dd
This commit is contained in:
committed by
Facebook Github Bot
parent
6292e2707a
commit
816d302e98
@@ -1,3 +1,4 @@
|
||||
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
@@ -70,9 +71,6 @@ public class ReactImageView extends GenericDraweeView {
|
||||
|
||||
public static final int REMOTE_IMAGE_FADE_DURATION_MS = 300;
|
||||
|
||||
public static final String REMOTE_TRANSPARENT_BITMAP_URI =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
|
||||
|
||||
private static float[] sComputedCornerRadii = new float[4];
|
||||
|
||||
/*
|
||||
@@ -341,10 +339,7 @@ public class ReactImageView extends GenericDraweeView {
|
||||
|
||||
public void setSource(@Nullable ReadableArray sources) {
|
||||
mSources.clear();
|
||||
if (sources == null || sources.size() == 0) {
|
||||
ImageSource imageSource = new ImageSource(getContext(), REMOTE_TRANSPARENT_BITMAP_URI);
|
||||
mSources.add(imageSource);
|
||||
} else {
|
||||
if (sources != null && sources.size() != 0) {
|
||||
// Optimize for the case where we have just one uri, case in which we don't need the sizes
|
||||
if (sources.size() == 1) {
|
||||
ReadableMap source = sources.getMap(0);
|
||||
@@ -578,9 +573,9 @@ public class ReactImageView extends GenericDraweeView {
|
||||
private void setSourceImage() {
|
||||
mImageSource = null;
|
||||
if (mSources.isEmpty()) {
|
||||
ImageSource imageSource = new ImageSource(getContext(), REMOTE_TRANSPARENT_BITMAP_URI);
|
||||
mSources.add(imageSource);
|
||||
} else if (hasMultipleSources()) {
|
||||
return;
|
||||
}
|
||||
if (hasMultipleSources()) {
|
||||
MultiSourceResult multiSource =
|
||||
MultiSourceHelper.getBestSourceForSize(getWidth(), getHeight(), mSources);
|
||||
mImageSource = multiSource.getBestResult();
|
||||
|
||||
Reference in New Issue
Block a user