@Override public boolean dispatchUnhandledMove(View focused, int direction) { // XXX-RTL: This will be fixed in a future CL if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); return true; } } return super.dispatchUnhandledMove(focused, direction); }
@Override public boolean dispatchUnhandledMove(View focused, int direction) { // XXX-RTL: This will be fixed in a future CL if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); return true; } } return super.dispatchUnhandledMove(focused, direction); }
@Override public boolean dispatchUnhandledMove(View focused, int direction) { if (super.dispatchUnhandledMove(focused, direction)) { return true; } if (mIsRtl) { if (direction == View.FOCUS_LEFT) { direction = View.FOCUS_RIGHT; } else if (direction == View.FOCUS_RIGHT) { direction = View.FOCUS_LEFT; } } if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); return true; } } return false; }
@Override public boolean dispatchUnhandledMove(View focused, int direction) { if (super.dispatchUnhandledMove(focused, direction)) { return true; } if (mIsRtl) { if (direction == View.FOCUS_LEFT) { direction = View.FOCUS_RIGHT; } else if (direction == View.FOCUS_RIGHT) { direction = View.FOCUS_LEFT; } } if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); return true; } } return false; }
@Override public boolean dispatchUnhandledMove(View focused, int direction) { if (super.dispatchUnhandledMove(focused, direction)) { return true; } if (mIsRtl) { if (direction == View.FOCUS_LEFT) { direction = View.FOCUS_RIGHT; } else if (direction == View.FOCUS_RIGHT) { direction = View.FOCUS_LEFT; } } if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); return true; } } return false; }