Example usage for android.view ViewGroup getTouchables

List of usage examples for android.view ViewGroup getTouchables

Introduction

In this page you can find the example usage for android.view ViewGroup getTouchables.

Prototype

public ArrayList<View> getTouchables() 

Source Link

Document

Find and return all touchable views that are descendants of this view, possibly including this view if it is touchable itself.

Usage

From source file:com.bradenmacdonald.OverlayedMapFragment.java

@Override
public View onCreateView(android.view.LayoutInflater arg0, ViewGroup arg1, Bundle arg2) {
    ViewGroup baseViewGroup = (ViewGroup) super.onCreateView(arg0, arg1, arg2);
    // Search through the descendants of baseViewGroup to find and fix the SurfaceView:
    java.util.ArrayList<View> touchables = baseViewGroup.getTouchables();
    for (int i = 0; i < touchables.size(); i++) {
        if (touchables.get(i) instanceof android.view.SurfaceView) {
            mSurfaceView = (android.view.SurfaceView) touchables.get(i);
            mSurfaceView.setZOrderMediaOverlay(true);
            mSurfaceView.setVisibility(View.INVISIBLE); // Should be hidden initially
            break;
        }//  www  .j  a  va2 s .  c o  m
    }
    return baseViewGroup;
}