diff options
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 05f0a0553..786822c49 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -1238,15 +1238,24 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc public void addFocusables(ArrayList<View> views, int direction, int focusableMode) { // XXX-RTL: This will be fixed in a future CL if (mCurrentPage >= 0 && mCurrentPage < getPageCount()) { - getPageAt(mCurrentPage).addFocusables(views, direction, focusableMode); + View page = getPageAt(mCurrentPage); + if (page != null) { + page.addFocusables(views, direction, focusableMode); + } } if (direction == View.FOCUS_LEFT) { if (mCurrentPage > 0) { - getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode); + View page = getPageAt(mCurrentPage - 1); + if (page != null) { + page.addFocusables(views, direction, focusableMode); + } } } else if (direction == View.FOCUS_RIGHT){ if (mCurrentPage < getPageCount() - 1) { - getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode); + View page = getPageAt(mCurrentPage + 1); + if (page != null) { + page.addFocusables(views, direction, focusableMode); + } } } } |