mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Fix "Arrow is redundant when parameter list is empty"
And other issues that ktlint now reports
This commit is contained in:
committed by
Benoit Marty
parent
ea616be814
commit
eef0fbf4be
+1
@@ -14,6 +14,7 @@ import kotlinx.collections.immutable.toPersistentList
|
||||
object WaveFormSamples {
|
||||
val allRangeWaveForm = List(100) { it.toFloat() / 100 }.toImmutableList()
|
||||
|
||||
@Suppress("ktlint:standard:argument-list-wrapping")
|
||||
val realisticWaveForm = persistentListOf(
|
||||
0.000f, 0.000f, 0.000f, 0.003f, 0.354f,
|
||||
0.353f, 0.365f, 0.790f, 0.787f, 0.167f,
|
||||
|
||||
+1
-4
@@ -71,10 +71,7 @@ public fun MapLibreMap(
|
||||
uiSettings: MapUiSettings = DefaultMapUiSettings,
|
||||
symbolManagerSettings: MapSymbolManagerSettings = DefaultMapSymbolManagerSettings,
|
||||
locationSettings: MapLocationSettings = DefaultMapLocationSettings,
|
||||
content: (
|
||||
@Composable @MapLibreMapComposable
|
||||
() -> Unit
|
||||
)? = null,
|
||||
content: (@Composable @MapLibreMapComposable () -> Unit)? = null,
|
||||
) {
|
||||
// When in preview, early return a Box with the received modifier preserving layout
|
||||
if (LocalInspectionMode.current) {
|
||||
|
||||
+4
-2
@@ -207,10 +207,12 @@ class RustTimeline(
|
||||
backwardPaginationStatus,
|
||||
forwardPaginationStatus,
|
||||
joinedRoom.roomInfoFlow.map { it.creators to it.isDm }.distinctUntilChanged(),
|
||||
) { timelineItems,
|
||||
) {
|
||||
timelineItems,
|
||||
backwardPaginationStatus,
|
||||
forwardPaginationStatus,
|
||||
(roomCreators, isDm) ->
|
||||
(roomCreators, isDm),
|
||||
->
|
||||
withContext(dispatcher) {
|
||||
timelineItems
|
||||
.let { items ->
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class FakeNotificationCreator(
|
||||
var createFallbackNotificationResult: LambdaOneParamRecorder<FallbackNotifiableEvent, Notification> = lambdaRecorder { _ -> A_NOTIFICATION },
|
||||
var createSummaryListNotificationResult: LambdaFourParamsRecorder<MatrixUser, String, Boolean, Long, Notification> =
|
||||
lambdaRecorder { _, _, _, _ -> A_NOTIFICATION },
|
||||
var createDiagnosticNotificationResult: LambdaNoParamRecorder<Notification> = lambdaRecorder { -> A_NOTIFICATION },
|
||||
var createDiagnosticNotificationResult: LambdaNoParamRecorder<Notification> = lambdaRecorder<Notification> { A_NOTIFICATION },
|
||||
) : NotificationCreator {
|
||||
override suspend fun createMessagesListNotification(
|
||||
roomInfo: RoomEventGroupInfo,
|
||||
|
||||
+20
-10
@@ -114,7 +114,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(player1.prepare().isSuccess).isTrue()
|
||||
matchReadyState(1_000L)
|
||||
player1.play()
|
||||
awaitItem().let { // it plays until the end.
|
||||
awaitItem().let {
|
||||
// it plays until the end.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -127,14 +128,16 @@ class DefaultVoiceMessagePlayerTest {
|
||||
player2.state.test {
|
||||
matchInitialState()
|
||||
assertThat(player2.prepare().isSuccess).isTrue()
|
||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
||||
awaitItem().let {
|
||||
// Additional spurious state due to MediaPlayer owner change.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
assertThat(it.currentPosition).isEqualTo(1000)
|
||||
assertThat(it.duration).isEqualTo(1000)
|
||||
}
|
||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
||||
awaitItem().let {
|
||||
// Additional spurious state due to MediaPlayer owner change.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isFalse()
|
||||
@@ -143,7 +146,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
}
|
||||
matchReadyState(1_000L)
|
||||
player2.play()
|
||||
awaitItem().let { // it plays until the end.
|
||||
awaitItem().let {
|
||||
// it plays until the end.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -154,7 +158,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
|
||||
// Play player1 again.
|
||||
player1.state.test {
|
||||
awaitItem().let { // Last previous state/
|
||||
awaitItem().let {
|
||||
// Last previous state/
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -162,7 +167,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(it.duration).isEqualTo(1000)
|
||||
}
|
||||
assertThat(player1.prepare().isSuccess).isTrue()
|
||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
||||
awaitItem().let {
|
||||
// Additional spurious state due to MediaPlayer owner change.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isFalse()
|
||||
@@ -171,7 +177,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
}
|
||||
matchReadyState(1_000L)
|
||||
player1.play()
|
||||
awaitItem().let { // it played again until the end.
|
||||
awaitItem().let {
|
||||
// it played again until the end.
|
||||
assertThat(it.isReady).isFalse()
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
assertThat(it.isEnded).isTrue()
|
||||
@@ -189,7 +196,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(player.prepare().isSuccess).isTrue()
|
||||
matchReadyState()
|
||||
player.play()
|
||||
skipItems(1) // skip play state
|
||||
// skip play state
|
||||
skipItems(1)
|
||||
player.pause()
|
||||
awaitItem().let {
|
||||
assertThat(it.isPlaying).isFalse()
|
||||
@@ -206,9 +214,11 @@ class DefaultVoiceMessagePlayerTest {
|
||||
assertThat(player.prepare().isSuccess).isTrue()
|
||||
matchReadyState()
|
||||
player.play()
|
||||
skipItems(1) // skip play state
|
||||
// skip play state
|
||||
skipItems(1)
|
||||
player.pause()
|
||||
skipItems(1) // skip pause state
|
||||
// skip pause state
|
||||
skipItems(1)
|
||||
player.play()
|
||||
awaitItem().let {
|
||||
assertThat(it.isPlaying).isTrue()
|
||||
|
||||
Reference in New Issue
Block a user