content: package com.aiceking.view_load_retry.loadretryadapter.forimageview;
  
  import android.view.View;
  import android.view.animation.AlphaAnimation;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.aiceking.view_load_retry.R;
  import com.aiceking.viewloadretrylibrary.adapter.BaseLoadRetryAdapter;
  
  public class NetErrorAdapterForImageView extends BaseLoadRetryAdapter{
      @Override
      public void onLoadStart(View view) {
          ((TextView)view.findViewById(R.id.tv_retry)).setText("点击重新加载");
      }
      @Override
      public void onFalied(View view, Object object) {
          ((ImageView) view.findViewById(R.id.iv_head)).setImageResource(R.mipmap.timeout);
          ((TextView)view.findViewById(R.id.tv_text)).setText((String)object);
          ((TextView)view.findViewById(R.id.tv_retry)).setVisibility(View.VISIBLE);
      }
      @Override
      public void onSuccess(View view) {
          AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);
          alphaAnimation.setDuration(500);
          view.startAnimation(alphaAnimation);
          view.setVisibility(View.GONE);
      }
  
      @Override
      public int getCoverViewLayoutId() {
          return R.layout.retry_imageview;
      }
  }
  