title: Android: onPreDrawListener didn't removed in custom view inside RecyclerView
body: <p>I have RecyclerView with custom views. Inside custom view I create an ImageView and add it. Also I adding onPreDrawListener for created ImageView and removed it as soon as onPreDraw callback invoked. But I discovered that at each call of onBindViewHolder will increase calls of onPreDraw callback.
  Here is my code example:</p>
  
  <pre><code>public class CustomView extends RelativeLayout {
  
  private static final String TAG = CustomView.class.getName();
  private static final String VIEW_TAG = "VIEW_TAG";
  
  private ImageView imageView;
  
  private static int counter = 0;
  
  public CustomView(Context context) {
      super(context);
  }
  
  public CustomView(Context context, @Nullable AttributeSet attrs) {
      super(context, attrs);
  }
  
  public CustomView(Context context, @Nullable AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
  }
  
  @Override
  protected void onFinishInflate() {
      super.onFinishInflate();
  
      imageView = new AppCompatImageView(getContext());
      imageView.setTag(VIEW_TAG);
      imageView.setImageDrawable(new ColorDrawable(ContextCompat.getColor(getContext(), R.color.colorPrimary)));
      LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
  
      View view = findViewWithTag(VIEW_TAG);
      if (view != null) {
          removeView(view);
      }
      addView(imageView, layoutParams);
  
      counter++;
      imageView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
          @Override
          public boolean onPreDraw() {
              imageView.getViewTreeObserver().removeOnPreDrawListener(this);
              counter--;
  
              Log.e(TAG, "Counter: " + counter);
              return true;
          }
      });
  }
  }
  
  private static class Adapter extends RecyclerView.Adapter {
  
      @Override
      public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View root = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout__item_view, parent, false);
          return new ViewHolder(root);
      }
  
      @Override
      public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
          ((ViewHolder) holder).itemView.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  notifyItemChanged(holder.getAdapterPosition());
              }
          });
      }
  
      @Override
      public int getItemCount() {
          return 100;
      }
  
      private static class ViewHolder extends RecyclerView.ViewHolder {
  
          public ViewHolder(View itemView) {
              super(itemView);
          }
      }
  }
  </code></pre>
  
  <p>By clicking on item in adapter in logs I see that value of counter variable is decreasing. Instead of have zero value as I expecting. Do anyone know the reason?</p>