當前位置: 首頁>>代碼示例>>Java>>正文


Java ListView.INVALID_POSITION屬性代碼示例

本文整理匯總了Java中android.widget.ListView.INVALID_POSITION屬性的典型用法代碼示例。如果您正苦於以下問題:Java ListView.INVALID_POSITION屬性的具體用法?Java ListView.INVALID_POSITION怎麽用?Java ListView.INVALID_POSITION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.widget.ListView的用法示例。


在下文中一共展示了ListView.INVALID_POSITION屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCheckedChanged

@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    int pos = listView_friend_list.getPositionForView(buttonView);
    if(pos != ListView.INVALID_POSITION) {
        FriendList friendListBackup = friendLists.get(pos);
        Log.d("STATUS CHANGED", String.valueOf(friendListBackup.getPermissionStatus()));
        if(friendListBackup.getPermissionStatus() == 1) {
            friendListBackup.setPermissionStatus(1);
            Log.d("STATUS CHANGED", String.valueOf(friendListBackup.getPermissionStatus()) + " " + friendListBackup.getName());

        } else {
            friendListBackup.setPermissionStatus(0);
            Log.d("STATUS CHANGED", String.valueOf(friendListBackup.getPermissionStatus()) + " " + friendListBackup.getName());

        }
    }
}
 
開發者ID:Amay-Mishra,項目名稱:Trackr,代碼行數:17,代碼來源:PermissionManagerActivity.java

示例2: selectionChanged

