// 当状态改变时候,调用该方法,以更新界面
  private void changeHeaderViewByState() {
    switch (state) {
      case RELEASE_To_REFRESH:
        arrowImageView.setVisibility(View.VISIBLE);
        progressBar.setVisibility(View.GONE);
        tipsTextview.setVisibility(View.VISIBLE);
        lastUpdatedTextView.setVisibility(View.VISIBLE);

        arrowImageView.clearAnimation();
        arrowImageView.startAnimation(animation);

        tipsTextview.setText("松开刷新");

        // Log.v(TAG, "当前状态,松开刷新");
        break;
      case PULL_To_REFRESH:
        progressBar.setVisibility(View.GONE);
        tipsTextview.setVisibility(View.VISIBLE);
        lastUpdatedTextView.setVisibility(View.VISIBLE);
        arrowImageView.clearAnimation();
        arrowImageView.setVisibility(View.VISIBLE);
        // 是由RELEASE_To_REFRESH状态转变来的
        if (isBack) {
          isBack = false;
          arrowImageView.clearAnimation();
          arrowImageView.startAnimation(reverseAnimation);

          tipsTextview.setText("下拉刷新");
        } else {
          tipsTextview.setText("下拉刷新");
        }
        // Log.v(TAG, "当前状态,下拉刷新");
        break;

      case REFRESHING:
        headView.setPadding(0, 0, 0, 0);
        headView.invalidate();

        progressBar.setVisibility(View.VISIBLE);
        arrowImageView.clearAnimation();
        arrowImageView.setVisibility(View.GONE);
        tipsTextview.setText("正在刷新...");
        lastUpdatedTextView.setVisibility(View.VISIBLE);

        // Log.v(TAG, "当前状态,正在刷新...");
        break;
      case DONE:
        headView.setPadding(0, -1 * headContentHeight, 0, 0);
        headView.invalidate();

        progressBar.setVisibility(View.GONE);
        arrowImageView.clearAnimation();
        arrowImageView.setImageResource(R.drawable.xlistview_arrow);
        tipsTextview.setText("下拉刷新");
        lastUpdatedTextView.setVisibility(View.VISIBLE);

        // Log.v(TAG, "当前状态,done");
        break;
    }
  }
Example #2
0
 public void setLocalAnitmation(int h, int m, int s) {
   RotateAnimation animation_s1 =
       new RotateAnimation(
           s * 6, s * 6 + 6, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.81f);
   RotateAnimation animation_h1 =
       new RotateAnimation(
           h * 30 + m / 2,
           h * 30 + 30,
           Animation.RELATIVE_TO_SELF,
           0.5f,
           Animation.RELATIVE_TO_SELF,
           0.75f);
   RotateAnimation animation_m1 =
       new RotateAnimation(
           m * 6,
           m * 6 + 6 / 60,
           Animation.RELATIVE_TO_SELF,
           0.5f,
           Animation.RELATIVE_TO_SELF,
           0.81f);
   animation_s1.setDuration(60 * 1000);
   animation_s1.setFillAfter(true);
   animation_h1.setDuration(3600 * 1000);
   animation_h1.setFillAfter(true);
   animation_m1.setDuration(60 * 60 * 60 * 1000);
   animation_m1.setFillAfter(true);
   iv_s1.clearAnimation();
   iv_h1.clearAnimation();
   iv_m1.clearAnimation();
   iv_s1.setAnimation(animation_s1);
   iv_h1.setAnimation(animation_h1);
   iv_m1.setAnimation(animation_m1);
 }
Example #3
0
 public void setNetClockAnimation(int h, int m, int s) {
   RotateAnimation animation_s2 =
       new RotateAnimation(
           s * 6, s * 6 + 6, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.81f);
   RotateAnimation animation_h2 =
       new RotateAnimation(
           h * 30 + m / 2,
           h * 30 + 30,
           Animation.RELATIVE_TO_SELF,
           0.5f,
           Animation.RELATIVE_TO_SELF,
           0.75f);
   RotateAnimation animation_m2 =
       new RotateAnimation(
           m * 6,
           m * 6 + 6 / 60,
           Animation.RELATIVE_TO_SELF,
           0.5f,
           Animation.RELATIVE_TO_SELF,
           0.81f);
   animation_s2.setDuration(60 * 1000);
   animation_s2.setFillAfter(true);
   animation_h2.setDuration(3600 * 1000);
   animation_h2.setFillAfter(true);
   animation_m2.setDuration(60 * 60 * 60 * 1000);
   animation_m2.setFillAfter(true);
   iv_s2.clearAnimation();
   iv_h2.clearAnimation();
   iv_m2.clearAnimation();
   iv_s2.setAnimation(animation_s2);
   iv_h2.setAnimation(animation_h2);
   iv_m2.setAnimation(animation_m2);
 }
Example #4
0
 @Override
 protected void onPause() {
   // TODO Auto-generated method stub
   super.onPause();
   image1.clearAnimation();
   image2.clearAnimation();
   image3.clearAnimation();
   image4.clearAnimation();
 }
Example #5
0
 public void fadeIn() {
   isLoading = false;
   setVisibility(View.VISIBLE);
   clearAnimation();
   loadingImg1.clearAnimation();
   loadingImg2.clearAnimation();
   loadingImg3.clearAnimation();
   startAnimation(mTranslateAnimationIn);
 }
