Example usage for android.view View View

List of usage examples for android.view View View

Introduction

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

Prototype

public View(Context context, @Nullable AttributeSet attrs) 

Source Link

Document

Constructor that is called when inflating a view from XML.

Usage

From source file:org.mythdroid.activities.Guide.java

/**
 * Get a spacer row//from   w ww  . j a v a 2  s . c  o  m
 * @return a spacer TableRow
 */
private TableRow getSpacer() {

    final TableRow row = new TableRow(this, null);
    LayoutParams params = new LayoutParams();
    params.height = 1;
    row.setLayoutParams(params);
    View view = new View(this, null);
    params = new LayoutParams();
    params.height = 1;
    params.width = chanWidth;
    params.column = 0;
    params.span = 1;
    view.setLayoutParams(params);
    row.addView(view);

    for (int i = 1; i < times.length; i++) {
        view = new View(this, null);
        view.setLayoutParams(spacerLayout);
        row.addView(view);
    }

    return row;

}