mViewBodyHScroll.scrollTo(0, 0);
mIsLockHScroll = false;
/* create background normalview */
- //int viewWidth = mViewWidth * 2;
+ startCandidateTask();
+ }
+ /*
+ *
+ */
+ private void startCandidateTask() {
int viewWidth = mViewWidth * 1000;
mCandidateTask = new TextCandidateTask(this);
if (null != mCandidateTask) {
/*
*
*/
- public void cancelTask() {
- mIsCancelTask = true;
- }
- /*
- *
- */
public void checkCandidateTask() {
if (null != mCandidateTask) {
mCandidateTask.cancel(true);
if (null != mCandidateTask) {
mCandidateTask.cancel(true);
while(count > 0) {
- SystemClock.sleep(20);
+ try {
+ Thread.sleep(20);
+ } catch (Exception e) {
+ return;
+ }
+ //SystemClock.sleep(20);
if (true == mIsCancelTask) {
break;
}
}
}
/*
+ * cancel callback
+ */
+ public void cancelTask() {
+ mIsCancelTask = true;
+ }
+ /*
*
*/
synchronized private void createWnnWordArray() {
*/
public void display1stLastSetup() {
m1stWordCount = mWordCount;
- /*
- if (mWordCount < 1) { // no candidates
- if (mAutoHideMode) {
- mWnn.setCandidatesViewShown(false);
- } else {
- mCanReadMore = false;
- mIsFullView = false;
- setViewLayout(CandidatesViewManager.VIEW_TYPE_NORMAL);
- }
- }
- else{
- mCanReadMore = true;
- }
- if (!(mViewBody.isShown())) {
- mWnn.setCandidatesViewShown(true);
- }
- mTargetScrollWidth = mViewWidth / 2;
- mViewBodyHScroll.scrollTo(0, 0);
- mIsLockHScroll = false;
- */
mIsActiveTask = false;
}
/**
/** @see android.view.GestureDetector.OnGestureListener#onDown */
public boolean onDown(MotionEvent arg0) {
- checkUpdate1stCandidates(0);
return false;
}
consumed = true;
}
}
- //if (arg0 != null && arg1 != null && arg1.getX() > arg0.getX()) {
- /*
- if (arg2 > 0) {
- checkUpdate1stCandidates(arg2);
- }
- */
return consumed;
}
if (mViewBodyVScroll.getScrollY() != 0) {
mIsScroll = true;
}
- if (MotionEvent.ACTION_MOVE == arg1.getAction()) {
- checkUpdate1stCandidates(arg1.getX() - arg0.getX());
- }
return false;
}
- /*
- *
- */
- private void checkUpdate1stCandidates(float distx) {
- if (true == mIsFullView) {
- return;
- }
- /*
-< if (true == mIsActiveTask) {
- return;
- }
- boolean update = false;
- int size = mWnnWordArray.size();
- int getscroll = mViewBodyHScroll.getScrollX();
- getscroll += (int)distx;
- while ((getscroll >= mTargetScrollWidth) && (m1stWordCount < size)) {
- display1stCandidates(mConverter, mViewWidth);
- mTargetScrollWidth += mViewWidth;
- update = true;
- }
- if (true == update) {
- mViewCandidateList1st.invalidate();
- }
- */
- }
-
/** @see android.view.GestureDetector.OnGestureListener#onShowPress */
public void onShowPress(MotionEvent arg0) {
}