Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import com.facebook.common.util.UriUtil;
import androidx.core.content.ContextCompat;

import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;

import com.facebook.common.util.UriUtil;


public class RCTResourceDrawableIdHelper {
Expand Down Expand Up @@ -36,7 +38,7 @@ public int getResourceDrawableId(Context context, @Nullable String name) {

public @Nullable Drawable getResourceDrawable(Context context, @Nullable String name) {
int resId = getResourceDrawableId(context, name);
return resId > 0 ? context.getResources().getDrawable(resId) : null;
return resId > 0 ? ContextCompat.getDrawable(context, resId) : null;
}

public Uri getResourceDrawableUri(Context context, @Nullable String name) {
Expand Down