From 4469952c9a493dbb865aa7c29055502b44ff570e Mon Sep 17 00:00:00 2001 From: Himabindu Gadupudi Date: Tue, 17 Apr 2018 13:27:46 -0700 Subject: [PATCH] Pass drawable width and height in pixels for inline image Reviewed By: achen1 Differential Revision: D7655775 fbshipit-source-id: 32887eb5a686ccc45f50fb334248aad6889f704a --- .../frescosupport/FrescoBasedReactTextInlineImageSpan.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.java index d769d50fc..39cd24c6f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.java @@ -9,6 +9,7 @@ package com.facebook.react.views.text.frescosupport; import android.graphics.Color; import android.graphics.PorterDuff; +import com.facebook.react.uimanager.PixelUtil; import javax.annotation.Nullable; import android.content.res.Resources; @@ -70,12 +71,12 @@ public class FrescoBasedReactTextInlineImageSpan extends TextInlineImageSpan { ); mDraweeControllerBuilder = draweeControllerBuilder; mCallerContext = callerContext; - - mHeight = height; mTintColor = tintColor; - mWidth = width; mUri = (uri != null) ? uri : Uri.EMPTY; mHeaders = headers; + mWidth = (int)(PixelUtil.toPixelFromDIP(width)); + mHeight = (int)(PixelUtil.toPixelFromDIP(height)); + } /**