コード例 #1
0
ファイル: MQuery.java プロジェクト: georgeyang1024/mquery
 public MQuery setSelection(int position) {
   if (view instanceof AdapterView) {
     AdapterView<?> alv = (AdapterView<?>) view;
     alv.setSelection(position);
   }
   return this;
 }
  @Override
  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
    parent.setSelection(pos);

    insuranceProvider = insuranceProviders.get(pos);

    int lastPos = indexOfUserInsuranceProvider();
    if (lastPos != pos) isDataChanged = true;
  }
コード例 #3
0
ファイル: MainAct.java プロジェクト: Emmat91/RoboCatApp
    /**
     * This function is called when an item in the command dropdown is selected. If the Manual
     * command is selected this function opens up a dialog for the user to enter the values to send
     * to the cat. Other wise it sends the command to the cat and updates the command display.
     *
     * @param parent - the AdapterView of the command dropdown.
     * @param view - the View of the spinner widget.
     * @param pos - the position in the array of selectable items that was accepted.
     * @param id - the id of the command dropdown
     */
    public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
      String command = parent.getItemAtPosition(pos).toString();

      if (command.equals("Manual")) {
        enterManualCommand();
      } else if (!command.equals("Select Command")) {
        Control.sendCommand(command);
        updateOutput();
      }

      parent.setSelection(0);
    }
コード例 #4
0
    public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {

      // Match event selection.
      eventTime = currTime;

      if (pos != 0) {
        eventType = parent.getItemAtPosition(pos).toString();
        if (getString(R.string.event_substitution).equals(eventType)
            || getString(R.string.event_blackcard).equals(eventType)) {
          twoPlayerEventDG.show();
        } else {
          onePlayerEventDG.show();
        }
      }

      // Set selection to none.
      parent.setSelection(0);
    }
コード例 #5
0
 public void selectItemWithText(String s) {
   int itemIndex = findIndexOfItemContainingText(s);
   realAdapterView.setSelection(itemIndex);
 }