Skip to content

Commit

Permalink
[TIMOB-25220] Fix FileProxy compatibility with TiDrawableReference
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Sep 4, 2017
1 parent 79a44a2 commit 33a4348
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiBlob;
import org.appcelerator.titanium.TiDimension;
import org.appcelerator.titanium.TiFileProxy;
import org.appcelerator.titanium.io.TiBaseFile;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiDownloadListener;
Expand Down Expand Up @@ -238,6 +239,8 @@ public static TiDrawableReference fromObject(Activity activity, Object object)
return fromBlob(activity, TiConvert.toBlob(object));
} else if (object instanceof Number) {
return fromResourceId(activity, ((Number)object).intValue());
} else if (object instanceof TiFileProxy) {
return TiDrawableReference.fromFile(activity, ((TiFileProxy)object).getBaseFile());
} else {
Log.w(TAG, "Unknown image resource type: " + object.getClass().getSimpleName()
+ ". Returning null drawable reference");
Expand Down

0 comments on commit 33a4348

Please sign in to comment.