-
Notifications
You must be signed in to change notification settings - Fork 553
[FIX] Fixes unable to see other User profile details #2273
[FIX] Fixes unable to see other User profile details #2273
Conversation
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?, |
There was a problem hiding this comment.
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.
@filipedelimabrito made the necessary changes, Please review |
app/src/main/res/values/strings.xml
Outdated
@@ -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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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 👍 .
@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 madeNone
as default. Addedtext_video_call
to widget group.