Example usage for android.gesture GestureOverlayView setLayoutParams

List of usage examples for android.gesture GestureOverlayView setLayoutParams

Introduction

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

Prototype

public void setLayoutParams(ViewGroup.LayoutParams params) 

Source Link

Document

Set the layout parameters associated with this view.

Usage

From source file:Main.java

/**
 * add GestureOverlayView to an activity
 * @param activity//from   ww w.j a  va  2  s . c  o  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;
}