Ktlint for all modules + run it

This commit is contained in:
Benoit Marty 2022-12-12 17:48:07 +01:00
parent b1c5219d74
commit 3e86fa48d8
29 changed files with 80 additions and 95 deletions

View file

@ -22,6 +22,7 @@ import io.element.android.x.matrix.MatrixClient
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.matrix.timeline.MatrixTimelineItem
import kotlin.system.measureTimeMillis
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@ -35,7 +36,6 @@ import org.matrix.rustcomponents.sdk.FormattedBody
import org.matrix.rustcomponents.sdk.MessageFormat
import org.matrix.rustcomponents.sdk.MessageType
import timber.log.Timber
import kotlin.system.measureTimeMillis
class MessageTimelineItemStateFactory(
private val client: MatrixClient,
@ -198,7 +198,6 @@ class MessageTimelineItemStateFactory(
htmlDocument = messageType.content.formatted?.toHtmlDocument()
)
else -> MessagesTimelineItemUnknownContent
}
}

View file

@ -101,13 +101,13 @@ import io.element.android.x.features.messages.textcomposer.MessageComposerViewMo
import io.element.android.x.features.messages.textcomposer.MessageComposerViewState
import io.element.android.x.textcomposer.MessageComposerMode
import io.element.android.x.textcomposer.TextComposer
import java.lang.Math.random
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.launch
import timber.log.Timber
import java.lang.Math.random
@Composable
fun MessagesScreen(
@ -116,7 +116,6 @@ fun MessagesScreen(
viewModel: MessagesViewModel = mavericksViewModel(argsFactory = { roomId }),
composerViewModel: MessageComposerViewModel = mavericksViewModel(argsFactory = { roomId })
) {
fun onSendMessage(textMessage: String) {
viewModel.sendMessage(textMessage)
composerViewModel.updateText("")

View file

@ -76,7 +76,6 @@ fun TimelineItemActionsScreen(
}
}
ModalBottomSheetLayout(
modifier = modifier,
sheetState = modalBottomSheetState,

View file

@ -35,7 +35,6 @@ fun MessagesTimelineItemImageView(
.aspectRatio(content.aspectRatio),
contentAlignment = Alignment.Center,
) {
var isLoading = rememberSaveable(content.imageMeta) { mutableStateOf(true) }
val context = LocalContext.current
val model = ImageRequest.Builder(context)

View file

@ -454,7 +454,6 @@ private fun AnnotatedString.Builder.appendInlineChildrenElements(
childNodes: List<Node>,
colors: ColorScheme
) {
for (node in childNodes) {
when (node) {
is TextNode -> {
@ -552,4 +551,3 @@ private fun HtmlText(
onLongClick = onLongClick
)
}

View file

@ -25,6 +25,3 @@ sealed interface MessagesTimelineItemState {
val safeSenderName: String = senderDisplayName ?: senderId
}
}