Pregunta

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);
    }
});
¿Fue útil?

Solución

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

Otros consejos

Try using VIEW.GONE instead of VIEW.INVISIBLE

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top