RocketChat / Rocket.Chat.Android

Legacy mobile Rocket.Chat client in Kotlin for Android
https://rocket.chat
MIT License
869 stars 555 forks source link

[NEW] Update user avatar #752

Closed philipbrito closed 6 years ago

philipbrito commented 6 years ago

From the profile view, allow to the user change its avatar picture. The idea is simple: have a action to open the Storage Access Framework (only - obvious - for images) and call the client.setAvatar(file: File, mimeType: String)

Tip: see the existing upload file feature.

aniketsingh03 commented 6 years ago

@filipedelimabrito ,I'll work on this one.

philipbrito commented 6 years ago

Nice @aniketsingh03! It is your issue :)

aniketsingh03 commented 6 years ago

@filipedelimabrito , is it convenient to add image cropping feature as well? I'll be using this library for the same.

saketkumar commented 6 years ago

is it convenient to add image cropping feature as well?

@aniketsingh03 You mean cropping the avatar before uploading it?

Also Can you search for some other library with better performance and memory usage?

Rish02Sharma commented 6 years ago

@aniketsingh03 You can use this library instead : https://github.com/avito-tech/krop

philipbrito commented 6 years ago

@aniketsingh03 That's a great idea, but you can solve this issue without it and we can create another issue with that image cropping feature - for the avatar (in that way, you can also work in this issue or leave it for someone else).

Thanks @saketkumar95 for remembering about always searching for a better performance and memory usage library - it is important to have an awesome Rocket.Chat Android app client. :)

@aniketsingh03 What do you think? Could someone here work on image cropping feature?

aniketsingh03 commented 6 years ago

Yeah, that's absolutely fine @filipedelimabrito . I'll try to implement this one without the cropping feature. An issue regarding the cropping feature can be opened separately :smiley:

philipbrito commented 6 years ago

Thank you @aniketsingh03 !!! Just created that issue: https://github.com/RocketChat/Rocket.Chat.Android/issues/756

aniketsingh03 commented 6 years ago

@filipedelimabrito shall I add a choice to choose image from camera or from internal storage?

philipbrito commented 6 years ago

It'll be great if the user have the possibility to get the picture from the gallery or instantly from the camera :)

Rish02Sharma commented 6 years ago

@aniketsingh03 Just to let you know, Try focusing more on the corner cases like how the app will respond when the image uploads fails or network fails while uploading the image. Also a progress bar to show the uploading details to the user.

aniketsingh03 commented 6 years ago

@filipedelimabrito I am getting the following exception while trying to set user avatar- HTTP FAILED: java.io.IOException:NO_ERROR. Is it because the form value requires an @ before the file name or is there any other reason.