本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
}