PhotoView
PhotoView copied to clipboard
Show images from URL
🚀 Feature Requests
Fetch Image from an URL present in the form of String
Contextualize the feature
Images are stored as URL
s in Cloud Databases. Need of a method to fetch image from that URL
and then display.
Describe the feature
Currently to set an Image, the following method is invoked:
imageView.setImageResource(R.drawable.image_id)
The method only accepts a parameter of type resource id
. But if a string is provided instead, it would give compilation errors. Please add a feature to fetch image from cloud database, given in form of URL
. A URL
is of type String
.
you can use Picasso or Glide to achieve this.
add in your main program :
... get File by TCPIP download from your database
Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); // file : File to your image
mPhotoView.setImageBitmap(myBitmap);
add in PhotoView.java :
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
if (attacher != null) {
attacher.update();
}
}