當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。