本文整理匯總了Java中android.widget.ListAdapter.areAllItemsEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java ListAdapter.areAllItemsEnabled方法的具體用法?Java ListAdapter.areAllItemsEnabled怎麽用?Java ListAdapter.areAllItemsEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ListAdapter
的用法示例。
在下文中一共展示了ListAdapter.areAllItemsEnabled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: areAllItemsEnabled
import android.widget.ListAdapter; //導入方法依賴的package包/類
/**
* If the wrapped SpinnerAdapter is also a ListAdapter, delegate this call.
* Otherwise, return true.
*/
public boolean areAllItemsEnabled() {
final ListAdapter adapter = mListAdapter;
if (adapter != null) {
return adapter.areAllItemsEnabled();
} else {
return true;
}
}
示例2: lookForSelectablePosition
import android.widget.ListAdapter; //導入方法依賴的package包/類
private int lookForSelectablePosition(int position, boolean lookDown) {
ListAdapter adapter = this.mAdapter;
if (adapter == null || isInTouchMode()) {
return -1;
}
int count = adapter.getCount();
if (!adapter.areAllItemsEnabled()) {
if (lookDown) {
position = Math.max(0, position);
while (position < count && !adapter.isEnabled(position)) {
position++;
}
} else {
position = Math.min(position, count - 1);
while (position >= 0 && !adapter.isEnabled(position)) {
position--;
}
}
if (position < 0 || position >= count) {
return -1;
}
return position;
} else if (position < 0 || position >= count) {
return -1;
} else {
return position;
}
}
示例3: areAllItemsEnabled
import android.widget.ListAdapter; //導入方法依賴的package包/類
public boolean areAllItemsEnabled() {
ListAdapter adapter = this.mListAdapter;
if (adapter != null) {
return adapter.areAllItemsEnabled();
}
return true;
}
示例4: onKeyDown
import android.widget.ListAdapter; //導入方法依賴的package包/類
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (isShowing() && keyCode != 62 && (this.mDropDownList.getSelectedItemPosition() >= 0 || !isConfirmKey(keyCode))) {
boolean below;
int curIndex = this.mDropDownList.getSelectedItemPosition();
if (this.mPopup.isAboveAnchor()) {
below = false;
} else {
below = true;
}
ListAdapter adapter = this.mAdapter;
int firstItem = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
int lastItem = Integer.MIN_VALUE;
if (adapter != null) {
boolean allEnabled = adapter.areAllItemsEnabled();
firstItem = allEnabled ? 0 : this.mDropDownList.lookForSelectablePosition(0, true);
if (allEnabled) {
lastItem = adapter.getCount() - 1;
} else {
lastItem = this.mDropDownList.lookForSelectablePosition(adapter.getCount() - 1, false);
}
}
if (!(below && keyCode == 19 && curIndex <= firstItem) && (below || keyCode != 20 || curIndex < lastItem)) {
this.mDropDownList.mListSelectionHidden = false;
if (this.mDropDownList.onKeyDown(keyCode, event)) {
this.mPopup.setInputMethodMode(2);
this.mDropDownList.requestFocusFromTouch();
show();
switch (keyCode) {
case 19:
case 20:
case 23:
case 66:
return true;
}
} else if (below && keyCode == 20) {
if (curIndex == lastItem) {
return true;
}
} else if (!below && keyCode == 19 && curIndex == firstItem) {
return true;
}
}
clearListSelection();
this.mPopup.setInputMethodMode(1);
show();
return true;
}
return false;
}