Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* package */ void setProgress(int newProgress) {
- if (newProgress >= mHorizontalProgress.getMax()) {
- mTitle.setCompoundDrawables(null, null, null, null);
- ((Animatable) mCircularProgress).stop();
- mHorizontalProgress.setVisibility(View.INVISIBLE);
- if (!mInVoiceMode) {
- mRtButton.setImageDrawable(mBookmarkDrawable);
- mRtButton.setVisibility(View.VISIBLE);
- mStopButton.setVisibility(View.GONE);
- mTitleBg.setBackgroundDrawable(mNormalBackground);
- mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
- }
- mInLoad = false;
- } else {
- mHorizontalProgress.setProgress(newProgress);
- if (!mInLoad && getWindowToken() != null) {
- // checking the window token lets us be sure that we
- // are attached to a window before starting the animation,
- // preventing a potential race condition
- // (fix for bug http://b/2115736)
- mTitle.setCompoundDrawables(null, null, mCircularProgress,
- null);
- ((Animatable) mCircularProgress).start();
- mHorizontalProgress.setVisibility(View.VISIBLE);
- if (!mInVoiceMode) {
- mTitleBg.setBackgroundDrawable(mLoadingBackground);
- mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
- mRtButton.setVisibility(View.GONE);
- mStopButton.setVisibility(View.VISIBLE);
- }
- mInLoad = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment