0
在我們的應用程序中,我們使用Android輪轂庫。問題在Galaxy SII上。只有當用戶觸摸它時,輪子纔會工作,將他的手指移到側面(輪子外面),然後向上或向下滾動。有沒有人可以解決這個問題?Samsung Galaxy S2上的Android輪轂ICS
在我們的應用程序中,我們使用Android輪轂庫。問題在Galaxy SII上。只有當用戶觸摸它時,輪子纔會工作,將他的手指移到側面(輪子外面),然後向上或向下滾動。有沒有人可以解決這個問題?Samsung Galaxy S2上的Android輪轂ICS
這是一個kankan android-wheel庫的bug。在611行的WheelView.java中,將switch語句更改爲以下內容:
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: //added to fix problem
case MotionEvent.ACTION_MOVE:
if (getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(true);
}
break;
case MotionEvent.ACTION_UP:
if (getParent() != null) { //added to fix problem, this may be uneeded
getParent().requestDisallowInterceptTouchEvent(false);
}
if (!isScrollingPerformed) {
int distance = (int) event.getY() - getHeight()/2;
if (distance > 0) {
distance += getItemHeight()/2;
} else {
distance -= getItemHeight()/2;
}
int items = distance/getItemHeight();
if (items != 0 && isValidItemIndex(currentItem + items)) {
notifyClickListenersAboutClick(currentItem + items);
}
}
break;
}
Thx,我會嘗試它;) – cecan 2013-02-12 16:56:26