本文整理汇总了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);
}
}