mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Replace Toast with Log.w on ReactImageView when null URL specified (#34819)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/34819 This is crashing on A12 because of using the regular Context instead of the application context. That said, this probably makes more sense as a log warning. Reviewed By: javache Differential Revision: D39852058 fbshipit-source-id: 1ac93f8cc9ecdb14f60baca175c8ecff2ff42ac0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5f5d6b786c
commit
30411ae1a4
@@ -65,6 +65,7 @@ rn_android_library(
|
||||
react_native_target("java/com/facebook/react/common:common"),
|
||||
react_native_target("java/com/facebook/react/module/annotations:annotations"),
|
||||
react_native_target("java/com/facebook/react/uimanager:uimanager"),
|
||||
react_native_target("java/com/facebook/react/util:util"),
|
||||
react_native_target("java/com/facebook/react/modules/fresco:fresco"),
|
||||
react_native_target("java/com/facebook/react/uimanager/annotations:annotations"),
|
||||
react_native_target("java/com/facebook/react/views/imagehelper:withmultisource"),
|
||||
|
||||
@@ -19,7 +19,6 @@ import android.graphics.Shader;
|
||||
import android.graphics.drawable.Animatable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.common.internal.Objects;
|
||||
import com.facebook.common.references.CloseableReference;
|
||||
@@ -51,6 +50,7 @@ import com.facebook.react.uimanager.FloatUtil;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.UIManagerHelper;
|
||||
import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
import com.facebook.react.util.RNLog;
|
||||
import com.facebook.react.views.imagehelper.ImageSource;
|
||||
import com.facebook.react.views.imagehelper.MultiSourceHelper;
|
||||
import com.facebook.react.views.imagehelper.MultiSourceHelper.MultiSourceResult;
|
||||
@@ -597,11 +597,9 @@ public class ReactImageView extends GenericDraweeView {
|
||||
|
||||
private void warnImageSource(String uri) {
|
||||
if (ReactBuildConfig.DEBUG) {
|
||||
Toast.makeText(
|
||||
getContext(),
|
||||
"Warning: Image source \"" + uri + "\" doesn't exist",
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
RNLog.w(
|
||||
(ReactContext) getContext(),
|
||||
"ReactImageView: Image source \"" + uri + "\" doesn't exist");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user