Java Code Examples for android.widget.TableLayout#setTag()

The following examples show how to use android.widget.TableLayout#setTag() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CharadesResultsAdapter.java    From gdk-charades-sample with Apache License 2.0 6 votes vote down vote up
/**
 * Inflates and returns a tabular layout that can hold five phrases.
 * <p>
 * This method only inflates the views and sets the tag of the root view to be an array of
 * {@link PhraseViewHolder} objects. The caller should pass this view, or a recycled view if
 * it has one, to {@link #updatePhraseListView(View,int)} in order to populate it with data.
 */
private View inflatePhraseListView(ViewGroup parent) {
    TableLayout table =
            (TableLayout) mLayoutInflater.inflate(R.layout.card_results_phrase_list, parent);

    // Add five phrases to the card, or fewer if it is the last card and the total number of
    // phrases is not an even multiple of PHRASES_PER_CARD.
    PhraseViewHolder[] holders = new PhraseViewHolder[PHRASES_PER_CARD];
    for (int i = 0; i < PHRASES_PER_CARD; i++) {
        TableRow row = (TableRow) mLayoutInflater.inflate(R.layout.table_row_result, null);
        table.addView(row);

        PhraseViewHolder holder = new PhraseViewHolder();
        holder.imageView = (ImageView) row.findViewById(R.id.image);
        holder.phraseView = (TextView) row.findViewById(R.id.phrase);
        holders[i] = holder;
    }
    table.setTag(holders);
    return table;
}
 
Example 2
Source File: ListItemExtensions.java    From Android-WYSIWYG-Editor with Apache License 2.0 5 votes vote down vote up
public TableLayout insertList(int Index, boolean isOrdered, String text) {

        TableLayout table = createTable();
        editorCore.getParentView().addView(table, Index);
        table.setTag(editorCore.createTag(isOrdered ? EditorType.ol : EditorType.ul));
        addListItem(table, isOrdered, text);
        return table;
    }
 
Example 3
Source File: ListItemExtensions.java    From Android-WYSIWYG-Editor with Apache License 2.0 5 votes vote down vote up
public void convertListToOrdered(TableLayout _table) {
    EditorControl type = editorCore.createTag(EditorType.ol);
    _table.setTag(type);
    for (int i = 0; i < _table.getChildCount(); i++) {
        View _childRow = _table.getChildAt(i);
        CustomEditText editText = (CustomEditText) _childRow.findViewById(R.id.txtText);
        editText.setTag(editorCore.createTag(EditorType.OL_LI));
        _childRow.setTag(editorCore.createTag(EditorType.OL_LI));
        TextView _bullet = (TextView) _childRow.findViewById(R.id.lblOrder);
        _bullet.setText(String.valueOf(i + 1) + ".");
    }
}
 
Example 4
Source File: ListItemExtensions.java    From Android-WYSIWYG-Editor with Apache License 2.0 5 votes vote down vote up
public void convertListToUnordered(TableLayout _table) {
    EditorControl type = editorCore.createTag(EditorType.ul);
    _table.setTag(type);
    for (int i = 0; i < _table.getChildCount(); i++) {
        View _childRow = _table.getChildAt(i);
        CustomEditText _EditText = (CustomEditText) _childRow.findViewById(R.id.txtText);
        _EditText.setTag(editorCore.createTag(EditorType.UL_LI));
        _childRow.setTag(editorCore.createTag(EditorType.UL_LI));
        TextView _bullet = (TextView) _childRow.findViewById(R.id.lblOrder);
        _bullet.setText("•");
    }
}