android.widget.LinearLayout#removeViewAt ( )源码实例Demo

下面列出了android.widget.LinearLayout#removeViewAt ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: RxTools-master   文件: WheelRecycle.java
/**
 * 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 项目: RxTools-master   文件: WheelRecycler.java
/**
 * 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 spinnerwheel 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 项目: AssistantBySDK   文件: WheelRecycle.java
/**
 * 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;
}
 
源代码4 项目: o2oa   文件: WheelRecycle.java
/**
 * 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 项目: CoolClock   文件: WheelRecycle.java
/**
 * 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;
}
 
源代码6 项目: myapplication   文件: WheelRecycle.java
/**
 * 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;
}
 
源代码7 项目: BigApp_Discuz_Android   文件: WheelRecycle.java
/**
 * 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;
}
 
源代码8 项目: TimePickerDialog   文件: WheelRecycle.java
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range, int currentItem) {
    int index = firstItem;
    for (int i = 0; i < layout.getChildCount(); ) {
        if (!range.contains(index)) {
            recycleView(layout.getChildAt(i), index, currentItem);
            layout.removeViewAt(i);
            if (i == 0) { // first item
                firstItem++;
            }
        } else {
            i++; // go to next item
        }
        index++;
    }
    return firstItem;
}
 
源代码9 项目: MiBandDecompiled   文件: WheelRecycle.java
public int recycleItems(LinearLayout linearlayout, int i, ItemsRange itemsrange)
{
    int j = 0;
    int k = i;
    while (j < linearlayout.getChildCount()) 
    {
        if (!itemsrange.contains(i))
        {
            a(linearlayout.getChildAt(j), i);
            linearlayout.removeViewAt(j);
            if (j == 0)
            {
                k++;
            }
        } else
        {
            j++;
        }
        i++;
    }
    return k;
}
 
源代码10 项目: bither-android   文件: WheelRecycle.java
/**
 * 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;
}
 
源代码11 项目: iSCAU-Android   文件: WheelRecycler.java
/**
 * 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 spinnerwheel 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;
}
 
源代码12 项目: Mupdf   文件: WheelRecycle.java
/**
 * 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;
}
 
源代码13 项目: YCAudioPlayer   文件: WebViewActivity.java
/**
 * 把系统自身请求失败时的网页隐藏
 */
protected void hideErrorPage() {
    LinearLayout webParentView = (LinearLayout) mWebView.getParent();
    mIsErrorPage = false;
    while (webParentView.getChildCount() > 1) {
        webParentView.removeViewAt(0);
    }
}
 
源代码14 项目: BoardView   文件: BoardAdapter.java
public void removeItem(int column, int index){
    BoardItem item = (BoardItem)((ViewGroup)((ViewGroup)boardView.getChildAt(0)).getChildAt(0)).getChildAt(column);
    ScrollView scrollView = (ScrollView)item.getChildAt(1);
    LinearLayout llColumn = (LinearLayout)scrollView.getChildAt(0);
    llColumn.removeViewAt(index);
    llColumn.invalidate();
    columns.get(column).objects.remove(index);
    columns.get(column).views.remove(index);
}
 
源代码15 项目: pandroid   文件: GridListAdapter.java
/**
 * Update a existing view with some column.
 *
 * @param position  Current position of the cell.
 * @param viewGroup Container of the cell.
 * @param layout    Layout saved of the cell.
 */
private void updateItemRow(int position, ViewGroup viewGroup, LinearLayout layout) {
    // we remove view that aren't needed for the row
    while(layout.getChildCount()>rows.get(position).size()){
        layout.removeViewAt(layout.getChildCount()-1);
    }

    for (int i = 0; i < rows.get(position).size(); i++) {
        int currentPos = rows.get(position).indexFirstItem + i;
        View insideView = layout.getChildAt(i);

        View theView = super.getView(currentPos, insideView, viewGroup);

        // Set the width of this column
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.weight = rows.get(position).get(i).colSpan;
        if (i != mNumColumns - 1)// last col
            params.setMargins(0, 0, cellMargin, 0);
        theView.setLayoutParams(params);

        theView.setOnClickListener(new ListItemClickListener(currentPos));
        if (!theView.equals(insideView)) {
            if (layout.getChildCount() > i) {
                layout.removeViewAt(i);
            }
            layout.addView(theView, i);
        }
    }
}
 
源代码16 项目: BreadcrumbToolbar   文件: BreadcrumbScrollView.java
public void removeBreadcrumbItemFrom(int position) {
    LinearLayout linearLayout = (LinearLayout) findViewById(R.id.breadcrumb_scroll_view_inner_layout);

    Log.d(TAG, "[toolbar] removeBreadcrumbItemFrom getChildCount():" + linearLayout.getChildCount() + " position:" + position);
    for (int i = linearLayout.getChildCount(); i > position; i--) {
        Log.d(TAG, "[toolbar] remove i:" + i + " ->" + (i - 1));
        if (linearLayout.getChildAt(i - 1) != null) {
            linearLayout.removeViewAt(i - 1);
        }
    }
}
 
源代码17 项目: v2ex   文件: CollectionView.java
private View recycleItemRow(View convertView, RowComputeResult rowInfo) {
    int i;
    LinearLayout ll = (LinearLayout) convertView;
    for (i = 0; i < rowInfo.group.mDisplayCols; i++) {
        View view = ll.getChildAt(i);
        View newView = getItemView(rowInfo, i, view, ll);
        if (view != newView) {
            LinearLayout.LayoutParams thisViewParams = setupLayoutParams(newView);
            ll.removeViewAt(i);
            ll.addView(newView, i, thisViewParams);
        }
    }
    return ll;
}
 
源代码18 项目: codeexamples-android   文件: DialogActivity.java
public void onClick(View v) {
    LinearLayout layout = (LinearLayout)findViewById(R.id.inner_content);
    int num = layout.getChildCount();
    if (num > 0) {
        layout.removeViewAt(num-1);
    }
}
 
源代码19 项目: BreadcrumbToolbar   文件: BreadcrumbScrollView.java
public void popBreadcrumbItem(int position) {
    LinearLayout linearLayout = (LinearLayout) findViewById(R.id.breadcrumb_scroll_view_inner_layout);
    if (linearLayout.getChildAt(position) != null) {
        linearLayout.removeViewAt(position);
    }
}
 
源代码20 项目: gcm   文件: AbstractElementAdapter.java
protected void removeChild(LinearLayout layout, int position) {
    layout.removeViewAt(position);
}