thunderrabbit

dialog speed throttle fix

May 12th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1.     @Override
  2.         public void onDraw(Canvas canvas) {
  3.             final long time = SystemClock.uptimeMillis();
  4.             final long delta = time - mLastTime;
  5.             if (delta >= TEXT_CHARACTER_DELAY_MS) {
  6.                 mLastTime = time;           // revision 7 should have this line
  7.                 if (mText != null) {
  8.                     if (mCurrentCharacter <= mText.length()) {
  9.                         CharSequence subtext = mText.subSequence(0, mCurrentCharacter);
  10.                         setText(subtext, TextView.BufferType.SPANNABLE);
  11.                         mCurrentCharacter++;
  12.                         postInvalidateDelayed(TEXT_CHARACTER_DELAY_MS);
  13.                     } else {
  14.                         if (mOkArrow != null) {
  15.                             mOkArrow.setVisibility(View.VISIBLE);
  16.                         }
  17.                     }
  18.                 }
  19.             }
  20.             super.onDraw(canvas);
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment