Java Code Examples for android.widget.LinearLayout.removeViewAt()

The following are Jave code examples for showing how to use removeViewAt() of the android.widget.LinearLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: GitHub   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 2
Project: AssistantBySDK   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 3
Project: Hotspot-master-devp   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 4
Project: Hotspot-master-devp   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 5
Project: CoolClock   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 6
Project: mupdf-android-viewer-nui   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 7
Project: iosched-reader   File: CollectionView.java   View Source Code Vote up 6 votes
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;
}
 
Example 8
Project: boohee_v5.6   File: WheelRecycle.java   View Source Code Vote up 6 votes
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;
}
 
Example 9
Project: SlotNSlot_Android   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 10
Project: decoy   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 11
Project: GCSApp   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 12
Project: TripBuyer   File: WheelRecycle.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 13
Project: HutHelper   File: WebViewActivity.java   View Source Code Vote up 5 votes
/**
 * 显示自定义错误提示页面,用一个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;
    }

}
 
Example 14
Project: HutHelper   File: WebViewActivity.java   View Source Code Vote up 5 votes
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);
}