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
81a4bae4
Commit
81a4bae4
authored
Apr 17, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get active user streams.
parent
d0e17275
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
302 additions
and
93 deletions
+302
-93
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+1
-1
ChatRoomsPresenter.kt
...cket/android/chatrooms/presentation/ChatRoomsPresenter.kt
+142
-45
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+10
-2
AppModule.kt
.../main/java/chat/rocket/android/dagger/module/AppModule.kt
+7
-8
MainPresenter.kt
...va/chat/rocket/android/main/presentation/MainPresenter.kt
+3
-3
ActiveUsersRepository.kt
...hat/rocket/android/server/domain/ActiveUsersRepository.kt
+10
-0
GetActiveUsersInteractor.kt
.../rocket/android/server/domain/GetActiveUsersInteractor.kt
+15
-0
GetChatRoomsInteractor.kt
...at/rocket/android/server/domain/GetChatRoomsInteractor.kt
+45
-6
SaveActiveUsersInteractor.kt
...rocket/android/server/domain/SaveActiveUsersInteractor.kt
+9
-0
ConnectionManager.kt
...ocket/android/server/infraestructure/ConnectionManager.kt
+24
-9
MemoryActiveUsersRepository.kt
...oid/server/infraestructure/MemoryActiveUsersRepository.kt
+15
-0
fragment_chat_rooms.xml
app/src/main/res/layout/fragment_chat_rooms.xml
+5
-4
item_chat.xml
app/src/main/res/layout/item_chat.xml
+16
-15
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
81a4bae4
...
@@ -472,7 +472,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
...
@@ -472,7 +472,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
fun
loadChatRooms
()
{
fun
loadChatRooms
()
{
launchUI
(
strategy
)
{
launchUI
(
strategy
)
{
try
{
try
{
val
chatRooms
=
getChatRoomsInteractor
.
get
(
currentServer
)
val
chatRooms
=
getChatRoomsInteractor
.
get
All
(
currentServer
)
.
filterNot
{
.
filterNot
{
it
.
type
is
RoomType
.
DirectMessage
||
it
.
type
is
RoomType
.
Livechat
it
.
type
is
RoomType
.
DirectMessage
||
it
.
type
is
RoomType
.
Livechat
}
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/presentation/ChatRoomsPresenter.kt
View file @
81a4bae4
This diff is collapsed.
Click to expand it.
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
81a4bae4
...
@@ -22,6 +22,7 @@ import chat.rocket.android.util.extensions.inflate
...
@@ -22,6 +22,7 @@ import chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.textContent
import
chat.rocket.android.util.extensions.textContent
import
chat.rocket.common.model.RoomType
import
chat.rocket.common.model.RoomType
import
chat.rocket.common.model.UserStatus
import
chat.rocket.core.model.ChatRoom
import
chat.rocket.core.model.ChatRoom
import
com.facebook.drawee.view.SimpleDraweeView
import
com.facebook.drawee.view.SimpleDraweeView
import
kotlinx.android.synthetic.main.item_chat.view.*
import
kotlinx.android.synthetic.main.item_chat.view.*
...
@@ -91,7 +92,12 @@ class ChatRoomsAdapter(private val context: Context,
...
@@ -91,7 +92,12 @@ class ChatRoomsAdapter(private val context: Context,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_lock
,
context
)
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_lock
,
context
)
}
}
is
RoomType
.
DirectMessage
->
{
is
RoomType
.
DirectMessage
->
{
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_room_dm
,
context
)
val
status
=
chatRoom
.
status
if
(
status
==
null
)
{
DrawableHelper
.
getUserStatusDrawable
(
UserStatus
.
Offline
(),
context
)
}
else
{
DrawableHelper
.
getUserStatusDrawable
(
status
,
context
)
}
}
}
else
->
null
else
->
null
}
}
...
@@ -103,7 +109,9 @@ class ChatRoomsAdapter(private val context: Context,
...
@@ -103,7 +109,9 @@ class ChatRoomsAdapter(private val context: Context,
true
->
R
.
color
.
colorPrimaryText
true
->
R
.
color
.
colorPrimaryText
false
->
R
.
color
.
colorSecondaryText
false
->
R
.
color
.
colorSecondaryText
}
}
DrawableHelper
.
tintDrawable
(
mutableDrawable
,
context
,
color
)
if
(
chatRoom
.
type
!
is
RoomType
.
DirectMessage
)
{
DrawableHelper
.
tintDrawable
(
mutableDrawable
,
context
,
color
)
}
DrawableHelper
.
compoundDrawable
(
textView
,
mutableDrawable
)
DrawableHelper
.
compoundDrawable
(
textView
,
mutableDrawable
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/dagger/module/AppModule.kt
View file @
81a4bae4
...
@@ -19,14 +19,7 @@ import chat.rocket.android.infrastructure.SharedPrefsLocalRepository
...
@@ -19,14 +19,7 @@ import chat.rocket.android.infrastructure.SharedPrefsLocalRepository
import
chat.rocket.android.push.GroupedPush
import
chat.rocket.android.push.GroupedPush
import
chat.rocket.android.push.PushManager
import
chat.rocket.android.push.PushManager
import
chat.rocket.android.server.domain.*
import
chat.rocket.android.server.domain.*
import
chat.rocket.android.server.infraestructure.MemoryChatRoomsRepository
import
chat.rocket.android.server.infraestructure.*
import
chat.rocket.android.server.infraestructure.MemoryMessagesRepository
import
chat.rocket.android.server.infraestructure.MemoryRoomRepository
import
chat.rocket.android.server.infraestructure.MemoryUsersRepository
import
chat.rocket.android.server.infraestructure.ServerDao
import
chat.rocket.android.server.infraestructure.SharedPreferencesAccountsRepository
import
chat.rocket.android.server.infraestructure.SharedPreferencesSettingsRepository
import
chat.rocket.android.server.infraestructure.SharedPrefsCurrentServerRepository
import
chat.rocket.android.util.AppJsonAdapterFactory
import
chat.rocket.android.util.AppJsonAdapterFactory
import
chat.rocket.android.util.TimberLogger
import
chat.rocket.android.util.TimberLogger
import
chat.rocket.common.internal.FallbackSealedClassJsonAdapter
import
chat.rocket.common.internal.FallbackSealedClassJsonAdapter
...
@@ -200,6 +193,12 @@ class AppModule {
...
@@ -200,6 +193,12 @@ class AppModule {
return
MemoryChatRoomsRepository
()
return
MemoryChatRoomsRepository
()
}
}
@Provides
@Singleton
fun
provideActiveUsersRepository
():
ActiveUsersRepository
{
return
MemoryActiveUsersRepository
()
}
@Provides
@Provides
@Singleton
@Singleton
fun
provideMoshi
():
Moshi
{
fun
provideMoshi
():
Moshi
{
...
...
app/src/main/java/chat/rocket/android/main/presentation/MainPresenter.kt
View file @
81a4bae4
...
@@ -188,9 +188,9 @@ class MainPresenter @Inject constructor(
...
@@ -188,9 +188,9 @@ class MainPresenter @Inject constructor(
private
suspend
fun
subscribeMyselfUpdates
()
{
private
suspend
fun
subscribeMyselfUpdates
()
{
manager
.
addUserDataChannel
(
userDataChannel
)
manager
.
addUserDataChannel
(
userDataChannel
)
for
(
myself
in
userDataChannel
)
{
for
(
myself
in
userDataChannel
)
{
updateMyself
(
myself
)
updateMyself
(
myself
)
}
}
}
}
private
suspend
fun
updateMyself
(
myself
:
Myself
)
{
private
suspend
fun
updateMyself
(
myself
:
Myself
)
{
...
...
app/src/main/java/chat/rocket/android/server/domain/ActiveUsersRepository.kt
0 → 100644
View file @
81a4bae4
package
chat.rocket.android.server.domain
import
chat.rocket.common.model.User
interface
ActiveUsersRepository
{
fun
save
(
url
:
String
,
activeUsers
:
List
<
User
>)
fun
get
(
url
:
String
):
List
<
User
>
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/server/domain/GetActiveUsersInteractor.kt
0 → 100644
View file @
81a4bae4
package
chat.rocket.android.server.domain
import
chat.rocket.common.model.User
import
javax.inject.Inject
class
GetActiveUsersInteractor
@Inject
constructor
(
private
val
repository
:
ActiveUsersRepository
)
{
fun
getActiveUserById
(
url
:
String
,
id
:
String
):
User
?
{
return
repository
.
get
(
url
).
find
{
user
->
user
.
id
==
id
}
}
fun
getActiveUserByUsername
(
url
:
String
,
username
:
String
):
User
?
{
return
repository
.
get
(
url
).
find
{
user
->
user
.
username
==
username
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/server/domain/GetChatRoomsInteractor.kt
View file @
81a4bae4
...
@@ -8,13 +8,13 @@ import javax.inject.Inject
...
@@ -8,13 +8,13 @@ import javax.inject.Inject
class
GetChatRoomsInteractor
@Inject
constructor
(
private
val
repository
:
ChatRoomsRepository
)
{
class
GetChatRoomsInteractor
@Inject
constructor
(
private
val
repository
:
ChatRoomsRepository
)
{
/**
/**
* Get all
ChatRoom objects
.
* Get all
[ChatRoom]
.
*
*
* @param url The server url.
* @param url The server url.
*
*
* @return All the
ChatRoom
objects.
* @return All the
[ChatRoom]
objects.
*/
*/
fun
get
(
url
:
String
)
=
repository
.
get
(
url
)
fun
get
All
(
url
:
String
)
=
repository
.
get
(
url
)
/**
/**
* Get a list of chat rooms that contains the name parameter.
* Get a list of chat rooms that contains the name parameter.
...
@@ -23,7 +23,7 @@ class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoo
...
@@ -23,7 +23,7 @@ class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoo
* @param name The name of chat room to look for or a chat room that contains this name.
* @param name The name of chat room to look for or a chat room that contains this name.
* @return A list of ChatRoom objects with the given name.
* @return A list of ChatRoom objects with the given name.
*/
*/
suspend
fun
getByName
(
url
:
String
,
name
:
String
):
List
<
ChatRoom
>
=
withContext
(
CommonPool
)
{
suspend
fun
get
All
ByName
(
url
:
String
,
name
:
String
):
List
<
ChatRoom
>
=
withContext
(
CommonPool
)
{
val
allChatRooms
=
repository
.
get
(
url
)
val
allChatRooms
=
repository
.
get
(
url
)
if
(
name
.
isEmpty
())
{
if
(
name
.
isEmpty
())
{
return
@withContext
allChatRooms
return
@withContext
allChatRooms
...
@@ -34,11 +34,11 @@ class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoo
...
@@ -34,11 +34,11 @@ class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoo
}
}
/**
/**
* Get a specific
room
by its id.
* Get a specific
[ChatRoom]
by its id.
*
*
* @param serverUrl The server url where the room is.
* @param serverUrl The server url where the room is.
* @param roomId The id of the room to get.
* @param roomId The id of the room to get.
* @return The
ChatRoom
object or null if we couldn't find any.
* @return The
[ChatRoom]
object or null if we couldn't find any.
*/
*/
suspend
fun
getById
(
serverUrl
:
String
,
roomId
:
String
):
ChatRoom
?
=
withContext
(
CommonPool
)
{
suspend
fun
getById
(
serverUrl
:
String
,
roomId
:
String
):
ChatRoom
?
=
withContext
(
CommonPool
)
{
val
allChatRooms
=
repository
.
get
(
serverUrl
)
val
allChatRooms
=
repository
.
get
(
serverUrl
)
...
@@ -46,4 +46,43 @@ class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoo
...
@@ -46,4 +46,43 @@ class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoo
it
.
id
==
roomId
it
.
id
==
roomId
}
}
}
}
/**
* Get a specific [ChatRoom] by its name.
*
* @param serverUrl The server url where the room is.
* @param name The name of the room to get.
* @return The [ChatRoom] object or null if we couldn't find any.
*/
fun
getByName
(
serverUrl
:
String
,
name
:
String
):
ChatRoom
?
{
return
getAll
(
serverUrl
).
toMutableList
().
find
{
chatRoom
->
chatRoom
.
name
==
name
}
}
/**
* Add a [ChatRoom].
*
* @param url The server url.
* @param chatRoom The [ChatRoom] to be added to the list.
*/
fun
add
(
url
:
String
,
chatRoom
:
ChatRoom
)
{
val
chatRooms
:
MutableList
<
ChatRoom
>
=
getAll
(
url
).
toMutableList
()
synchronized
(
this
)
{
chatRooms
.
add
(
chatRoom
)
}
repository
.
save
(
url
,
chatRooms
)
}
/**
* Removes a [ChatRoom].
*
* @param url The server url.
* @param chatRoom The [ChatRoom] to be removed from the list.
*/
fun
remove
(
url
:
String
,
chatRoom
:
ChatRoom
)
{
val
chatRooms
:
MutableList
<
ChatRoom
>
=
getAll
(
url
).
toMutableList
()
synchronized
(
this
)
{
chatRooms
.
removeAll
{
chatRoom_
->
chatRoom_
.
id
==
chatRoom
.
id
}
}
repository
.
save
(
url
,
chatRooms
)
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/server/domain/SaveActiveUsersInteractor.kt
0 → 100644
View file @
81a4bae4
package
chat.rocket.android.server.domain
import
chat.rocket.common.model.User
import
javax.inject.Inject
class
SaveActiveUsersInteractor
@Inject
constructor
(
private
val
repository
:
ActiveUsersRepository
)
{
fun
save
(
url
:
String
,
activeUsers
:
List
<
User
>)
=
repository
.
save
(
url
,
activeUsers
)
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/server/infraestructure/ConnectionManager.kt
View file @
81a4bae4
package
chat.rocket.android.server.infraestructure
package
chat.rocket.android.server.infraestructure
import
chat.rocket.common.model.BaseRoom
import
chat.rocket.common.model.BaseRoom
import
chat.rocket.common.model.User
import
chat.rocket.core.RocketChatClient
import
chat.rocket.core.RocketChatClient
import
chat.rocket.core.internal.realtime.
unsubscribe
import
chat.rocket.core.internal.realtime.
*
import
chat.rocket.core.internal.realtime.socket.connect
import
chat.rocket.core.internal.realtime.socket.connect
import
chat.rocket.core.internal.realtime.socket.disconnect
import
chat.rocket.core.internal.realtime.socket.disconnect
import
chat.rocket.core.internal.realtime.socket.model.State
import
chat.rocket.core.internal.realtime.socket.model.State
import
chat.rocket.core.internal.realtime.socket.model.StreamMessage
import
chat.rocket.core.internal.realtime.socket.model.StreamMessage
import
chat.rocket.core.internal.realtime.subscribeRoomMessages
import
chat.rocket.core.internal.realtime.subscribeRooms
import
chat.rocket.core.internal.realtime.subscribeSubscriptions
import
chat.rocket.core.internal.realtime.subscribeUserDataChanges
import
chat.rocket.core.internal.rest.chatRooms
import
chat.rocket.core.internal.rest.chatRooms
import
chat.rocket.core.model.Message
import
chat.rocket.core.model.Message
import
chat.rocket.core.model.Myself
import
chat.rocket.core.model.Myself
...
@@ -28,11 +25,13 @@ class ConnectionManager(internal val client: RocketChatClient) {
...
@@ -28,11 +25,13 @@ class ConnectionManager(internal val client: RocketChatClient) {
private
val
roomAndSubscriptionChannels
=
ArrayList
<
Channel
<
StreamMessage
<
BaseRoom
>>>()
private
val
roomAndSubscriptionChannels
=
ArrayList
<
Channel
<
StreamMessage
<
BaseRoom
>>>()
private
val
roomMessagesChannels
=
LinkedHashMap
<
String
,
Channel
<
Message
>>()
private
val
roomMessagesChannels
=
LinkedHashMap
<
String
,
Channel
<
Message
>>()
private
val
userDataChannels
=
ArrayList
<
Channel
<
Myself
>>()
private
val
userDataChannels
=
ArrayList
<
Channel
<
Myself
>>()
private
val
activeUsersChannels
=
ArrayList
<
Channel
<
User
>>()
private
val
subscriptionIdMap
=
HashMap
<
String
,
String
>()
private
val
subscriptionIdMap
=
HashMap
<
String
,
String
>()
private
var
subscriptionId
:
String
?
=
null
private
var
subscriptionId
:
String
?
=
null
private
var
roomsId
:
String
?
=
null
private
var
roomsId
:
String
?
=
null
private
var
userId
:
String
?
=
null
private
var
userDataId
:
String
?
=
null
private
var
activeUserId
:
String
?
=
null
fun
connect
()
{
fun
connect
()
{
if
(
connectJob
?.
isActive
==
true
&&
(
state
!
is
State
.
Disconnected
))
{
if
(
connectJob
?.
isActive
==
true
&&
(
state
!
is
State
.
Disconnected
))
{
...
@@ -60,9 +59,13 @@ class ConnectionManager(internal val client: RocketChatClient) {
...
@@ -60,9 +59,13 @@ class ConnectionManager(internal val client: RocketChatClient) {
Timber
.
d
(
"Subscribed to rooms: $id"
)
Timber
.
d
(
"Subscribed to rooms: $id"
)
roomsId
=
id
roomsId
=
id
}
}
client
.
subscribeUserDataChanges
{
_
,
id
->
client
.
subscribeUserData
{
_
,
id
->
Timber
.
d
(
"Subscribed to the user: $id"
)
Timber
.
d
(
"Subscribed to the userData id: $id"
)
userId
=
id
userDataId
=
id
}
client
.
subscribeActiveUsers
{
_
,
id
->
Timber
.
d
(
"Subscribed to the activeUser id: $id"
)
activeUserId
=
id
}
}
resubscribeRooms
()
resubscribeRooms
()
...
@@ -115,6 +118,14 @@ class ConnectionManager(internal val client: RocketChatClient) {
...
@@ -115,6 +118,14 @@ class ConnectionManager(internal val client: RocketChatClient) {
}
}
}
}
launch
(
parent
=
connectJob
)
{
for
(
user
in
client
.
activeUsersChannel
)
{
Timber
.
d
(
"Got activeUsers"
)
for
(
channel
in
activeUsersChannels
)
{
channel
.
send
(
user
)
}
}
}
client
.
connect
()
client
.
connect
()
// Broadcast initial state...
// Broadcast initial state...
...
@@ -154,6 +165,10 @@ class ConnectionManager(internal val client: RocketChatClient) {
...
@@ -154,6 +165,10 @@ class ConnectionManager(internal val client: RocketChatClient) {
fun
removeUserDataChannel
(
channel
:
Channel
<
Myself
>)
=
userDataChannels
.
remove
(
channel
)
fun
removeUserDataChannel
(
channel
:
Channel
<
Myself
>)
=
userDataChannels
.
remove
(
channel
)
fun
addActiveUserChannel
(
channel
:
Channel
<
User
>)
=
activeUsersChannels
.
add
(
channel
)
fun
removeActiveUserChannel
(
channel
:
Channel
<
User
>)
=
activeUsersChannels
.
remove
(
channel
)
fun
subscribeRoomMessages
(
roomId
:
String
,
channel
:
Channel
<
Message
>)
{
fun
subscribeRoomMessages
(
roomId
:
String
,
channel
:
Channel
<
Message
>)
{
val
oldSub
=
roomMessagesChannels
.
put
(
roomId
,
channel
)
val
oldSub
=
roomMessagesChannels
.
put
(
roomId
,
channel
)
if
(
oldSub
!=
null
)
{
if
(
oldSub
!=
null
)
{
...
...
app/src/main/java/chat/rocket/android/server/infraestructure/MemoryActiveUsersRepository.kt
0 → 100644
View file @
81a4bae4
package
chat.rocket.android.server.infraestructure
import
chat.rocket.android.server.domain.ActiveUsersRepository
import
chat.rocket.common.model.User
class
MemoryActiveUsersRepository
:
ActiveUsersRepository
{
val
cache
=
HashMap
<
String
,
List
<
User
>>()
override
fun
save
(
url
:
String
,
activeUsers
:
List
<
User
>)
{
cache
[
url
]
=
activeUsers
}
override
fun
get
(
url
:
String
):
List
<
User
>
=
cache
[
url
]
?:
emptyList
()
}
\ No newline at end of file
app/src/main/res/layout/fragment_chat_rooms.xml
View file @
81a4bae4
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
android:visibility=
"gone"
app:indicatorColor=
"@color/black"
app:indicatorColor=
"@color/black"
app:indicatorName=
"BallPulseIndicator"
/>
app:indicatorName=
"BallPulseIndicator"
/>
...
@@ -33,15 +34,15 @@
...
@@ -33,15 +34,15 @@
android:id=
"@+id/connection_status_text"
android:id=
"@+id/connection_status_text"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"32dp"
android:layout_height=
"32dp"
android:alpha=
"0"
android:background=
"@color/colorPrimary"
android:background=
"@color/colorPrimary"
android:elevation=
"4dp"
android:elevation=
"4dp"
android:textColor=
"@color/white"
android:gravity=
"center"
android:gravity=
"center"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body2"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body2"
android:textColor=
"@color/white"
android:visibility=
"gone"
android:visibility=
"gone"
android:alpha=
"0"
tools:alpha=
"1"
tools:alpha=
"1"
tools:
visibility=
"visible
"
tools:
text=
"connected
"
tools:
text=
"connected"
/>
tools:
visibility=
"visible"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/item_chat.xml
View file @
81a4bae4
...
@@ -5,19 +5,19 @@
...
@@ -5,19 +5,19 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/selectableItemBackground"
android:background=
"?android:attr/selectableItemBackground"
android:padding
Start=
"@dimen/screen_edge_left_and_right
_padding"
android:padding
Bottom=
"@dimen/chat_item_top_and_bottom
_padding"
android:paddingEnd=
"@dimen/screen_edge_left_and_right_padding"
android:paddingEnd=
"@dimen/screen_edge_left_and_right_padding"
android:padding
Top=
"@dimen/chat_item_top_and_bottom
_padding"
android:padding
Start=
"@dimen/screen_edge_left_and_right
_padding"
android:padding
Bottom
=
"@dimen/chat_item_top_and_bottom_padding"
>
android:padding
Top
=
"@dimen/chat_item_top_and_bottom_padding"
>
<com.facebook.drawee.view.SimpleDraweeView
<com.facebook.drawee.view.SimpleDraweeView
android:id=
"@+id/image_avatar"
android:id=
"@+id/image_avatar"
android:layout_width=
"40dp"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_height=
"40dp"
app:roundedCornerRadius=
"3dp"
android:layout_marginTop=
"6dp"
android:layout_marginTop=
"6dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
app:roundedCornerRadius=
"3dp"
/>
<TextView
<TextView
android:id=
"@+id/text_chat_name"
android:id=
"@+id/text_chat_name"
...
@@ -25,17 +25,18 @@
...
@@ -25,17 +25,18 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
a
pp:layout_constraintStart_toEndOf=
"@id/image_avatar
"
a
ndroid:drawablePadding=
"6dp
"
android:textDirection=
"locale"
android:textDirection=
"locale"
tools:text=
"General"
/>
app:layout_constraintStart_toEndOf=
"@id/image_avatar"
tools:text=
"General"
/>
<TextView
<TextView
android:id=
"@+id/text_last_message_date_time"
android:id=
"@+id/text_last_message_date_time"
style=
"@style/Timestamp.TextView"
style=
"@style/Timestamp.TextView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
android:layout_marginEnd=
"5dp"
android:layout_marginStart=
"5dp"
app:layout_constraintBaseline_toBaselineOf=
"@+id/text_chat_name"
app:layout_constraintBaseline_toBaselineOf=
"@+id/text_chat_name"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
tools:text=
"11:45 AM"
/>
tools:text=
"11:45 AM"
/>
...
@@ -44,23 +45,23 @@
...
@@ -44,23 +45,23 @@
android:id=
"@+id/text_last_message"
android:id=
"@+id/text_last_message"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:ellipsize=
"end"
android:ellipsize=
"end"
android:maxLines=
"2"
android:maxLines=
"2"
android:layout_marginTop=
"2dp"
android:textDirection=
"locale"
app:layout_constraintEnd_toStartOf=
"@id/layout_unread_messages_badge"
app:layout_constraintStart_toStartOf=
"@id/text_chat_name"
app:layout_constraintStart_toStartOf=
"@id/text_chat_name"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_name"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_name"
app:layout_constraintEnd_toStartOf=
"@id/layout_unread_messages_badge"
tools:text=
"You: Type something that is very big and need at least to lines, or maybe even more"
/>
android:textDirection=
"locale"
tools:text=
"You: Type something that is very big and need at least to lines, or maybe even more"
/>
<include
<include
android:id=
"@+id/layout_unread_messages_badge"
android:id=
"@+id/layout_unread_messages_badge"
layout=
"@layout/unread_messages_badge"
layout=
"@layout/unread_messages_badge"
android:layout_width=
"18dp"
android:layout_width=
"18dp"
android:layout_height=
"18dp"
android:layout_height=
"18dp"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
android:layout_marginEnd=
"5dp"
app:layout_constraintTop_toTopOf=
"@id/text_last_message"
android:layout_marginStart=
"5dp"
app:layout_constraintEnd_toEndOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/text_last_message"
/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
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