@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == Activity.RESULT_OK) {
      if (lookUri == null) {
        lookUri = UtilCamera.getDefaultLookFromCameraUri(getString(R.string.default_look_name));
      }

      switch (requestCode) {
        case REQUEST_CREATE_POCKET_PAINT_IMAGE:
          lookUri =
              Uri.parse(data.getExtras().getString(Constants.EXTRA_PICTURE_PATH_POCKET_PAINT));
          break;
        case REQUEST_SELECT_IMAGE:
          lookUri = decodeUri(data.getData());
          newObjectName = new File(lookUri.toString()).getName();
          break;
        case REQUEST_TAKE_PICTURE:
          lookUri =
              UtilCamera.rotatePictureIfNecessary(lookUri, getString(R.string.default_look_name));
          break;
        default:
          return;
      }

      NewSpriteDialog dialog =
          new NewSpriteDialog(
              DialogWizardStep.STEP_2, lookUri, newObjectName, requestedAction, spinnerAdapter);
      dialog.show(getActivity().getSupportFragmentManager(), NewSpriteDialog.DIALOG_FRAGMENT_TAG);
      dismiss();
    }
  }
  static NewSpriteDialog newInstance() {
    NewSpriteDialog newSpriteDialog = new NewSpriteDialog();

    Bundle arguments = new Bundle();
    arguments.putInt(
        ActionAfterFinished.KEY, ActionAfterFinished.ACTION_FORWARD_TO_NEW_OBJECT.ordinal());
    arguments.putInt(DialogWizardStep.KEY, DialogWizardStep.STEP_1.ordinal());
    newSpriteDialog.setArguments(arguments);
    return newSpriteDialog;
  }
Example #3
0
 protected void showNewSpriteDialog() {
   NewSpriteDialog dialog = new NewSpriteDialog(this);
   dialog.show(
       ((ScriptActivity) context).getSupportFragmentManager(),
       NewSpriteDialog.DIALOG_FRAGMENT_TAG);
 }