Skip to content

Commit 395b571

Browse files
committed
fix: resolve detekt and ktlint violations
Signed-off-by: David Leibovych <[email protected]>
1 parent 54808d8 commit 395b571

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ class ChatActivity :
262262
SystemMessageInterface,
263263
CallStartedMessageInterface {
264264

265+
companion object {
266+
private const val NOTIFICATION_LEVEL_ALWAYS = 1
267+
private const val NOTIFICATION_LEVEL_NEVER = 3
268+
}
269+
265270
var active = false
266271

267272
private lateinit var binding: ActivityChatBinding
@@ -3316,8 +3321,8 @@ class ChatActivity :
33163321
hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.THREADS)
33173322

33183323
val threadNotificationIcon = when (conversationThreadInfo?.attendee?.notificationLevel) {
3319-
1 -> R.drawable.outline_notifications_active_24
3320-
3 -> R.drawable.ic_baseline_notifications_off_24
3324+
NOTIFICATION_LEVEL_ALWAYS -> R.drawable.outline_notifications_active_24
3325+
NOTIFICATION_LEVEL_NEVER -> R.drawable.ic_baseline_notifications_off_24
33213326
else -> R.drawable.baseline_notifications_24
33223327
}
33233328
threadNotificationItem.icon = ContextCompat.getDrawable(context, threadNotificationIcon)
@@ -3423,7 +3428,7 @@ class ChatActivity :
34233428
subtitle = null,
34243429
icon = R.drawable.ic_baseline_notifications_off_24,
34253430
onClick = {
3426-
setThreadNotificationLevel(3)
3431+
setThreadNotificationLevel(NOTIFICATION_LEVEL_NEVER)
34273432
}
34283433
)
34293434
)
@@ -4094,7 +4099,7 @@ class ChatActivity :
40944099
displayName = currentConversation?.displayName ?: ""
40954100
)
40964101
showSnackBar(roomToken)
4097-
} catch (e: Exception) {
4102+
} catch (e: IOException) {
40984103
Log.w(TAG, "File corresponding to the uri does not exist $shareUri", e)
40994104
downloadFileToCache(message, false) {
41004105
uploadFile(

app/src/main/java/com/nextcloud/talk/chat/data/model/ChatMessage.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ data class ChatMessage(
148148
MessageType.SINGLE_NC_GEOLOCATION_MESSAGE,
149149
MessageType.VOICE_MESSAGE,
150150
MessageType.POLL_MESSAGE,
151-
MessageType.DECK_CARD,
152-
151+
MessageType.DECK_CARD
153152
)
154153

155154
fun isDeckCard(): Boolean {

app/src/main/java/com/nextcloud/talk/conversationlist/viewmodels/ConversationsListViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class ConversationsListViewModel @Inject constructor(
150150
followedThreadsExistNew.toString(),
151151
""
152152
)
153-
} catch (exception: Exception) {
153+
} catch (exception: Throwable) {
154154
_threadsExistState.value = ThreadsExistUiState.Error(exception)
155155
}
156156
}

app/src/main/java/com/nextcloud/talk/ui/ComposeChatAdapter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ class ComposeChatAdapter(
323323
}
324324

325325
ChatMessage.MessageType.FILE_UPLOAD_MESSAGE -> {
326-
327326
}
328327

329328
ChatMessage.MessageType.REGULAR_TEXT_MESSAGE -> {

app/src/main/java/third/parties/fresco/BetterImageSpan.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ open class BetterImageSpan @JvmOverloads constructor(
2828
val drawable: Drawable,
2929
@param:BetterImageSpanAlignment private val mAlignment: Int = ALIGN_BASELINE
3030
) : ReplacementSpan() {
31-
@IntDef(*[ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER])
31+
@IntDef(ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER)
3232
@Retention(AnnotationRetention.SOURCE)
3333
annotation class BetterImageSpanAlignment
3434

0 commit comments

Comments
 (0)