コード例 #1
0
  @Override
  public void onDialogResult(int requestCode, int resultCode, Bundle arguments) {
    if (RESULT_OK != resultCode) return;

    switch (requestCode) {
      case ISSUE_MILESTONE_UPDATE:
        issue.milestone = MilestoneDialogFragment.getSelected(arguments);
        updateMilestone();
        break;
      case ISSUE_ASSIGNEE_UPDATE:
        User assignee = AssigneeDialogFragment.getSelected(arguments);
        if (assignee != null) issue.assignee = assignee;
        else {
          User user = new User();
          user.login = "";
          issue.assignee = user;
        }
        updateAssignee();
        break;
      case ISSUE_LABELS_UPDATE:
        issue.labels = LabelsDialogFragment.getSelected(arguments);
        updateLabels();
        break;
    }
  }
コード例 #2
0
  /**
   * Show dialog with given assignee selected
   *
   * @param selectedAssignee
   */
  public void show(User selectedAssignee) {
    if (collaborators == null) {
      load(selectedAssignee);
      return;
    }

    final ArrayList<User> users = new ArrayList<>(collaborators.values());
    int checked = -1;
    if (selectedAssignee != null)
      for (int i = 0; i < users.size(); i++)
        if (selectedAssignee.login.equals(users.get(i).login)) checked = i;
    AssigneeDialogFragment.show(
        activity, requestCode, activity.getString(R.string.select_assignee), null, users, checked);
  }