Example #6
0
 public void stopLoading() {
   isLoading = false;
   loadingImg1.clearAnimation();
   loadingImg2.clearAnimation();
   loadingImg3.clearAnimation();
   if (mLoadingAnimationRunnable != null) {
     mLoadingAnimationRunnable.stop();
   }
 }
  private void changeHeaderViewByState() {
    lastUpdatedTextView.setText(
        context.getString(R.string.refresh_lasttime) + Common.howTimeAgo(context, lastRefreshTime));
    if (isRefreshable) {
      switch (state) {
        case RELEASE_TO_REFRESH:
          arrowImageView.setVisibility(View.VISIBLE);
          progressBar.setVisibility(View.GONE);
          tipsTextView.setVisibility(View.VISIBLE);
          arrowImageView.clearAnimation();
          arrowImageView.startAnimation(animation);
          tipsTextView.setText(context.getString(R.string.refresh_release));
          break;
        case PULL_TO_REFRESH:
          progressBar.setVisibility(View.GONE);
          tipsTextView.setVisibility(View.VISIBLE);
          arrowImageView.clearAnimation();
          arrowImageView.setVisibility(View.VISIBLE);
          // 是由RELEASE_To_REFRESH状态转变来的
          if (isBack) {
            isBack = false;
            arrowImageView.clearAnimation();
            arrowImageView.startAnimation(reverseAnimation);
          }
          // Log.v(TAG, "当前状态,下拉刷新");
          tipsTextView.setText(context.getString(R.string.refresh_pull));
          break;
        case REFRESHING:
          header.setPadding(0, 0, 0, 0);

          progressBar.setVisibility(View.VISIBLE);
          arrowImageView.clearAnimation();
          arrowImageView.setVisibility(View.GONE);
          // tipsTextview.setText(context.getString(R.string.loading));
          tipsTextView.setVisibility(View.GONE);
          lastUpdatedTextView.setVisibility(View.GONE);
          // Log.v(TAG, "当前状态,正在刷新...");
          break;
        case DONE:
          header.setPadding(0, -1 * headerHeight, 0, 0);

          progressBar.setVisibility(View.GONE);
          arrowImageView.clearAnimation();
          arrowImageView.setImageResource(R.drawable.arrow);
          tipsTextView.setText(context.getString(R.string.refresh_pull));
          tipsTextView.setVisibility(View.VISIBLE);
          lastUpdatedTextView.setVisibility(View.VISIBLE);
          // Log.v(TAG, "当前状态,done");
          break;
        default:
          break;
      }
    }
  }
 @Override
 public void handleMessage(Message msg) {
   // 回弹速度随下拉距离moveDeltaY增大而增大
   MOVE_SPEED =
       (float)
           (8
               + 5
                   * Math.tan(
                       Math.PI / 2 / getMeasuredHeight() * (pullDownY + Math.abs(pullUpY))));
   if (!isTouch) {
     // 正在刷新,且没有往上推的话则悬停,显示"正在刷新..."
     if (stage == REFRESHING && pullDownY <= refreshDist) {
       pullDownY = refreshDist;
       timer.cancel();
     } else if (stage == LOADING && -pullUpY <= loadMoreDist) {
       pullUpY = -loadMoreDist;
       timer.cancel();
     }
   }
   if (pullDownY > 0) {
     pullDownY -= MOVE_SPEED;
   } else if (pullUpY < 0) {
     pullUpY += MOVE_SPEED;
   }
   if (pullDownY < 0) {
     // 已完成回弹
     pullDownY = 0;
     refreshArrowImg.clearAnimation();
     // 隐藏下拉头时有可能还在刷新,只有当前状态不是正在刷新时才改变状态
     if (stage != REFRESHING && stage != LOADING) {
       changeStage(INIT);
     }
     timer.cancel();
     requestLayout();
   }
   if (pullUpY > 0) {
     // 已完成回弹
     pullUpY = 0;
     loadArrowImg.clearAnimation();
     // 隐藏上拉头时有可能还在刷新,只有当前状态不是正在刷新时才改变状态
     if (stage != REFRESHING && stage != LOADING) {
       changeStage(INIT);
     }
     timer.cancel();
     requestLayout();
   }
   // 刷新布局,会自动调用onLayout
   requestLayout();
   // 没有拖拉或者回弹完成
   if (pullDownY + Math.abs(pullUpY) == 0) {
     timer.cancel();
   }
 }
  private void changeHeaderViewByState() {
    switch (state) {
      case RELEASE_To_REFRESH:
        arrowImageView.setVisibility(View.VISIBLE);
        progressBar.setVisibility(View.GONE);
        tipsTextview.setVisibility(View.VISIBLE);
        lastUpdatedTextView.setVisibility(View.VISIBLE);

        arrowImageView.clearAnimation();
        arrowImageView.startAnimation(animation);

        tipsTextview.setText("�ɿ�ˢ��");

        break;
      case PULL_To_REFRESH:
        progressBar.setVisibility(View.GONE);
        tipsTextview.setVisibility(View.VISIBLE);
        lastUpdatedTextView.setVisibility(View.VISIBLE);
        arrowImageView.clearAnimation();
        arrowImageView.setVisibility(View.VISIBLE);
        if (isBack) {
          isBack = false;
          arrowImageView.clearAnimation();
          arrowImageView.startAnimation(reverseAnimation);

          tipsTextview.setText("����ˢ��");
        } else {
          tipsTextview.setText("����ˢ��");
        }
        break;

      case REFRESHING:
        headView.setPadding(0, 0, 0, 0);

        progressBar.setVisibility(View.VISIBLE);
        arrowImageView.clearAnimation();
        arrowImageView.setVisibility(View.GONE);
        tipsTextview.setText("����ˢ��...");
        lastUpdatedTextView.setVisibility(View.VISIBLE);

        break;
      case DONE:
        headView.setPadding(0, -1 * headContentHeight, 0, 0);

        progressBar.setVisibility(View.GONE);
        arrowImageView.clearAnimation();
        arrowImageView.setImageResource(R.drawable.z_arrow_down);
        tipsTextview.setText("����ˢ��");
        lastUpdatedTextView.setVisibility(View.VISIBLE);

        break;
    }
  }
  /** Удаляет анимацию двигающихся стрелок */
  private void ClearAnimation() {
    _form_carriages_upcoming_on_terminal_arrow.clearAnimation();
    _form_carriages_upcoming_on_station_arrow.clearAnimation();
    _form_carriages_upcoming_near_gd_arrow.clearAnimation();
    _form_carriages_upcoming_far_gd_arrow.clearAnimation();

    _form_carriages_upcoming_on_terminal_arrow.setVisibility(View.INVISIBLE);
    _form_carriages_upcoming_on_station_arrow.setVisibility(View.INVISIBLE);
    _form_carriages_upcoming_near_gd_arrow.setVisibility(View.INVISIBLE);
    _form_carriages_upcoming_far_gd_arrow.setVisibility(View.INVISIBLE);

    _form_carriages_upcoming_initial_prompt.setVisibility(View.INVISIBLE);
  }
  // 当状态改变时候,调用该方法,以更新界面
  private void changeHeaderViewByState() {
    switch (state) {
      case RELEASE_To_REFRESH:
        lvHeaderArrowIv.setVisibility(View.VISIBLE);
        lvHeaderProgressBar.setVisibility(View.GONE);
        lvHeaderTipsTv.setVisibility(View.VISIBLE);
        lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE);

        lvHeaderArrowIv.clearAnimation(); // 清除动画
        lvHeaderArrowIv.startAnimation(animation); // 开始动画效果

        lvHeaderTipsTv.setText("松开刷新");
        break;
      case PULL_To_REFRESH:
        lvHeaderProgressBar.setVisibility(View.GONE);
        lvHeaderTipsTv.setVisibility(View.VISIBLE);
        lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE);
        lvHeaderArrowIv.clearAnimation();
        lvHeaderArrowIv.setVisibility(View.VISIBLE);
        // 是由RELEASE_To_REFRESH状态转变来的
        if (isBack) {
          isBack = false;
          lvHeaderArrowIv.clearAnimation();
          lvHeaderArrowIv.startAnimation(reverseAnimation);

          lvHeaderTipsTv.setText("下拉刷新");
        } else {
          lvHeaderTipsTv.setText("下拉刷新");
        }
        break;

      case REFRESHING:
        headerView.setPadding(0, 0, 0, 0);

        lvHeaderProgressBar.setVisibility(View.VISIBLE);
        lvHeaderArrowIv.clearAnimation();
        lvHeaderArrowIv.setVisibility(View.GONE);
        lvHeaderTipsTv.setText("正在刷新...");
        lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE);
        break;
      case DONE:
        headerView.setPadding(0, -1 * headerContentHeight, 0, 0);

        lvHeaderProgressBar.setVisibility(View.GONE);
        lvHeaderArrowIv.clearAnimation();
        lvHeaderArrowIv.setImageResource(R.drawable.arrow);
        lvHeaderTipsTv.setText("下拉刷新");
        lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE);
        break;
    }
  }
