本文整理汇总了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;
}