public PullToRefreshModule setLoadingImageDelegate(
      PullToRefreshHelper.LoadingImageDelegate loadingImageDelegate) {
    this.loadingImageDelegate = loadingImageDelegate;

    if (refreshLoadingView != null)
      refreshLoadingView.setLoadingImageDelegate(loadingImageDelegate);

    return this;
  }
  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 disableLoadingView() {
   if (!(refreshLoadingViewParent == null || refreshLoadingView == null)) {
     refreshLoadingViewParent.setVisibility(View.GONE);
     refreshLoadingView.stop();
   }
 }
 private void enableLoadingView() {
   if (!(refreshLoadingViewParent == null || refreshLoadingView == null)) {
     refreshLoadingViewParent.setVisibility(View.VISIBLE);
     refreshLoadingView.start();
   }
 }