Fix 3165989: Items dragged from All Apps don't appear

This commit is contained in:
Patrick Dubroy committed 2010-11-09 15:23:44 -08:00
1 parent 448b0b5e86
commit 72e0d34fc5
1 file changed
+6 -2
+6 -2
View File
@@ -248,8 +248,12 @@ public abstract class PagedView extends ViewGroup {
* Sets the current page.
*/
void setCurrentPage(int currentPage) {
if (!mScroller.isFinished()) mScroller.abortAnimation();
if (getChildCount() == 0) return;
if (!mScroller.isFinished()) {
mScroller.abortAnimation();
}
if (getChildCount() == 0 || currentPage == mCurrentPage) {
return;
}
mCurrentPage = Math.max(0, Math.min(currentPage, getPageCount() - 1));
int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);