Closed tosslife closed 9 years ago
Hi @tosslife
Thank you very much for the feedback. I just looked at it in detail and I can give you two different solutions for the problem.
I checked with the Android-Universal-Image-Loader library and there is actually a working example on the repository page. You could use the following code to set the loaded image to the SquareProgressBar:
final SquareProgressBar squareProgressBar = (SquareProgressBar) findViewById(R.id.sprogressbar);
squareProgressBar.setImage(R.drawable.panda);
squareProgressBar.setProgress(50.0);
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.init(ImageLoaderConfiguration.createDefault(this));
imageLoader.loadImage("http://halcyon.ch/wp-content/uploads/2015/06/1.png", new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
squareProgressBar.setImageBitmap(loadedImage);
}
});
So this works perfectly with the current code. But I also see your point, because it would be way easier if the SquareProgressBar could return the ImageView directly.
To use the one-line solution provided by the Android-Universal-Image-Loader library, you need the ImageView directly:
imageLoader.displayImage(imageUri, imageView);
To make this possible I will include a getter method on the SquareProgressBar class which returns the ImageView. This will be included in the 1.6.0 update which is going live next week.
Is this okay so far? I will push the change to the develop-branch and include it in the next version.
Thanks again Yannick
@mrwonderman tanks very much!!! hope 1.6.0 ! other need control ImageView size ,big picture show not better.
1.6.0 1.6.0 ^^
@tosslife yes, I noticed the problems about big images as well. I found a solution for it earlier this week and just pushed the change to the develop branch (https://github.com/mrwonderman/android-square-progressbar/commit/513b45be1be885c16bbfbcb201c6a787a248899d). So this should be fixed with 1.6.0 too. I will close this issue as soon as the version 1.6.0 published.
@tosslife
version 1.6.0 is available now and with it the new getter for the ImageView halcyon.ch - squareprogressbar v. 1.6.0. Thank you very much for your feedback. I will close this issue for now.
i want to use universal-image-loader to loading net picture ,and show progress。 squareprogressbar very nice,but only set local drawable and bitmap; can you get my idea?