Example #12
0
  public void setState(int state) {
    if (state == mState && mIsFirst) {
      mIsFirst = true;
      return;
    }

    if (state == STATE_REFRESHING) {
      // show progress
      mArrowImageView.clearAnimation();
      mArrowImageView.setVisibility(View.INVISIBLE);
      mProgressBar.setVisibility(View.VISIBLE);
    } else {
      // show arrow image
      mArrowImageView.setVisibility(View.VISIBLE);
      mProgressBar.setVisibility(View.INVISIBLE);
    }

    switch (state) {
      case STATE_NORMAL:
        if (mState == STATE_READY) {
          mArrowImageView.startAnimation(mRotateDownAnim);
        }

        if (mState == STATE_REFRESHING) {
          mArrowImageView.clearAnimation();
        }

        mHintTextView.setText(R.string.header_hint_refresh_normal);
        break;

      case STATE_READY:
        if (mState != STATE_READY) {
          mArrowImageView.clearAnimation();
          mArrowImageView.startAnimation(mRotateUpAnim);
          mHintTextView.setText(R.string.header_hint_refresh_ready);
        }
        break;

      case STATE_REFRESHING:
        mHintTextView.setText(R.string.header_hint_refresh_loading);
        break;

      default:
        break;
    }

    mState = state;
  }
Example #13
0
 /**
  * 停止自定义菊花的旋转
  *
  * @author [email protected] 2014-2-21 下午5:10:40
  * @param imageView
  * @return void
  */
 public static void stopAnim(ImageView imageView) {
   try {
     imageView.clearAnimation();
     imageView.setImageBitmap(null);
   } catch (Exception e) {
   }
 }
