當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。