Example usage for android.gesture GestureOverlayView getChildAt

List of usage examples for android.gesture GestureOverlayView getChildAt

Introduction

In this page you can find the example usage for android.gesture GestureOverlayView getChildAt.

Prototype

public View getChildAt(int index) 

Source Link

Document

Returns the view at the specified position in the group.

Usage

From source file:Main.java

/**
 * add GestureOverlayView to an activity
 * @param activity//  w  w w  .ja v  a2 s.  co  m
 * @return added GestureOverlayView
 */
public static GestureOverlayView addGestureViewToActivity(Activity activity) {
    View contentView = getContentView(activity);
    GestureOverlayView view = new GestureOverlayView(activity);
    view.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT, 1));

    activity.setContentView(view);
    view.addView(contentView); // adds the PhoneGap browser
    view.getChildAt(0).setLayoutParams(new FrameLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.MATCH_PARENT, 1));

    activity.setContentView(view);
    view.setGestureVisible(false);

    return view;
}