Skip to content

Commit c88a91d

Browse files
committed
Format and optimize imports
1 parent 0087339 commit c88a91d

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

samplejava/src/main/java/com/example/chattutorial/ImgurAttachmentViewFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package com.example.chattutorial;
22

3-
import android.content.Context;
43
import android.view.LayoutInflater;
54
import android.view.View;
65
import android.view.ViewGroup;
7-
import android.widget.ImageView;
86

9-
import com.getstream.sdk.chat.adapter.MessageListItem;
107
import com.example.chattutorial.databinding.AttachmentImgurBinding;
8+
import com.getstream.sdk.chat.adapter.MessageListItem;
119
import com.google.android.material.shape.ShapeAppearanceModel;
1210

1311
import org.jetbrains.annotations.NotNull;

samplekotlin/src/main/java/com/example/chattutorial/ImgurAttachmentViewFactory.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.example.chattutorial
22

3-
import android.content.Context
43
import android.view.LayoutInflater
54
import android.view.View
65
import android.view.ViewGroup
@@ -15,10 +14,10 @@ import io.getstream.chat.android.ui.message.list.internal.MessageListItemStyle
1514
class ImgurAttachmentViewFactory : AttachmentViewFactory() {
1615

1716
override fun createAttachmentView(
18-
data: MessageListItem.MessageItem,
19-
listeners: MessageListListenerContainer,
20-
style: MessageListItemStyle,
21-
parent: ViewGroup,
17+
data: MessageListItem.MessageItem,
18+
listeners: MessageListListenerContainer,
19+
style: MessageListItemStyle,
20+
parent: ViewGroup,
2221
): View {
2322
val imgurAttachment = data.message.attachments.firstOrNull { it.isImgurAttachment() }
2423
return when {
@@ -31,13 +30,13 @@ class ImgurAttachmentViewFactory : AttachmentViewFactory() {
3130

3231
private fun createImgurAttachmentView(imgurAttachment: Attachment, parent: ViewGroup): View {
3332
val binding = AttachmentImgurBinding
34-
.inflate(LayoutInflater.from(parent.context), null, false)
33+
.inflate(LayoutInflater.from(parent.context), null, false)
3534

3635
binding.ivMediaThumb.apply {
3736
shapeAppearanceModel = shapeAppearanceModel
38-
.toBuilder()
39-
.setAllCornerSizes(resources.getDimension(R.dimen.stream_ui_selected_attachment_corner_radius))
40-
.build()
37+
.toBuilder()
38+
.setAllCornerSizes(resources.getDimension(R.dimen.stream_ui_selected_attachment_corner_radius))
39+
.build()
4140
load(imgurAttachment.imageUrl) {
4241
allowHardware(false)
4342
crossfade(true)

samplekotlin/src/main/java/com/example/chattutorial/MainActivity.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import androidx.appcompat.app.AppCompatActivity
66
import com.example.chattutorial.databinding.ActivityMainBinding
77
import com.getstream.sdk.chat.ChatUI
88
import io.getstream.chat.android.client.ChatClient
9-
import io.getstream.chat.android.client.logger.ChatLogLevel
109
import io.getstream.chat.android.client.models.Filters
1110
import io.getstream.chat.android.client.models.User
1211
import io.getstream.chat.android.livedata.ChatDomain
@@ -33,23 +32,23 @@ class MainActivity : AppCompatActivity() {
3332

3433
// Step 2 - Authenticate and connect the user
3534
val user = User(
36-
id = "tutorial-droid",
37-
extraData = mutableMapOf(
38-
"name" to "Tutorial Droid",
39-
"image" to "https://bit.ly/2TIt8NR",
40-
),
35+
id = "tutorial-droid",
36+
extraData = mutableMapOf(
37+
"name" to "Tutorial Droid",
38+
"image" to "https://bit.ly/2TIt8NR",
39+
),
4140
)
4241
client.connectUser(
43-
user = user,
44-
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidHV0b3JpYWwtZHJvaWQifQ.NhEr0hP9W9nwqV7ZkdShxvi02C5PR7SJE7Cs4y7kyqg"
42+
user = user,
43+
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidHV0b3JpYWwtZHJvaWQifQ.NhEr0hP9W9nwqV7ZkdShxvi02C5PR7SJE7Cs4y7kyqg"
4544
).enqueue()
4645

4746
// Step 3 - Set the channel list filter and order
4847
// This can be read as requiring only channels whose "type" is "messaging" AND
4948
// whose "members" include our "user.id"
5049
val filter = Filters.and(
51-
Filters.eq("type", "messaging"),
52-
Filters.`in`("members", listOf(user.id))
50+
Filters.eq("type", "messaging"),
51+
Filters.`in`("members", listOf(user.id))
5352
)
5453
val viewModelFactory = ChannelListViewModelFactory(filter, ChannelListViewModel.DEFAULT_SORT)
5554
val viewModel: ChannelListViewModel by viewModels { viewModelFactory }

0 commit comments

Comments
 (0)