Helpers.getPlaceholderImageDrawable = function (value) {
     var fileName = "", drawable = null;
     if (types.isString(value)) {
         value = value.trim();
         if (utils.isFileOrResourcePath(value)) {
             if (0 === value.indexOf("~/")) {
                 fileName = fs.path.join(fs.knownFolders.currentApp().path, value.replace("~/", ""));
                 drawable = android.graphics.drawable.Drawable.createFromPath(fileName);
             }
             else if (0 === value.indexOf("res")) {
                 fileName = value;
                 var res = utils.ad.getApplicationContext().getResources();
                 var resName = fileName.substr(utils.RESOURCE_PREFIX.length);
                 var identifier = res.getIdentifier(resName, 'drawable', utils.ad.getApplication().getPackageName());
                 drawable = res.getDrawable(identifier);
             }
         }
     }
     return drawable;
 };
 Helpers.setSource = function (image, value) {
     image.nativeView.setImageURI(null, null);
     if (types.isString(value)) {
         value = value.trim();
         if (utils.isFileOrResourcePath(value) || 0 === value.indexOf("http")) {
             image.isLoading = true;
             var fileName = "";
             if (0 === value.indexOf("~/")) {
                 fileName = fs.path.join(fs.knownFolders.currentApp().path, value.replace("~/", ""));
                 fileName = "file:" + fileName;
             }
             else if (0 === value.indexOf("res")) {
                 fileName = value;
                 var res = utils.ad.getApplicationContext().getResources();
                 var resName = fileName.substr(utils.RESOURCE_PREFIX.length);
                 var identifier = res.getIdentifier(resName, 'drawable', utils.ad.getApplication().getPackageName());
                 fileName = "res:/" + identifier;
             }
             else if (0 === value.indexOf("http")) {
                 image.isLoading = true;
                 fileName = value;
             }
             image.nativeView.setImageURI(android.net.Uri.parse(fileName), null);
             var controllerListener = new proxy_base_controller_listener_1.ProxyBaseControllerListener();
             controllerListener.setNSCachedImage(image);
             var controller = com.facebook.drawee.backends.pipeline.Fresco.newDraweeControllerBuilder()
                 .setControllerListener(controllerListener)
                 .setUri(android.net.Uri.parse(fileName))
                 .build();
             image.nativeView.setController(controller);
             image.requestLayout();
         }
         else {
             throw new Error("Path \"" + "\" is not a valid file or resource.");
         }
     }
 };