public PullToRefreshModule setPulledImageDelegate(
      PullToRefreshHelper.PulledImageDelegate pulledImageDelegate) {
    this.pulledImageDelegate = pulledImageDelegate;

    if (refreshImageView != null) refreshImageView.setPulledImageDelagate(pulledImageDelegate);

    return this;
  }
  public void onRefreshViewPulled(float distance) {
    stopClosingAnimation();

    if (refreshable && refreshViewParent != null) {
      refreshViewParent.setVisibility(View.VISIBLE);
      refreshViewParent.getLayoutParams().height = (int) distance;
      refreshViewParent.setLayoutParams(refreshViewParent.getLayoutParams());
      refreshViewParent.postInvalidate();

      refreshImageView.onRefreshViewPulled(distance / refreshThreshold);
    }

    if (layoutEventListener != null) layoutEventListener.onOpenedDistanceChanged(distance);
  }
  protected void onPrepareForPullToRefresh(MotionEvent event) {
    if (container == null) container = (ViewGroup) parent.getChildAt(0);

    refreshViewParent = (ViewGroup) container.findViewById(R.id.cu__ptr_parent);

    if (refreshViewParent != null) {
      refreshImageView = (PTRImageView) refreshViewParent.findViewById(R.id.cu__ptr_image);
      refreshImageView.setPulledImageDelagate(pulledImageDelegate);

      refreshLoadingViewParent = (ViewGroup) parent.findViewById(R.id.cu__ptr_loading_view_parent);
      refreshLoadingView = (PTRLoadingView) parent.findViewById(R.id.cu__ptr_loading_view);
      refreshLoadingView.setLoadingImageDelegate(loadingImageDelegate);
    }

    pullTouchStartY = event.getRawY();
  }
 private void disablePreLoadingViews() {
   if (refreshImageView != null) refreshImageView.setVisibility(View.GONE);
 }
  protected void resetViews() {
    if (refreshImageView != null) refreshImageView.setVisibility(View.VISIBLE);

    if (refreshLoadingViewParent != null) refreshLoadingViewParent.setVisibility(View.GONE);
  }