Search in sources :

Example 26 with TableRow

use of android.widget.TableRow in project platform_frameworks_base by android.

the class AddColumnTest method testWidths.

@MediumTest
public void testWidths() throws Exception {
    sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
    getInstrumentation().waitForIdleSync();
    TableRow row1 = (TableRow) mTable.getChildAt(0);
    TableRow row2 = (TableRow) mTable.getChildAt(1);
    assertTrue(row1.getChildCount() < row2.getChildCount());
    for (int i = 0; i < row1.getChildCount(); i++) {
        assertEquals(row2.getChildAt(i).getWidth(), row1.getChildAt(i).getWidth());
    }
}
Also used : TableRow(android.widget.TableRow) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 27 with TableRow

use of android.widget.TableRow in project android-gps-test-tool by Esri.

the class GPSTesterActivityController method setOnClickListeners.

private void setOnClickListeners() {
    TableRow cachedNetworkProvider = (TableRow) _activity.findViewById(R.id.cachedNetworkProviderTableRow);
    cachedNetworkProvider.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (_map.isLoaded() == true && _cachedNetworkLatitude != 0.0) {
                centerAndZoom(_cachedGPSLatitude, _cachedGPSLongitude);
            }
        }
    });
    TableRow cachedGPSProvider = (TableRow) _activity.findViewById(R.id.cachedGPSTableRow);
    cachedGPSProvider.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (_map.isLoaded() == true && _cachedGPSLatitude != 0.0) {
                centerAndZoom(_cachedGPSLatitude, _cachedGPSLongitude);
            }
        }
    });
    TableRow networkProvider = (TableRow) _activity.findViewById(R.id.networkLocationProviderTableRow);
    networkProvider.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (_map.isLoaded() == true && _networkLatitude != 0.0) {
                centerAndZoom(_cachedGPSLatitude, _cachedGPSLongitude);
            }
        }
    });
    TableRow gpsProvider = (TableRow) _activity.findViewById(R.id.gpsLocationProviderTableRow);
    gpsProvider.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (_map.isLoaded() == true && _gpsLatitude != 0.0) {
                centerAndZoom(_cachedGPSLatitude, _cachedGPSLongitude);
            }
        }
    });
    //		_pauseButton.setBackgroundColor(Color.LTGRAY);
    _pauseButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            pauseLocation();
        }
    });
    _startButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (_locationManager == null) {
                startLocation();
            } else {
                stopLocation();
            }
        }
    });
}
Also used : TableRow(android.widget.TableRow) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) MapView(com.esri.android.map.MapView)

Example 28 with TableRow

use of android.widget.TableRow in project android_frameworks_base by AOSPA.

the class AddColumn method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.add_column_in_table);
    final Button addRowButton = (Button) findViewById(R.id.add_row_button);
    addRowButton.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            final TableLayout table = (TableLayout) findViewById(R.id.table);
            final TableRow newRow = new TableRow(AddColumn.this);
            for (int i = 0; i < 4; i++) {
                final TextView view = new TextView(AddColumn.this);
                view.setText("Column " + (i + 1));
                view.setPadding(3, 3, 3, 3);
                newRow.addView(view, new TableRow.LayoutParams());
            }
            table.addView(newRow, new TableLayout.LayoutParams());
            newRow.requestLayout();
        }
    });
}
Also used : Button(android.widget.Button) TableRow(android.widget.TableRow) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) TableLayout(android.widget.TableLayout)

Example 29 with TableRow

use of android.widget.TableRow in project KISS by Neamar.

the class ColorPickerPalette method drawPalette.

/**
     * Adds swatches to table in a serpentine format.
     */
public void drawPalette(int[] colors, int selectedColor, String[] colorContentDescriptions) {
    if (colors == null) {
        return;
    }
    this.removeAllViews();
    int tableElements = 0;
    int rowElements = 0;
    int rowNumber = 0;
    // Fills the table with swatches based on the array of colors.
    TableRow row = createTableRow();
    for (int color : colors) {
        View colorSwatch = createColorSwatch(color, selectedColor);
        setSwatchDescription(rowNumber, tableElements, rowElements, color == selectedColor, colorSwatch, colorContentDescriptions);
        addSwatchToRow(row, colorSwatch, rowNumber);
        tableElements++;
        rowElements++;
        if (rowElements == mNumColumns) {
            addView(row);
            row = createTableRow();
            rowElements = 0;
            rowNumber++;
        }
    }
    // Create blank views to fill the row if the last row has not been filled.
    if (rowElements > 0) {
        while (rowElements != mNumColumns) {
            addSwatchToRow(row, createBlankSpace(), rowNumber);
            rowElements++;
        }
        addView(row);
    }
}
Also used : TableRow(android.widget.TableRow) ImageView(android.widget.ImageView) View(android.view.View)

Example 30 with TableRow

use of android.widget.TableRow in project KISS by Neamar.

the class ColorPickerPalette method createTableRow.

private TableRow createTableRow() {
    TableRow row = new TableRow(getContext());
    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    row.setLayoutParams(params);
    return row;
}
Also used : ViewGroup(android.view.ViewGroup) TableRow(android.widget.TableRow)

Aggregations

TableRow (android.widget.TableRow)43 TextView (android.widget.TextView)25 View (android.view.View)21 TableLayout (android.widget.TableLayout)14 Button (android.widget.Button)8 ImageView (android.widget.ImageView)8 CPU (brunonova.drmips.simulator.CPU)7 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 ViewGroup (android.view.ViewGroup)4 Question (org.eyeseetea.malariacare.data.database.model.Question)4 SuppressLint (android.annotation.SuppressLint)3 ListView (android.widget.ListView)3 ScrollView (android.widget.ScrollView)3 Option (org.eyeseetea.malariacare.data.database.model.Option)3 AOptionQuestionView (org.eyeseetea.malariacare.views.question.AOptionQuestionView)3 IImageQuestionView (org.eyeseetea.malariacare.views.question.IImageQuestionView)3 IMultiQuestionView (org.eyeseetea.malariacare.views.question.IMultiQuestionView)3 IQuestionView (org.eyeseetea.malariacare.views.question.IQuestionView)3 NumberRadioButtonMultiquestionView (org.eyeseetea.malariacare.views.question.multiquestion.NumberRadioButtonMultiquestionView)3 DynamicStockImageRadioButtonSingleQuestionView (org.eyeseetea.malariacare.views.question.singlequestion.DynamicStockImageRadioButtonSingleQuestionView)3