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