Commit 2791440 1 parent be8c3bc commit 2791440 Copy full SHA for 2791440
File tree 3 files changed +43
-7
lines changed
java/org/xmtp/android/example/message
library/src/androidTest/java/org/xmtp/android/library
3 files changed +43
-7
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ import org.xmtp.android.example.R
11
11
import org.xmtp.android.example.conversation.ConversationDetailViewModel
12
12
import org.xmtp.android.example.databinding.ListItemMessageBinding
13
13
import org.xmtp.android.example.extension.margins
14
- import org.xmtp.proto.mls.message.contents.TranscriptMessages
15
14
import uniffi.xmtpv3.org.xmtp.android.library.codecs.GroupMembershipChanges
15
+ import java.text.SimpleDateFormat
16
+ import java.util.Locale
16
17
17
18
class MessageViewHolder (
18
19
private val binding : ListItemMessageBinding ,
@@ -45,6 +46,9 @@ class MessageViewHolder(
45
46
binding.messageContainer.layoutParams = params
46
47
if (item.message.content<Any >() is String ) {
47
48
binding.messageBody.text = item.message.body
49
+ val sdf = SimpleDateFormat (" yyyy-MM-dd HH:mm:ss" , Locale .getDefault())
50
+ binding.messageDate.text = sdf.format(item.message.sent)
51
+
48
52
} else if (item.message.content<Any >() is GroupMembershipChanges ) {
49
53
val changes = item.message.content() as ? GroupMembershipChanges
50
54
binding.messageBody.text =
Original file line number Diff line number Diff line change 15
15
app : cardCornerRadius =" 8dp"
16
16
app : layout_constraintTop_toTopOf =" parent"
17
17
tools : ignore =" MissingConstraints" >
18
-
19
- <TextView
20
- android : id =" @+id/messageBody"
18
+ <LinearLayout
21
19
android : layout_width =" wrap_content"
22
- android : layout_height =" wrap_content"
23
- android : textSize =" 16sp"
24
- android : layout_margin =" 8dp" />
20
+ android : layout_height =" wrap_content" >
21
+ <TextView
22
+ android : id =" @+id/messageBody"
23
+ android : layout_width =" wrap_content"
24
+ android : layout_height =" wrap_content"
25
+ android : textSize =" 16sp"
26
+ android : layout_margin =" 8dp" />
27
+ <TextView
28
+ android : id =" @+id/messageDate"
29
+ android : layout_width =" wrap_content"
30
+ android : layout_height =" wrap_content"
31
+ android : textSize =" 16sp"
32
+ android : layout_margin =" 8dp"
33
+ />
34
+ </LinearLayout >
35
+
36
+
25
37
26
38
</androidx .cardview.widget.CardView>
27
39
Original file line number Diff line number Diff line change @@ -112,6 +112,26 @@ class GroupTest {
112
112
)
113
113
}
114
114
115
+ @Test
116
+ fun testCanRemoveGroupMembersWhenNotCreator () {
117
+ boClient.conversations.newGroup(
118
+ listOf (
119
+ alix.walletAddress,
120
+ caro.walletAddress
121
+ )
122
+ )
123
+ runBlocking { alixClient.conversations.syncGroups() }
124
+ val group = alixClient.conversations.listGroups().first()
125
+ group.removeMembers(listOf (caro.walletAddress))
126
+ assertEquals(
127
+ group.memberAddresses().sorted(),
128
+ listOf (
129
+ alix.walletAddress.lowercase(),
130
+ bo.walletAddress.lowercase()
131
+ ).sorted()
132
+ )
133
+ }
134
+
115
135
@Test
116
136
fun testIsActiveReturnsCorrectly () {
117
137
val group = boClient.conversations.newGroup(
You can’t perform that action at this time.
0 commit comments