當前位置: 首頁>>代碼示例>>Java>>正文


Java TableLayout.removeView方法代碼示例

本文整理匯總了Java中android.widget.TableLayout.removeView方法的典型用法代碼示例。如果您正苦於以下問題:Java TableLayout.removeView方法的具體用法?Java TableLayout.removeView怎麽用?Java TableLayout.removeView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.TableLayout的用法示例。


在下文中一共展示了TableLayout.removeView方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ConvertListToNormalText

import android.widget.TableLayout; //導入方法依賴的package包/類
public void ConvertListToNormalText(TableLayout _table, int startIndex) {
    int tableChildCount = _table.getChildCount();
    for (int i = startIndex; i < tableChildCount; i++) {
        View _childRow = _table.getChildAt(i);
        _table.removeView(_childRow);
        String text = getTextFromListItem(_childRow);
        int Index = editorCore.getParentView().indexOfChild(_table);
        editorCore.getInputExtensions().insertEditText(Index + 1, "", text);
        i -= 1;
        tableChildCount -= 1;
    }
    //if item is the last in the table, remove the table from parent

    if (_table.getChildCount() == 0) {
        editorCore.getParentView().removeView(_table);
    }
}
 
開發者ID:irshuLx,項目名稱:Android-WYSIWYG-Editor,代碼行數:18,代碼來源:ListItemExtensions.java

示例2: validateAndRemoveLisNode

import android.widget.TableLayout; //導入方法依賴的package包/類
public void validateAndRemoveLisNode(View view, EditorControl contentType) {
    /*
     *
     * If the person was on an active ul|li, move him to the previous node
     *
     */
    TableRow _row = (TableRow) view.getParent();
    TableLayout _table = (TableLayout) _row.getParent();
    int indexOnList = _table.indexOfChild(_row);
    _table.removeView(_row);
    if (indexOnList > 0) {
        /**
         * check if the index of the deleted row is <0, if so, move the focus to the previous li
         */
        TableRow focusrow = (TableRow) _table.getChildAt(indexOnList - 1);
        EditText text = (EditText) focusrow.findViewById(R.id.txtText);
        /**
         * Rearrange the nodes
         */
        if (contentType.Type == EditorType.OL_LI) {
            rearrangeColumns(_table);
        }
        if (text.requestFocus()) {
            text.setSelection(text.getText().length());
        }
    } else {
        /**
         * The removed row was first on the list. delete the list, and set the focus to previous element on the editor
         */
        editorCore.removeParent(_table);
    }
}
 
開發者ID:irshuLx,項目名稱:Android-WYSIWYG-Editor,代碼行數:33,代碼來源:ListItemExtensions.java

示例3: populateExtras

import android.widget.TableLayout; //導入方法依賴的package包/類
/**
 * Populates the table of extra fields.
 *
 * @param data A LinkedHashMap containing the extra values
 */
protected void populateExtras(@NonNull LinkedHashMap<String, ExtraFieldHolder> data) {
    final Activity activity = getActivity();
    if(activity == null) {
        return;
    }

    final TableLayout table = activity.findViewById(R.id.entry_info);
    if(!mExtraRows.isEmpty()) {
        for(View tableRow : mExtraRows) {
            table.removeView(tableRow);
        }
        mExtraRows.clear();
    }
    if(data.size() > 0) {
        final LayoutInflater inflater = LayoutInflater.from(activity);
        for(ExtraFieldHolder extra : data.values()) {
            if(extra.preset) {
                continue;
            }
            final View root = inflater.inflate(R.layout.view_info_extra, table, false);
            ((TextView)root.findViewById(R.id.label))
                    .setText(getString(R.string.label_field, extra.name));
            ((TextView)root.findViewById(R.id.value)).setText(extra.value);
            table.addView(root);
            mExtraRows.add(root);
        }
    }
}
 
開發者ID:ultramega,項目名稱:flavordex,代碼行數:34,代碼來源:ViewInfoFragment.java


注:本文中的android.widget.TableLayout.removeView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。