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


Java Spinner.INVALID_POSITION属性代码示例

本文整理汇总了Java中android.widget.Spinner.INVALID_POSITION属性的典型用法代码示例。如果您正苦于以下问题:Java Spinner.INVALID_POSITION属性的具体用法?Java Spinner.INVALID_POSITION怎么用?Java Spinner.INVALID_POSITION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.widget.Spinner的用法示例。


在下文中一共展示了Spinner.INVALID_POSITION属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMoveClicked

@OnClick(R.id.btnMove)
public void onMoveClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        return;

    int positionMoveTo = spinnerMoveTo.getSelectedItemPosition();
    if (positionMoveTo == Spinner.INVALID_POSITION)
        return;

    if (position == positionMoveTo) return;

    Object item = items.remove(position);
    items.add(positionMoveTo, item);

    adapter.notifyItemMoved(position, positionMoveTo);
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:17,代码来源:ItemsFragment.java

示例2: onMoveClicked

public void onMoveClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        return;

    int positionMoveTo = spinnerMoveTo.getSelectedItemPosition();
    if (positionMoveTo == Spinner.INVALID_POSITION)
        return;

    if (position == positionMoveTo) return;

    Object item = items.remove(position);
    items.add(positionMoveTo, item);

    adapter.notifyItemMoved(position, positionMoveTo);
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:16,代码来源:TestActivity.java

示例3: onRevertClicked

@OnClick(R.id.btnRevert)
public void onRevertClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        return;

    int positionMoveTo = spinnerMoveTo.getSelectedItemPosition();
    if (positionMoveTo == Spinner.INVALID_POSITION)
        return;

    if (position == positionMoveTo) return;

    spinnerPosition.setSelection(positionMoveTo);
    spinnerMoveTo.setSelection(position);
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:15,代码来源:ItemsFragment.java

示例4: onDeleteClicked

@OnClick(R.id.btnDelete)
public void onDeleteClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        return;
    items.remove(position);
    Log.i("activity", "delete at " + position);
    adapter.notifyItemRemoved(position);
    updateSpinners();
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:10,代码来源:ItemsFragment.java

示例5: onInsertClicked

@OnClick(R.id.btnInsert)
public void onInsertClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        position = 0;
    items.add(position, itemsFactory.createOneItemForPosition(position));
    Log.i("activity", "insert at " + position);
    adapter.notifyItemInserted(position);
    updateSpinners();
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:10,代码来源:ItemsFragment.java

示例6: onRevertClicked

public void onRevertClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        return;

    int positionMoveTo = spinnerMoveTo.getSelectedItemPosition();
    if (positionMoveTo == Spinner.INVALID_POSITION)
        return;

    if (position == positionMoveTo) return;

    spinnerPosition.setSelection(positionMoveTo);
    spinnerMoveTo.setSelection(position);
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:14,代码来源:TestActivity.java

示例7: onDeleteClicked

public void onDeleteClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        return;
    items.remove(position);
    Log.i("activity", "delete at " + position);
    adapter.notifyItemRemoved(position);
    updateSpinners();
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:9,代码来源:TestActivity.java

示例8: onInsertClicked

public void onInsertClicked(View view) {
    int position = spinnerPosition.getSelectedItemPosition();
    if (position == Spinner.INVALID_POSITION)
        position = 0;
    items.add(position, itemsFactory.createOneItemForPosition(position));
    Log.i("activity", "insert at " + position);
    adapter.notifyItemInserted(position);
    updateSpinners();
}
 
开发者ID:sathishmscict,项目名称:ChipsLayoutManager,代码行数:9,代码来源:TestActivity.java

示例9: onFieldsChanged

@OnItemSelected(R.id.credential_authority)
@OnTextChanged({R.id.credential_id, R.id.credential_password})
void onFieldsChanged() {
    boolean validCredential =
            mCredentialAuthority.getSelectedItemPosition() != Spinner.INVALID_POSITION
            && mCredentialId.length() >= MIN_ID_LENGTH
            && mCredentialPassword.length() >= MIN_PASS_LENGTH;

    if (mDoneButton != null) {
        mDoneButton.setEnabled(validCredential);
    }
}
 
开发者ID:openid,项目名称:OpenYOLO-Android,代码行数:12,代码来源:CreateCredentialActivity.java


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