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
af651b43
Commit
af651b43
authored
Oct 17, 2018
by
Łukasz Rutkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display user status indicator in members list
parent
5a472099
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
MembersAdapter.kt
...ava/chat/rocket/android/members/adapter/MembersAdapter.kt
+2
-0
MemberUiModel.kt
...java/chat/rocket/android/members/uimodel/MemberUiModel.kt
+5
-0
item_member.xml
app/src/main/res/layout/item_member.xml
+15
-5
No files found.
app/src/main/java/chat/rocket/android/members/adapter/MembersAdapter.kt
View file @
af651b43
...
...
@@ -44,6 +44,8 @@ class MembersAdapter(private val listener: (MemberUiModel) -> Unit) :
image_avatar
.
setImageURI
(
memberUiModel
.
avatarUri
)
text_member
.
content
=
memberUiModel
.
displayName
setOnClickListener
{
listener
(
memberUiModel
)
}
val
statusDrawable
=
DrawableHelper
.
getUserStatusDrawable
(
memberUiModel
.
status
,
context
)
image_member_status
.
setImageDrawable
(
statusDrawable
)
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/members/uimodel/MemberUiModel.kt
View file @
af651b43
...
...
@@ -3,6 +3,7 @@ package chat.rocket.android.members.uimodel
import
chat.rocket.android.server.domain.useRealName
import
chat.rocket.android.util.extensions.avatarUrl
import
chat.rocket.common.model.User
import
chat.rocket.common.model.UserStatus
import
chat.rocket.core.model.Value
class
MemberUiModel
(
...
...
@@ -16,6 +17,7 @@ class MemberUiModel(
val
username
:
String
?
val
email
:
String
?
val
utcOffset
:
Float
?
val
status
:
UserStatus
?
init
{
avatarUri
=
getUserAvatar
()
...
...
@@ -24,6 +26,7 @@ class MemberUiModel(
username
=
getUserUsername
()
email
=
getUserEmail
()
utcOffset
=
getUserUtcOffset
()
status
=
getUserStatus
()
}
private
fun
getUserAvatar
():
String
?
{
...
...
@@ -47,4 +50,6 @@ class MemberUiModel(
private
fun
getUserEmail
():
String
?
=
member
.
emails
?.
get
(
0
)
?.
address
private
fun
getUserUtcOffset
():
Float
?
=
member
.
utcOffset
private
fun
getUserStatus
():
UserStatus
?
=
member
.
status
}
\ No newline at end of file
app/src/main/res/layout/item_member.xml
View file @
af651b43
...
...
@@ -5,10 +5,10 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/selectableItemBackground"
android:paddingBottom=
"@dimen/member_item_top_and_bottom_padding"
android:paddingEnd=
"@dimen/screen_edge_left_and_right_padding"
android:paddingStart=
"@dimen/screen_edge_left_and_right_padding"
android:paddingTop=
"@dimen/member_item_top_and_bottom_padding"
>
android:paddingTop=
"@dimen/member_item_top_and_bottom_padding"
android:paddingEnd=
"@dimen/screen_edge_left_and_right_padding"
android:paddingBottom=
"@dimen/member_item_top_and_bottom_padding"
>
<include
android:id=
"@+id/layout_avatar"
...
...
@@ -18,14 +18,24 @@
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/image_member_status"
android:layout_width=
"12dp"
android:layout_height=
"0dp"
android:layout_marginStart=
"16dp"
app:layout_constraintBottom_toBottomOf=
"@+id/layout_avatar"
app:layout_constraintStart_toEndOf=
"@+id/layout_avatar"
app:layout_constraintTop_toTopOf=
"@+id/layout_avatar"
tools:src=
"@drawable/ic_status_invisible_12dp"
/>
<TextView
android:id=
"@+id/text_member"
style=
"@style/Sender.Name.TextView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"
16dp
"
android:layout_marginStart=
"
@dimen/text_view_drawable_padding
"
app:layout_constraintBottom_toBottomOf=
"@+id/layout_avatar"
app:layout_constraintLeft_toRightOf=
"@+id/
layout_avatar
"
app:layout_constraintLeft_toRightOf=
"@+id/
image_member_status
"
app:layout_constraintTop_toTopOf=
"@+id/layout_avatar"
tools:text=
"Ronald Perkins"
/>
...
...
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