本文整理匯總了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;
}
示例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());
}
}
示例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;
}
示例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);
}