private void cycleFocusWithinLevel(boolean next) {
        List<View> focusableViews = getFocusableSiblings();
        if (!focusableViews.isEmpty()) {
            int newFocusIndex = focusIndex + (next ? 1 : -1);
            int max = focusableViews.size();
            if (newFocusIndex < 0) {
                newFocusIndex = max - 1;
            } else if (newFocusIndex >= max) {
                newFocusIndex = 0;
            }
            if (newFocusIndex != focusIndex) {
                if (!focusableViews.get(newFocusIndex).equals(focusedView)) {
                    focusIndex = newFocusIndex;
                }
                setFocus(focusableViews.get(focusIndex), false);
            }
        }
    }