-
-
Save RedLann/bfaffc06eb0f571234c6e46b697d633b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public View focusSearch(View focused, int direction) { | |
switch (direction) { | |
case FOCUS_DOWN: | |
if (mContainer.hasFocus()) | |
return focused; | |
else if (mTopMenu.hasFocus()) { | |
mLastFocused = mContainer; | |
return mContainer; | |
} else | |
return null; | |
case FOCUS_UP: | |
if (mContainer.hasFocus()) { | |
mLastFocused = mTopMenu; | |
return mTopMenu; | |
} | |
return null; | |
case FOCUS_RIGHT: | |
case FOCUS_LEFT: | |
return focused; | |
default: | |
return super.focusSearch(focused, direction); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is the
mContainer
? Let's say I have created a customLinearLayout
as parent in which I will add this code. And the recycleView would be child of the CustomLinearLayout