mrwonderman / android-square-progressbar

An android library to display a progressbar that goes around an image.
http://halcyon.ch/android-square-progressbar-v-1-6-0/
1.28k stars 285 forks source link

Wanted to setImageDrawable because there was only the setImageResource #41

Closed erikswed closed 7 years ago

erikswed commented 7 years ago

This is useful when using Picasso like this

Picasso.with(getActivity()) .load(imageURL) .into(streetViewImage, new com.squareup.picasso.Callback() { @Override public void onSuccess() { SquareProgressBar squareProgressBar = (SquareProgressBar) getView().findViewById(R.id.search_street_view_image_SquareProgressBar); ImageView streetViewImage = (ImageView) getView().findViewById(R.id.search_street_view_image); int id = Resources.getSystem().getIdentifier("ic_dialog_alert", "drawable", "android"); squareProgressBar.setImage(streetViewImage.getDrawable()); squareProgressBar.setProgress(50.0); squareProgressBar.setIndeterminate(true); streetViewImage.setImageDrawable(null); }

@Override public void onError() { //do smth when there is picture loading error } });

mrwonderman commented 7 years ago

added in version 1.6.1