Пример #1
0
  @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();
    }
  }
Пример #2
0
 protected void showNewSpriteDialog() {
   NewSpriteDialog dialog = new NewSpriteDialog(this);
   dialog.show(
       ((ScriptActivity) context).getSupportFragmentManager(),
       NewSpriteDialog.DIALOG_FRAGMENT_TAG);
 }