当前位置: 首页>>代码示例>>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;未经允许,请勿转载。