当前位置: 首页>>代码示例>>Java>>正文


Java LinearLayout.removeViewAt方法代码示例

本文整理汇总了Java中android.widget.LinearLayout.removeViewAt方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayout.removeViewAt方法的具体用法?Java LinearLayout.removeViewAt怎么用?Java LinearLayout.removeViewAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.LinearLayout的用法示例。


在下文中一共展示了LinearLayout.removeViewAt方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: recycleItems

import android.widget.LinearLayout; //导入方法依赖的package包/类
/**
 * Recycles items from specified layout.
 * There are saved only items not included to specified range.
 * All the cached items are removed from original layout.
 * 
 * @param layout the layout containing items to be cached
 * @param firstItem the number of first item in layout
 * @param range the range of current wheel items 
 * @return the new value of first item number
 */
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
	int index = firstItem;
	for (int i = 0; i < layout.getChildCount();) {
		if (!range.contains(index)) {
			recycleView(layout.getChildAt(i), index);
			layout.removeViewAt(i);
			if (i == 0) { // first item
				firstItem++;
			}
		} else {
			i++; // go to next item
		}
		index++;
	}
	return firstItem;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:WheelRecycle.java

示例2: recycleItems

import android.widget.LinearLayout; //导入方法依赖的package包/类
/**
 * Recycles items from specified layout. There are saved only items not
 * included to specified range. All the cached items are removed from
 * original layout.
 * 
 * @param layout
 *            the layout containing items to be cached
 * @param firstItem
 *            the number of first item in layout
 * @param range
 *            the range of current wheel items
 * @return the new value of first item number
 */
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
	int index = firstItem;
	for (int i = 0; i < layout.getChildCount();) {
		if (!range.contains(index)) {
			recycleView(layout.getChildAt(i), index);
			layout.removeViewAt(i);
			if (i == 0) { // first item
				firstItem++;
			}
		} else {
			i++; // go to next item
		}
		index++;
	}
	return firstItem;
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:30,代码来源:WheelRecycle.java

示例3: recycleItems

import android.widget.LinearLayout; //导入方法依赖的package包/类
/**
 * Recycles items from specified layout.
 * There are saved only items not included to specified range.
 * All the cached items are removed from original layout.
 * 
 * @param layout the layout containing items to be cached
 * @param firstItem the number of first item in layout
 * @param range the range of current wheel items 
 * @return the new value of first item number
 */
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
	int index = firstItem;
	for (int i = 0; i < layout.getChildCount();) {
		if (!range.contains(index)) {
			recycleView(layout.getChildAt(i), index);
			layout.removeViewAt(i);
			if (i == 0) { // first item
				firstItem++;
			}
		} else {
			i++;
		}
		index++;
	}
	return firstItem;
}
 
开发者ID:socoolby,项目名称:CoolClock,代码行数:27,代码来源:WheelRecycle.java

示例4: recycleItems

import android.widget.LinearLayout; //导入方法依赖的package包/类
/**
 * Recycles items from specified layout.
 * There are saved only items not included to specified range.
 * All the cached items are removed from original layout.
 *
 * @param layout the layout containing items to be cached
 * @param firstItem the number of first item in layout
 * @param range the range of current wheel items
 * @return the new value of first item number
 */
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
	int index = firstItem;
	for (int i = 0; i < layout.getChildCount();) {
		if (!range.contains(index)) {
			recycleView(layout.getChildAt(i), index);
			layout.removeViewAt(i);
			if (i == 0) { // first item
				firstItem++;
			}
		} else {
			i++; // go to next item
		}
		index++;
	}
	return firstItem;
}
 
开发者ID:ArtifexSoftware,项目名称:mupdf-android-viewer-nui,代码行数:27,代码来源:WheelRecycle.java

示例5: recycleItemRow

import android.widget.LinearLayout; //导入方法依赖的package包/类
private View recycleItemRow(View convertView, RowComputeResult rowInfo) {
    LinearLayout ll = (LinearLayout) convertView;
    int nbColumns = rowInfo.group.mDisplayCols;
    if (hasCustomGroupView()) {
        nbColumns = 1;
    }
    for (int i = 0; i < nbColumns; i++) {
        View view = ll.getChildAt(i);
        View newView = getItemView(rowInfo, i, view, ll);
        if (view != newView) {
            setupLayoutParams(newView);
            ll.removeViewAt(i);
            ll.addView(newView, i);
        }
    }
    return ll;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:18,代码来源:CollectionView.java

示例6: recycleItems

import android.widget.LinearLayout; //导入方法依赖的package包/类
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
    int index = firstItem;
    int i = 0;
    while (i < layout.getChildCount()) {
        if (range.contains(index)) {
            i++;
        } else {
            recycleView(layout.getChildAt(i), index);
            layout.removeViewAt(i);
            if (i == 0) {
                firstItem++;
            }
        }
        index++;
    }
    return firstItem;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:WheelRecycle.java

示例7: showErrorPage

import android.widget.LinearLayout; //导入方法依赖的package包/类
/**
 * 显示自定义错误提示页面,用一个View覆盖在WebView
 */
protected void showErrorPage() {
    LinearLayout webParentView = (LinearLayout) webView.getParent();
    if (webParentView != null) {
        initErrorPage();
        while (webParentView.getChildCount() > 1) {
            webParentView.removeViewAt(1);
        }
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
        webParentView.addView(mErrorView, 1, lp);
        mIsErrorPage = true;
    }

}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:17,代码来源:WebViewActivity.java

示例8: hideErrorPage

import android.widget.LinearLayout; //导入方法依赖的package包/类
protected void hideErrorPage() {
    LinearLayout webParentView = (LinearLayout) mErrorView.getParent();

    mIsErrorPage = false;
    while (webParentView.getChildCount() > 1) {
        webParentView.removeViewAt(1);
    }
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
    webParentView.addView(webView, 1, lp);
}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:11,代码来源:WebViewActivity.java


注:本文中的android.widget.LinearLayout.removeViewAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。