chris41g

Untitled

Jul 26th, 2011
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. /* package */ void setProgress(int newProgress) {
  2.         if (newProgress >= mHorizontalProgress.getMax()) {
  3.             mTitle.setCompoundDrawables(null, null, null, null);
  4.             ((Animatable) mCircularProgress).stop();
  5.             mHorizontalProgress.setVisibility(View.INVISIBLE);
  6.             if (!mInVoiceMode) {
  7.                 mRtButton.setImageDrawable(mBookmarkDrawable);
  8.                 mRtButton.setVisibility(View.VISIBLE);
  9.                 mStopButton.setVisibility(View.GONE);
  10.                 mTitleBg.setBackgroundDrawable(mNormalBackground);
  11.                 mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
  12.             }
  13.             mInLoad = false;
  14.         } else {
  15.             mHorizontalProgress.setProgress(newProgress);
  16.             if (!mInLoad && getWindowToken() != null) {
  17.                 // checking the window token lets us be sure that we
  18.                 // are attached to a window before starting the animation,
  19.                 // preventing a potential race condition
  20.                 // (fix for bug http://b/2115736)
  21.                 mTitle.setCompoundDrawables(null, null, mCircularProgress,
  22.                         null);
  23.                 ((Animatable) mCircularProgress).start();
  24.                 mHorizontalProgress.setVisibility(View.VISIBLE);
  25.                 if (!mInVoiceMode) {
  26.                     mTitleBg.setBackgroundDrawable(mLoadingBackground);
  27.                     mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
  28.                     mRtButton.setVisibility(View.GONE);
  29.                     mStopButton.setVisibility(View.VISIBLE);
  30.                 }
  31.                 mInLoad = true;
  32.             }
  33.         }
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment