Update plugin ktlint to v12.1.0 (#2200)

* Update plugin ktlint to v12.1.0

* Run `./gradlew ktlintFormat` and fix some issues manually.

* Fix other issues reproted by Ktlint

* Limit false positives, KtLint removes unnecessary curly brace in String templates.

* Remove useless Unit

* Minor improvements over ktlint changes

* Restore `AlertDialogContent` behaviour

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
renovate[bot] 2024-01-10 16:22:24 +01:00 committed by GitHub
parent 675cc525cf
commit 7e9cda3aa9
442 changed files with 1091 additions and 1081 deletions

View file

@ -20,7 +20,7 @@ import io.element.android.libraries.push.impl.notifications.model.NotifiableEven
import javax.inject.Inject
class FilteredEventDetector @Inject constructor(
//private val activeSessionDataSource: ActiveSessionDataSource
// private val activeSessionDataSource: ActiveSessionDataSource
) {
/**

View file

@ -17,9 +17,9 @@
package io.element.android.libraries.push.impl.notifications
data class NotificationAction(
val shouldNotify: Boolean,
val highlight: Boolean,
val soundName: String?
val shouldNotify: Boolean,
val highlight: Boolean,
val soundName: String?
)
/*

View file

@ -20,7 +20,7 @@ import io.element.android.libraries.push.impl.notifications.model.NotifiableEven
import javax.inject.Inject
class OutdatedEventDetector @Inject constructor(
/// private val activeSessionDataSource: ActiveSessionDataSource
// / private val activeSessionDataSource: ActiveSessionDataSource
) {
/**

View file

@ -73,7 +73,7 @@ class SummaryGroupMessageCreator @Inject constructor(
val nbEvents = roomNotifications.size + simpleNotifications.size
val sumTitle = stringProvider.getQuantityString(R.plurals.notification_compat_summary_title, nbEvents, nbEvents)
summaryInboxStyle.setBigContentTitle(sumTitle.annotateForDebug(43))
//.setSummaryText(stringProvider.getQuantityString(R.plurals.notification_unread_notified_messages, nbEvents, nbEvents).annotateForDebug(44))
// .setSummaryText(stringProvider.getQuantityString(R.plurals.notification_unread_notified_messages, nbEvents, nbEvents).annotateForDebug(44))
// Use account name now, for multi-session
.setSummaryText(currentUser.userId.value.annotateForDebug(44))
return if (useCompleteNotificationFormat) {
@ -119,7 +119,8 @@ class SummaryGroupMessageCreator @Inject constructor(
// Invitation and message
val messageStr = stringProvider.getQuantityString(
R.plurals.notification_new_messages_for_room,
messageNotificationCount, messageNotificationCount
messageNotificationCount,
messageNotificationCount
)
if (roomCount > 1) {
// In several rooms

View file

@ -91,7 +91,8 @@ class NotificationChannels @Inject constructor(
enableVibration(true)
enableLights(true)
lightColor = accentColor
})
}
)
/**
* Low notification importance: shows everywhere, but is not intrusive.
@ -107,7 +108,8 @@ class NotificationChannels @Inject constructor(
setSound(null, null)
enableLights(true)
lightColor = accentColor
})
}
)
notificationManager.createNotificationChannel(
NotificationChannel(
@ -119,7 +121,8 @@ class NotificationChannels @Inject constructor(
description = stringProvider.getString(R.string.notification_channel_listening_for_events)
setSound(null, null)
setShowBadge(false)
})
}
)
notificationManager.createNotificationChannel(
NotificationChannel(
@ -132,7 +135,8 @@ class NotificationChannels @Inject constructor(
setSound(null, null)
enableLights(true)
lightColor = accentColor
})
}
)
}
private fun getChannel(channelId: String): NotificationChannel? {

View file

@ -71,9 +71,9 @@ fun NotifiableEvent.shouldIgnoreEventInRoom(appNavigationState: AppNavigationSta
val currentSessionId = appNavigationState.navigationState.currentSessionId() ?: return false
return when (val currentRoomId = appNavigationState.navigationState.currentRoomId()) {
null -> false
else -> appNavigationState.isInForeground
&& sessionId == currentSessionId
&& roomId == currentRoomId
&& (this as? NotifiableMessageEvent)?.threadId == appNavigationState.navigationState.currentThreadId()
else -> appNavigationState.isInForeground &&
sessionId == currentSessionId &&
roomId == currentRoomId &&
(this as? NotifiableMessageEvent)?.threadId == appNavigationState.navigationState.currentThreadId()
}
}

View file

@ -15,7 +15,6 @@
*/
package io.element.android.libraries.push.impl.pushgateway
import retrofit2.http.Body
import retrofit2.http.POST