开发学院手机开发Android 开发 ScrollTextView - scrolling TextView for Androi... 阅读

ScrollTextView - scrolling TextView for Android

 2010-04-13 21:01:00 来源:WEB开发网   
核心提示:return;if (mPaused)return;mPaused = true;// abortAnimation sets the current X to be the final X,// and sets isFinished to be true// so current position shall be

return;

if (mPaused)

return;

mPaused = true;

// abortAnimation sets the current X to be the final X,

// and sets isFinished to be true

// so current position shall be saved

mXPaused = mSlr.getCurrX();

mSlr.abortAnimation();

}

@Override

/*

* override the computeScroll to restart scrolling when finished so as that

* the text is scrolled forever

*/

public void computeScroll() {

super.computeScroll();

if (null == mSlr) return;

if (mSlr.isFinished() && (!mPaused)) {

this.startScroll();

}

}

public int getRndDuration() {

return mRndDuration;

}

public void setRndDuration(int duration) {

this.mRndDuration = duration;

}

public boolean isPaused() {

return mPaused;

}

}

/*************************************************************************/

Issues to be fixed:

Do not know why it would not scroll sometimes if setHorizontallyScrolling is called in constructor;

The scrolling is not smooth enough. Maybe it's because of the single thread model of Android UI;

Tested on:

Windows XP

Android SDK 1.0 rc2

Android Emulator 1.0

Android Debug Bridge version 1.0.20

上一页  1 2 3 

Tags:ScrollTextView scrolling TextView

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接