diff options
author | Philip Flohr <philip.flohr@student.kit.edu> | 2015-11-07 22:30:32 +0100 |
---|---|---|
committer | Philip Flohr <philip.flohr@student.kit.edu> | 2015-11-07 22:30:32 +0100 |
commit | 392c53af586ac73c12b3f75f7b8f9ad888f7035d (patch) | |
tree | 85babc22d1581a05601661b4b2b493a457af7e77 /src/main | |
parent | 8736a4af3ac28ea9993e7d898bcc5007b6e15b24 (diff) |
don't use the imagepicker provided by android-crop
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java index afcbeb7c7..e48e6a1cb 100644 --- a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java @@ -140,7 +140,12 @@ public class PublishProfilePictureActivity extends XmppActivity { @Override public void onClick(View v) { - Crop.pickImage(PublishProfilePictureActivity.this); + Intent attachFileIntent = new Intent(); + attachFileIntent.setType("image/*"); + attachFileIntent.setAction(Intent.ACTION_GET_CONTENT); + Intent chooser = Intent.createChooser(attachFileIntent, + getString(R.string.attach_file)); + startActivityForResult(chooser, REQUEST_CHOOSE_FILE); } }); this.defaultUri = PhoneHelper.getSefliUri(getApplicationContext()); @@ -150,9 +155,12 @@ public class PublishProfilePictureActivity extends XmppActivity { protected void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); - if (resultCode == RESULT_OK && requestCode == Crop.REQUEST_PICK) { - Uri destination = Uri.fromFile(new File(getCacheDir(), "croppedAvatar")); - Crop.of(data.getData(), destination).withMaxSize(Config.AVATAR_SIZE, Config.AVATAR_SIZE).asSquare().start(PublishProfilePictureActivity.this); + if (resultCode == RESULT_OK) { + if (requestCode == REQUEST_CHOOSE_FILE) { + this.avatarUri = data.getData(); + Uri destination = Uri.fromFile(new File(getCacheDir(), "croppedAvatar")); + Crop.of(this.avatarUri, destination).withMaxSize(Config.AVATAR_SIZE, Config.AVATAR_SIZE).asSquare().start(PublishProfilePictureActivity.this); + } } if (requestCode == Crop.REQUEST_CROP) { this.avatarUri = Uri.fromFile(new File(getCacheDir(), "croppedAvatar")); |