예제 #1
0
 public void moveToLeft() {
   if (DEBUG) LogHelper.LOGD(TAG, "moveToLeft");
   if (!mStartAnimation) {
     if (DEBUG) LogHelper.LOGD(TAG, "moveLeftIn----mScroller.getCurrX()=" + mScroller.getCurrX());
     mStartAnimation = true;
     isLeft = true;
     /** dx是移动距离。。。 */
     mScroller.startScroll(-mTheme.getScreenWidth(), 0, mTheme.getScreenWidth(), 0, 300);
     invalidate();
   }
 }
예제 #2
0
 @Override
 public void computeScroll() {
   super.computeScroll();
   if (mScroller.computeScrollOffset()) {
     scrollTo(mScroller.getCurrX(), 0);
     if (DEBUG) LogHelper.LOGD(TAG, "mScroller.getCurrX()=" + mScroller.getCurrX());
     postInvalidate();
   } else if (mStartAnimation && mScroller.isFinished()) { // 结束动画
     if (mFinishListener != null) {
       mFinishListener.finishAnimation(isLeft);
     }
     if (DEBUG)
       LogHelper.LOGD(TAG, "mStartAnimation && mScroller.isFinished()=" + mScroller.getCurrX());
     mStartAnimation = false;
   }
 }
예제 #3
0
 public void updateTheme() {
   background = getResources().getDrawable(mTheme.getThemeId());
   background.setCallback(null);
   background.setBounds(0, 0, mTheme.getScreenWidth(), mTheme.getScreenHeight());
   if (DEBUG) LogHelper.LOGD(TAG, "---------------setTheme---------");
   /*if(first)
   updateTheme();*/
 }
예제 #4
0
 public void leftmoveIn() {
   if (!mStartAnimation) {
     if (DEBUG) LogHelper.LOGD(TAG, "moveLeftIn" + "mScroller.getCurrX()=" + mScroller.getCurrX());
     mStartAnimation = true;
     isLeft = false;
     mScroller.startScroll(mTheme.getScreenWidth(), 0, -mTheme.getScreenWidth(), 0, 300);
     invalidate();
   }
 }