当前位置: 首页>>代码示例>>Java>>正文


Java ListAdapter.areAllItemsEnabled方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:IcsSpinner.java

示例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;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:29,代码来源:HorizontalListViewPosition.java

示例3: areAllItemsEnabled

import android.widget.ListAdapter; //导入方法依赖的package包/类
public boolean areAllItemsEnabled() {
    ListAdapter adapter = this.mListAdapter;
    if (adapter != null) {
        return adapter.areAllItemsEnabled();
    }
    return true;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:AppCompatSpinner.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:50,代码来源:ListPopupWindow.java


注:本文中的android.widget.ListAdapter.areAllItemsEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。