Example #14
0
  /** 松开手刷新 */
  public int releaseFreshing() {
    arrows.setVisibility(View.VISIBLE);
    tvRefresh.setVisibility(View.VISIBLE);
    tvDate.setVisibility(View.VISIBLE);
    progressBar.setVisibility(View.GONE);
    tvRefresh.setText("松开手刷新");

    if (isArrowsUp) {
      RotateAnimation animationUp =
          new RotateAnimation(
              0,
              -180,
              RotateAnimation.RELATIVE_TO_SELF,
              0.5f,
              RotateAnimation.RELATIVE_TO_SELF,
              0.5f);
      animationUp.setInterpolator(new LinearInterpolator());
      animationUp.setDuration(250);
      animationUp.setFillAfter(true);

      arrows.clearAnimation();
      arrows.setAnimation(animationUp);
    }

    isArrowsUp = false;
    return PullScrollView.RELEASE_TO_REFRESH;
  }
Example #15
0
  /** 下拉刷新 */
  public int setStartRefresh() {
    arrows.setVisibility(View.VISIBLE);
    tvRefresh.setVisibility(View.VISIBLE);
    tvDate.setVisibility(View.VISIBLE);
    progressBar.setVisibility(View.GONE);
    tvRefresh.setText("下拉刷新");

    if (!isArrowsUp) {
      RotateAnimation mReverseFlipAnimation =
          new RotateAnimation(
              -180,
              0,
              RotateAnimation.RELATIVE_TO_SELF,
              0.5f,
              RotateAnimation.RELATIVE_TO_SELF,
              0.5f);
      mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
      mReverseFlipAnimation.setDuration(250);
      mReverseFlipAnimation.setFillAfter(true);

      arrows.clearAnimation();
      arrows.setAnimation(mReverseFlipAnimation);
    }

    isArrowsUp = true;
    return PullScrollView.PULL_DOWN_STATE;
  }
  /** 刷新下拉控件的布局 */
  private void refreshState() {
    switch (mCurrrentState) {
      case STATE_PULL_REFRESH:
        tvTitle.setText("下拉刷新");
        ivArrow.setVisibility(View.VISIBLE);
        pbProgress.setVisibility(View.INVISIBLE);
        ivArrow.startAnimation(animDown);
        break;
      case STATE_RELEASE_REFRESH:
        tvTitle.setText("松开刷新");
        ivArrow.setVisibility(View.VISIBLE);
        pbProgress.setVisibility(View.INVISIBLE);
        ivArrow.startAnimation(animUp);
        break;
      case STATE_REFRESHING:
        tvTitle.setText("正在刷新...");
        ivArrow.clearAnimation(); // 必须先清除动画,才能隐藏
        ivArrow.setVisibility(View.INVISIBLE);
        pbProgress.setVisibility(View.VISIBLE);

        if (mListener != null) {
          mListener.onRefresh();
        }
        break;

      default:
        break;
    }
  }
  @Override
  protected void onDestroy() {
    // fb
    try {
      uiHelper.onDestroy();
    } catch (Exception e) {
      e.printStackTrace(); // altrimenti crashava
    }
    // Rilascio l'animazione sulla faccia di Jhonny
    if (findViewById(R.id.facejhonny) != null) {
      ImageView faceJhonny = ((ImageView) findViewById(R.id.facejhonny));
      if (faceJhonny != null) {
        faceJhonny.clearAnimation();
        faceJhonny.setAnimation(null);
      }
    }

    // Rilascio tutte le risorse audio del SoundPool
    SoundManager.finalizeSounds();
    // AnimationFactory.releaseAllAnimation();
    // Log.d("Sound finalized!","### Sound finalized! ###");
    if (mReceiver != null) {
      unregisterReceiver(mReceiver);
    }
    // Log.e("MenuActivity","DESTROY MenuActivity ####################");
    super.onDestroy();
  }
