Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

couldnt hide the progressbar after loading image in picasso?

I was trying to integrate progress bar in ma app.but i couldn't track the call back method.the progress bar always showing.how to hide when image is loded?

holder.imageView = (ImageView) localView.findViewById(R.id.imageView1);
holder.progressBar = (ProgressBar) localView.findViewWithTag(R.id.progressBar1);

localView.setTag(holder);
url = getItem(paramInt);
Picasso.with(getApplicationContext())
.load(url)
.placeholder(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher)
.fit()
.into(holder.imageView, new Callback() {

    @Override
    public void onSuccess() {
        holder.imageView.setVisibility(View.VISIBLE);
        holder.progressBar.setVisibility(View.INVISIBLE);        
    }

    @Override
    public void onError() {
        holder.progressBar.setVisibility(View.VISIBLE);
        holder.imageView.setVisibility(View.INVISIBLE);
    }
});
like image 841
Asthme Avatar asked Aug 28 '13 19:08

Asthme


1 Answers

Finally i fixed it.there was a bug in a Picasso 2.0.0 beta.used official library

like image 69
Asthme Avatar answered Oct 13 '22 10:10

Asthme