Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
d9980439
Commit
d9980439
authored
Apr 29, 2019
by
Cool-fire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for user details
parent
a1cc6722
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
21 deletions
+31
-21
UserDetailsPresenter.kt
.../android/userdetails/presentation/UserDetailsPresenter.kt
+3
-1
UserDetailsView.kt
...ocket/android/userdetails/presentation/UserDetailsView.kt
+5
-5
UserDetailsFragment.kt
...chat/rocket/android/userdetails/ui/UserDetailsFragment.kt
+23
-15
No files found.
app/src/main/java/chat/rocket/android/userdetails/presentation/UserDetailsPresenter.kt
View file @
d9980439
package
chat.rocket.android.userdetails.presentation
package
chat.rocket.android.userdetails.presentation
import
android.util.Log
import
chat.rocket.android.chatroom.presentation.ChatRoomNavigator
import
chat.rocket.android.chatroom.presentation.ChatRoomNavigator
import
chat.rocket.android.chatrooms.domain.FetchChatRoomsInteractor
import
chat.rocket.android.chatrooms.domain.FetchChatRoomsInteractor
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.core.lifecycle.CancelStrategy
...
@@ -60,7 +61,8 @@ class UserDetailsPresenter @Inject constructor(
...
@@ -60,7 +61,8 @@ class UserDetailsPresenter @Inject constructor(
val
utcOffset
=
val
utcOffset
=
userEntity
.
utcOffset
// TODO Convert UTC and display like the mockup
userEntity
.
utcOffset
// TODO Convert UTC and display like the mockup
if
(
avatarUrl
!=
null
&&
username
!=
null
&&
name
!=
null
&&
utcOffset
!=
null
)
{
Log
.
d
(
"profile"
,
avatarUrl
+
" "
+
username
+
" "
+
name
+
" "
+
utcOffset
)
if
(
avatarUrl
!=
null
||
username
!=
null
||
name
!=
null
||
utcOffset
!=
null
)
{
view
.
showUserDetailsAndActions
(
view
.
showUserDetailsAndActions
(
avatarUrl
=
avatarUrl
,
avatarUrl
=
avatarUrl
,
name
=
name
,
name
=
name
,
...
...
app/src/main/java/chat/rocket/android/userdetails/presentation/UserDetailsView.kt
View file @
d9980439
...
@@ -16,11 +16,11 @@ interface UserDetailsView : LoadingView, MessageView {
...
@@ -16,11 +16,11 @@ interface UserDetailsView : LoadingView, MessageView {
* @param isVideoCallAllowed True if the video call is allowed, false otherwise.
* @param isVideoCallAllowed True if the video call is allowed, false otherwise.
*/
*/
fun
showUserDetailsAndActions
(
fun
showUserDetailsAndActions
(
avatarUrl
:
String
,
avatarUrl
:
String
?
,
name
:
String
,
name
:
String
?
,
username
:
String
,
username
:
String
?
,
status
:
String
,
status
:
String
?
,
utcOffset
:
String
,
utcOffset
:
String
?
,
isVideoCallAllowed
:
Boolean
isVideoCallAllowed
:
Boolean
)
)
}
}
app/src/main/java/chat/rocket/android/userdetails/ui/UserDetailsFragment.kt
View file @
d9980439
...
@@ -79,11 +79,11 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
...
@@ -79,11 +79,11 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
}
}
override
fun
showUserDetailsAndActions
(
override
fun
showUserDetailsAndActions
(
avatarUrl
:
String
,
avatarUrl
:
String
?
,
name
:
String
,
name
:
String
?
,
username
:
String
,
username
:
String
?
,
status
:
String
,
status
:
String
?
,
utcOffset
:
String
,
utcOffset
:
String
?
,
isVideoCallAllowed
:
Boolean
isVideoCallAllowed
:
Boolean
)
{
)
{
val
requestBuilder
=
Glide
.
with
(
this
).
load
(
avatarUrl
)
val
requestBuilder
=
Glide
.
with
(
this
).
load
(
avatarUrl
)
...
@@ -97,12 +97,19 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
...
@@ -97,12 +97,19 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
requestBuilder
.
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
14
)))
requestBuilder
.
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
14
)))
.
into
(
image_avatar
)
.
into
(
image_avatar
)
text_name
.
text
=
name
text_name
.
text
=
name
?:
""
text_username
.
text
=
username
text_username
.
text
=
username
?:
""
text_description_status
.
text
=
status
.
substring
(
0
,
1
).
toUpperCase
()
+
status
.
substring
(
1
)
text_description_timezone
.
text
=
utcOffset
val
userStatus
=
if
(
status
!=
null
)
status
.
substring
(
0
,
1
).
toUpperCase
()
+
status
.
substring
(
1
)
else
""
text_description_status
.
text
=
userStatus
if
(
utcOffset
!=
"null"
)
{
text_description_timezone
.
text
=
utcOffset
}
else
{
text_title_timezone
.
isVisible
=
false
}
// We should also setup the user details listeners.
// We should also setup the user details listeners.
if
(
username
!=
null
){
text_message
.
setOnClickListener
{
presenter
.
createDirectMessage
(
username
)
}
text_message
.
setOnClickListener
{
presenter
.
createDirectMessage
(
username
)
}
if
(
isVideoCallAllowed
)
{
if
(
isVideoCallAllowed
)
{
...
@@ -112,6 +119,7 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
...
@@ -112,6 +119,7 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
text_video_call
.
isVisible
=
false
text_video_call
.
isVisible
=
false
}
}
}
}
}
override
fun
showLoading
()
{
override
fun
showLoading
()
{
group_user_details
.
isVisible
=
false
group_user_details
.
isVisible
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment