本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}