Example #18
0
  private void animateOffsetToCorrectPosition() {
    mFrom = mCurrentOffsetTop;
    mFromDragPercent = mCurrentDragPercent;

    mAnimateToCorrectPosition.reset();
    mAnimateToCorrectPosition.setDuration(MAX_OFFSET_ANIMATION_DURATION);
    mAnimateToCorrectPosition.setInterpolator(mDecelerateInterpolator);
    mRefreshView.clearAnimation();
    mRefreshView.startAnimation(mAnimateToCorrectPosition);

    if (mRefreshing) {
      mBaseRefreshView.start();
      if (mNotify) {
        if (mListener != null) {
          mListener.onRefresh();
        }
      }
    } else {
      mBaseRefreshView.stop();
      animateOffsetToStartPosition();
    }
    mCurrentOffsetTop = mTarget.getTop();
    mTarget.setPadding(
        mTargetPaddingLeft, mTargetPaddingTop, mTargetPaddingRight, mTotalDragDistance);
  }
 /** 只有它在从release to refresh是才需要显示动画 */
 public void showPullState() {
   ivArrow.setVisibility(View.VISIBLE);
   pbRefreshing.setVisibility(View.GONE);
   tvRefreshText.setText(strPullRefresh);
   ivArrow.clearAnimation();
   ivArrow.startAnimation(mReverseFlipAnimation);
 }
 /** 更新下拉头中的信息。 */
 private void updateHeaderView() {
   if (log.isDebugEnabled()) {
     log.debug(
         "updateHeaderView, current status :" + currentStatus + ", last status :" + lastStatus);
   }
   if (lastStatus != currentStatus) {
     if (currentStatus == STATUS_PULL_TO_REFRESH) {
       description.setText(getResources().getString(R.string.pull_to_refresh));
       arrow.setVisibility(View.VISIBLE);
       progressBar.setVisibility(View.GONE);
       rotateArrow();
     } else if (currentStatus == STATUS_RELEASE_TO_REFRESH) {
       description.setText(getResources().getString(R.string.release_to_refresh));
       arrow.setVisibility(View.VISIBLE);
       progressBar.setVisibility(View.GONE);
       rotateArrow();
     } else if (currentStatus == STATUS_REFRESHING) {
       description.setText(getResources().getString(R.string.refreshing));
       progressBar.setVisibility(View.VISIBLE);
       arrow.clearAnimation();
       arrow.setVisibility(View.GONE);
     }
     refreshUpdatedAtValue();
   }
 }
 public void showReleaseState() {
   ivArrow.setVisibility(View.VISIBLE);
   pbRefreshing.setVisibility(View.GONE);
   tvRefreshText.setText(strReleaseRefresh);
   ivArrow.clearAnimation();
   ivArrow.startAnimation(mFlipAnimation);
 }
 @Override
 public void onUIRefreshComplete(PtrFrameLayout ptrFrameLayout) {
   id_image_loading.setVisibility(View.INVISIBLE);
   id_text_progress_message.setText("更新完毕");
   //        set.cancel();
   id_image_loading.clearAnimation();
 }
Example #23
0
 @Override
 protected void onRefreshing() {
   mArrowImageView.clearAnimation();
   mArrowImageView.setVisibility(View.INVISIBLE);
   mProgressBar.setVisibility(View.VISIBLE);
   mHintTextView.setText(R.string.pull_to_refresh_header_hint_loading);
 }
Example #24
0
  @SuppressWarnings("unchecked")
  @Override
  public void refreshUI(Object... objects) {
    // TODO Auto-generated method stub
    iv_loading.clearAnimation();
    iv_loading.setVisibility(View.GONE);
    xListView.setVisibility(View.VISIBLE);
    if (rl_message_commment.isSelected()) {
      if (Integer.parseInt(objects[2].toString()) == TaskID.WEIBO_COMMENT_TIMELINE) {
        try {
          onLoad();

          comments = (ArrayList<Comment>) objects[0];
          last_comments = new JSONArray(objects[1].toString());

          if (comments.size() < Preferences.PAGE_SIZE) xListView.setPullLoadEnable(false);

          commentMentionListAdapter = new CommentMentionListAdapter(context, comments);
          xListView.setAdapter(commentMentionListAdapter);

        } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      } else {
        onLoad();
        ArrayList<Comment> more_comments = (ArrayList<Comment>) objects[0];
        comments.addAll(more_comments);

        commentMentionListAdapter.setComments(comments);
        commentMentionListAdapter.notifyDataSetChanged();
      }
    } else {
      if (Integer.parseInt(objects[2].toString()) == TaskID.WEIBO_MENTION_TIMELINE) {
        try {
          onLoad();

          statuses = (ArrayList<Statuse>) objects[0];
          last_statuses = new JSONArray(objects[1].toString());

          if (statuses.size() < Preferences.PAGE_SIZE) xListView.setPullLoadEnable(false);

          weiBoListAdapter = new WeiboMentionListAdapter(this, statuses);
          xListView.setAdapter(weiBoListAdapter);

        } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      } else {
        onLoad();
        ArrayList<Statuse> more_statuses = (ArrayList<Statuse>) objects[0];
        statuses.addAll(more_statuses);

        weiBoListAdapter.setStatuses(statuses);
        weiBoListAdapter.notifyDataSetChanged();
      }
    }
  }
 @Override
 public void onRelease() {
   rotated = false;
   ivArrow.clearAnimation();
   ivArrow.setVisibility(GONE);
   progressBar.setVisibility(VISIBLE);
   tvRefresh.setText(refreshingStr);
 }
  @Override
  public void onReset() {
    rotated = false;

    ivArrow.clearAnimation();
    ivArrow.setVisibility(GONE);
    progressBar.setVisibility(GONE);
  }
