Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[FIX] Fixes unable to see other User profile details #2273

Merged
merged 11 commits into from
May 14, 2019
Merged

[FIX] Fixes unable to see other User profile details #2273

merged 11 commits into from
May 14, 2019

Conversation

Cool-fire
Copy link
Contributor

@RocketChat/android

Closes #2195 #2272

Changes:

checked if any one of the avatarUrl, username, name, utcOffset is not null. If any of the above is null made an empty String as Default And if utcOffset is null made None as default. Added text_video_call to widget group.

@philipbrito philipbrito added this to the 3.4.0 milestone Apr 29, 2019
val userStatus = if(status != null) status.substring(0, 1).toUpperCase() + status.substring(1) else ""
text_description_status.text = userStatus

val userUtcOffset = if(utcOffset != "null") utcOffset else "None"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded string, please remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@filipedelimabrito removed hard coded string and made a new string

username: String,
status: String,
utcOffset: String,
avatarUrl: String?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define it as null on the interface.

@Cool-fire
Copy link
Contributor Author

@filipedelimabrito made the necessary changes, Please review

@@ -381,6 +381,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string name="timezone">Timezone</string>
<string name="status" translatable="false">Status: %1$s</string>
<string name="user_detail_status" translatable="false">Status</string>
<string name="user_timezone_none" translatable="false">None</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None is a translatable string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@filipedelimabrito added strings in respective languages and added Todo's

@Cool-fire
Copy link
Contributor Author

@filipedelimabrito made the necessary changes. Please review

val userStatus = if(status != null) status.substring(0, 1).toUpperCase() + status.substring(1) else ""
text_description_status.text = userStatus

val userUtcOffset = if(utcOffset.equals("null")) getString(R.string.user_timezone_none) else utcOffset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a good way to check if a variable is null by comparing it's string value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there is no reason to create userUtcOffset

Copy link
Contributor

@philipbrito philipbrito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've improved the code here.
Thanks for sending this PR 👍 .

@philipbrito philipbrito merged commit 723d155 into RocketChat:develop May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants