当前位置: 首页>>代码示例>>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;未经允许,请勿转载。