params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
TextView textView = createCandidateView();
- textView.setLayoutParams(params);
+ //textView.setLayoutParams(params);
mViewCandidateList2nd.addView(textView);
mViewCandidateTemplate = textView;
setViewLayout(CandidatesViewManager.VIEW_TYPE_NORMAL);
- //display1stCandidates(converter, mViewWidth * 2);
- display1stCandidates(converter, mViewWidth + (mViewWidth / 2));
- mTargetScrollWidth = mViewWidth / 4;
+ display1stCandidates(converter, mViewWidth * 3);
+ mTargetScrollWidth = mViewWidth / 2;
//if (false == mIsLockHScroll) {
mViewBodyHScroll.scrollTo(0, 0);
/** @see android.view.GestureDetector.OnGestureListener#onDown */
public boolean onDown(MotionEvent arg0) {
+ checkUpdate1stCandidates(0);
return false;
}
}
}
//if (arg0 != null && arg1 != null && arg1.getX() > arg0.getX()) {
+ /*
if (arg2 > 0) {
- checkUpdate1stCandidates();
+ checkUpdate1stCandidates(arg2);
}
+ */
return consumed;
}
if (mViewBodyVScroll.getScrollY() != 0) {
mIsScroll = true;
}
- checkUpdate1stCandidates();
+ if (MotionEvent.ACTION_MOVE == arg1.getAction()) {
+ checkUpdate1stCandidates(arg1.getX() - arg0.getX());
+ }
return false;
}
/*
*
*/
- private void checkUpdate1stCandidates() {
+ private void checkUpdate1stCandidates(float distx) {
if (true == mIsFullView) {
return;
}
boolean update = false;
- int getscroll = mViewBodyHScroll.getScrollX();
- int size = mWnnWordArray.size();
+ int size = mWnnWordArray.size();
+ int getscroll = mViewBodyHScroll.getScrollX();
+ getscroll += (int)distx;
while ((getscroll >= mTargetScrollWidth) && (m1stWordCount < size)) {
display1stCandidates(mConverter, mViewWidth);
mTargetScrollWidth += mViewWidth;
*/
public int measureText(CharSequence text, int start, int end) {
TextPaint paint = mViewCandidateTemplate.getPaint();
- return (int)paint.measureText(text, start, end);
+ int getwidth = (int)paint.measureText(text, start, end);
+ if (CANDIDATE_MINIMUM_WIDTH > getwidth) {
+ getwidth = CANDIDATE_MINIMUM_WIDTH;
+ }
+ return getwidth;
}
/**