當前位置: 首頁>>代碼示例>>Java>>正文


Java ArrayObjectAdapter.size方法代碼示例

本文整理匯總了Java中android.support.v17.leanback.widget.ArrayObjectAdapter.size方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayObjectAdapter.size方法的具體用法?Java ArrayObjectAdapter.size怎麽用?Java ArrayObjectAdapter.size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v17.leanback.widget.ArrayObjectAdapter的用法示例。


在下文中一共展示了ArrayObjectAdapter.size方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSeasonRow

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private ListRow getSeasonRow(String seasonNumber, boolean createNewRow) {
    seasonNumber = TextUtils.isEmpty(seasonNumber) ? "" : seasonNumber;
    ArrayObjectAdapter rowsAdaptor = getRowsAdapter();
    for (int i = rowsAdaptor.size() - 1; i >= 0; i--) {
        Object row = rowsAdaptor.get(i);
        if (row instanceof ListRow) {
            int compareResult = BaseProgram.numberCompare(seasonNumber,
                    ((SeasonRowAdapter) ((ListRow) row).getAdapter()).mSeasonNumber);
            if (compareResult == 0) {
                return (ListRow) row;
            } else if (compareResult < 0) {
                return createNewRow ? createNewSeasonRow(seasonNumber, i + 1) : null;
            }
        }
    }
    return createNewRow ? createNewSeasonRow(seasonNumber, rowsAdaptor.size()) : null;
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:18,代碼來源:SeriesRecordingDetailsFragment.java

示例2: refreshView

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void refreshView() {
	// Refresh the grid without actually reloading it from scratch.
	ArrayObjectAdapter adapter = ((ArrayObjectAdapter) getAdapter());
	if (adapter != null && adapter.size() > 0) {
		adapter.notifyArrayItemRangeChanged(0, adapter.size());
	}
}
 
開發者ID:fasteque,項目名稱:leanback-extensions,代碼行數:8,代碼來源:MainFragment.java

示例3: isEmptyViewRow

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
/**
 * @param adapter
 * @return true if the adapter is an ArrayObjectAdapter containing just one EmptyView object
 */
private boolean isEmptyViewRow(ObjectAdapter adapter) {
    if (adapter instanceof ArrayObjectAdapter) {
        ArrayObjectAdapter arrayObjectAdapter = (ArrayObjectAdapter)adapter;
        if (arrayObjectAdapter.size()==1) {
            if (arrayObjectAdapter.get(0) instanceof EmptyView) {
                return true;
            }
        }
    }
    return false;
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:16,代碼來源:MainFragment.java

示例4: addInAdapterInAlphabeticalOrder

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
/**
 * Bloody ArrayObjectAdapter does not support sort()! (ArrayAdapter does...)
 * Need this f*ck*ng piece of code to do it
 * Non performance issue here since we're never handling a LOT of items
 * @param newObject a NetworkSource instance to add to the adapter
 * @param adapter an adapter containing some NetworkSource objects
 */

private void addInAdapterInAlphabeticalOrder(NetworkSource newObject, ArrayObjectAdapter adapter) {

    for (int i=0; i<adapter.size(); i++) {
        NetworkSource obj = (NetworkSource)adapter.get(i);
        if (newObject.getName().compareToIgnoreCase(obj.getName()) < 0) {
            adapter.add(i, newObject); // insert before this item
            return;
        }
    }

    // Default is to add at the end (either because of the names or because this is the first item)
    adapter.add(newObject);
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:22,代碼來源:NetworkRootFragment.java


注:本文中的android.support.v17.leanback.widget.ArrayObjectAdapter.size方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。