Example #27
0
 public void removeTutotrial() {
   if (mSplashLayout != null) {
     skipProgress = true;
     mAnimView.clearAnimation();
   }
   // CarouselScreenActivity.removeCarousel();
   ProgressScreen.removeProgressScreen();
 }
  /**
   * 改变加载更多状态
   *
   * @date 2013-11-11 下午10:05:27
   * @change JohnWatson
   * @version 1.0
   */
  private void changeEndViewByState() {
    if (mCanLoadMore) {
      // 允许加载更多
      switch (mEndState) {
        case ENDINT_LOADING: // 刷新中

          // 加载中...
          if (endLoadTipsTextView.getText().equals(R.string.p2refresh_doing_end_refresh)) {
            break;
          }
          endLoadTipsTextView.setText(R.string.p2refresh_doing_end_refresh);
          endLoadTipsTextView.setVisibility(View.VISIBLE);
          mEndLoadProgressBar.setVisibility(View.VISIBLE);
          AnimationRotate.rotatebolowImage(mEndLoadProgressBar);
          break;
        case ENDINT_MANUAL_LOAD_DONE: // 手动刷新完成

          // 点击加载
          endLoadTipsTextView.setText(R.string.p2refresh_end_click_load_more);
          endLoadTipsTextView.setVisibility(View.VISIBLE);
          mEndLoadProgressBar.clearAnimation();
          mEndLoadProgressBar.setVisibility(View.GONE);
          mEndRootView.setVisibility(View.VISIBLE);
          break;
        case ENDINT_AUTO_LOAD_DONE: // 自动刷新完成

          // 更 多
          endLoadTipsTextView.setText(R.string.p2refresh_end_load_more);
          endLoadTipsTextView.setVisibility(View.VISIBLE);
          mEndLoadProgressBar.clearAnimation();
          mEndLoadProgressBar.setVisibility(View.GONE);
          mEndRootView.setVisibility(View.VISIBLE);
          break;
        default:
          // 原来的代码是为了: 当所有item的高度小于ListView本身的高度时,
          // 要隐藏掉FootView,大家自己去原作者的代码参考。

          // if (mEnoughCount) {
          // mEndRootView.setVisibility(View.VISIBLE);
          // } else {
          // mEndRootView.setVisibility(View.GONE);
          // }
          break;
      }
    }
  }
Example #29
0
  @Override
  public void onLoadFinished(android.support.v4.content.Loader<Cursor> loader, Cursor cursor) {
    mAdapter.changeCursor(cursor);
    mRecyclerView.getLayoutManager().scrollToPosition(0);

    mEmptyView.startAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.insert_first_item));
    if (mAdapter.getItemCount() != 0) mEmptyView.clearAnimation();
  }
 @Override
 public void onUIRefreshBegin(PtrFrameLayout ptrFrameLayout) {
   id_image_loading.setVisibility(View.VISIBLE);
   id_text_progress_message.setText("正在加载,请稍候");
   //        set.start();
   id_image_loading.clearAnimation();
   id_image_loading.startAnimation(mFlipAnimation);
 }