Example usage for android.view ViewParent getParent

List of usage examples for android.view ViewParent getParent

Introduction

In this page you can find the example usage for android.view ViewParent getParent.

Prototype

public ViewParent getParent();

Source Link

Document

Returns the parent if it exists, or null.

Usage

From source file:com.appunite.list.HorizontalListView.java

/**
 * @param focusedView the view that has accessibility focus.
 * @return the direct child that contains accessibility focus.
 *//*from w ww. j a va  2  s  .co  m*/
private View findAccessibilityFocusedChild(View focusedView) {
    ViewParent viewParent = focusedView.getParent();
    while ((viewParent instanceof View) && (viewParent != this)) {
        focusedView = (View) viewParent;
        viewParent = viewParent.getParent();
    }
    if (!(viewParent instanceof View)) {
        return null;
    }
    return focusedView;
}

From source file:com.awrtechnologies.carbudgetsales.hlistview.widget.HListView.java

/**
 * @param focusedView//  w  w  w .j  a va  2s .c om
 *           the view that has accessibility focus.
 * @return the direct child that contains accessibility focus.
 */
@SuppressWarnings("unused")
private View findAccessibilityFocusedChild(View focusedView) {
    ViewParent viewParent = focusedView.getParent();
    while ((viewParent instanceof View) && (viewParent != this)) {
        focusedView = (View) viewParent;
        viewParent = viewParent.getParent();
    }
    if (!(viewParent instanceof View)) {
        return null;
    }
    return focusedView;
}