void selectionChanged() {
    if (mOnItemSelectedListener != null) {
        if (mInLayout || mBlockLayoutRequests) {
            // If we are in a layout traversal, defer notification
            // by posting. This ensures that the view tree is
            // in a consistent state and is able to accomodate
            // new layout or invalidate requests.
            if (mSelectionNotifier == null) {
                mSelectionNotifier = new SelectionNotifier();
            }
            post(mSelectionNotifier);
        } else {
            fireOnSelected();
        }
    }

    // we fire selection events here not in View
    if (mSelectedPosition != ListView.INVALID_POSITION && isShown() && !isInTouchMode()) {
        sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:21,代碼來源:IcsAdapterView.java

示例3: onToggleFlag

private void onToggleFlag(Flag flag, int flagColumn) {
    int adapterPosition = getAdapterPositionForSelectedMessage();
    if (adapterPosition == ListView.INVALID_POSITION) {
        return;
    }

    Cursor cursor = (Cursor) adapter.getItem(adapterPosition);
    boolean flagState = (cursor.getInt(flagColumn) == 1);
    setFlag(adapterPosition, flag, !flagState);
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:10,代碼來源:MessageListFragment.java

示例4: sectionedPositionToPosition

public int sectionedPositionToPosition(int sectionedPosition) {
    if (isSectionHeaderPosition(sectionedPosition)) {
        return ListView.INVALID_POSITION;
    }

    int offset = 0;
    for (int i = 0; i < mSections.size(); i++) {
        if (mSections.valueAt(i).sectionedPosition > sectionedPosition) {
            break;
        }
        --offset;
    }
    return sectionedPosition + offset;
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:14,代碼來源:SimpleSectionedListAdapter.java

示例5: resetCell

private void resetCell() {
    if (downPosition != ListView.INVALID_POSITION) {
        if (swipeCurrentAction == SwipeListView.SWIPE_ACTION_CHOICE) {
            backView.setVisibility(View.VISIBLE);
        }
        frontView.setClickable(opened.get(downPosition));
        frontView.setLongClickable(opened.get(downPosition));
        frontView = null;
        backView = null;
        downPosition = ListView.INVALID_POSITION;
    }
}
 
開發者ID:Louis19910615,項目名稱:youkes_browser,代碼行數:12,代碼來源:SwipeListViewTouchListener.java

示例6: onRestoreInstanceState

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    if (mAlwaysUseOption) {
        final int checkedPos = mListView.getCheckedItemPosition();
        final boolean enabled = checkedPos != ListView.INVALID_POSITION;
        mLastSelected = checkedPos;
        mAlwaysButton.setEnabled(enabled);
        mOnceButton.setEnabled(enabled);
        if (enabled) {
            mListView.setSelection(checkedPos);
        }
    }
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:14,代碼來源:ResolverActivity.java

示例7: clearCheckedItem

public void clearCheckedItem() {
    ListView lv = getListView();
    int checkPosition = lv.getCheckedItemPosition();
    if (checkPosition != ListView.INVALID_POSITION) {
        lv.setItemChecked(checkPosition,false);
    }
    mSelectedItemId = 0;
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:8,代碼來源:BrowserCategory.java

示例8: onClickFrontView

/**
 * Notifies onClickFrontView
 *
 * @param position item clicked
 */
protected void onClickFrontView(int position) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        swipeListViewListener.onClickFrontView(position);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:SwipeListView.java

示例9: onClickBackView

/**
 * Notifies onClickBackView
 *
 * @param position back item clicked
 */
protected void onClickBackView(int position) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        swipeListViewListener.onClickBackView(position);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:SwipeListView.java

示例10: changeSwipeMode

protected int changeSwipeMode(int position) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        return swipeListViewListener.onChangeSwipeMode(position);
    }
    return SWIPE_MODE_DEFAULT;
}
 
開發者ID:Louis19910615,項目名稱:youkes_browser,代碼行數:6,代碼來源:SwipeListView.java

示例11: onKey

public boolean onKey(View v, int keyCode, KeyEvent event) {
    // guard against possible race conditions
    if (mSearchable == null) {
        return false;
    }

    if (DBG) {
        Log.d(LOG_TAG, "mTextListener.onKey(" + keyCode + "," + event + "), selection: "
                + mQueryTextView.getListSelection());
    }

    // If a suggestion is selected, handle enter, search key, and action keys
    // as presses on the selected suggestion
    if (mQueryTextView.isPopupShowing()
            && mQueryTextView.getListSelection() != ListView.INVALID_POSITION) {
        return onSuggestionsKey(v, keyCode, event);
    }

    // If there is text in the query box, handle enter, and action keys
    // The search key is handled by the dialog's onKeyDown().
    if (!mQueryTextView.isEmpty() && KeyEventCompat.hasNoModifiers(event)) {
        if (event.getAction() == KeyEvent.ACTION_UP) {
            if (keyCode == KeyEvent.KEYCODE_ENTER) {
                v.cancelLongPress();

                // Launch as a regular search.
                launchQuerySearch(KeyEvent.KEYCODE_UNKNOWN, null, mQueryTextView.getText()
                        .toString());
                return true;
            }
        }
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
            // TODO SearchableInfo.ActionKeyInfo actionKey = mSearchable.findActionKey(keyCode);
            // TODO if ((actionKey != null) && (actionKey.getQueryActionMsg() != null)) {
            // TODO     launchQuerySearch(keyCode, actionKey.getQueryActionMsg(), mQueryTextView
            // TODO             .getText().toString());
            // TODO     return true;
            // TODO }
        }
    }
    return false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:42,代碼來源:SearchView.java

示例12: onOpened

/**
 * Notifies onOpened
 *
 * @param position Item opened
 * @param toRight If should be opened toward the right
 */
protected void onOpened(int position, boolean toRight) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        swipeListViewListener.onOpened(position, toRight);
    }
}
 
開發者ID:Louis19910615,項目名稱:youkes_browser,代碼行數:11,代碼來源:SwipeListView.java

示例13: onStartOpen

/**
 * Start open item
 *
 * @param position list item
 * @param action   current action
 * @param right    to right
 */
protected void onStartOpen(int position, int action, boolean right) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        swipeListViewListener.onStartOpen(position, action, right);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:SwipeListView.java

示例14: onStartClose

/**
 * Start close item
 *
 * @param position list item
 * @param right    na
 */
protected void onStartClose(int position, boolean right) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        swipeListViewListener.onStartClose(position, right);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:SwipeListView.java

示例15: onOpened

/**
 * Notifies onOpened
 *
 * @param position Item opened
 * @param toRight  If should be opened toward the right
 */
protected void onOpened(int position, boolean toRight) {
    if (swipeListViewListener != null && position != ListView.INVALID_POSITION) {
        swipeListViewListener.onOpened(position, toRight);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:SwipeListView.java


注:本文中的android.widget.ListView.INVALID_POSITION屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。