Skip to content

Commit b4c0b5e

Browse files
committed
fix: resolve detekt and ktlint violations
Signed-off-by: David Leibovych <ariedov@gmail.com>
1 parent c483029 commit b4c0b5e

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
@@ -264,6 +264,11 @@ class ChatActivity :
264264
SystemMessageInterface,
265265
CallStartedMessageInterface {
266266

267+
companion object {
268+
private const val NOTIFICATION_LEVEL_ALWAYS = 1
269+
private const val NOTIFICATION_LEVEL_NEVER = 3
270+
}
271+
267272
var active = false
268273

269274
private lateinit var binding: ActivityChatBinding
@@ -3322,8 +3327,8 @@ class ChatActivity :
33223327
hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.THREADS)
33233328

33243329
val threadNotificationIcon = when (conversationThreadInfo?.attendee?.notificationLevel) {
3325-
1 -> R.drawable.outline_notifications_active_24
3326-
3 -> R.drawable.ic_baseline_notifications_off_24
3330+
NOTIFICATION_LEVEL_ALWAYS -> R.drawable.outline_notifications_active_24
3331+
NOTIFICATION_LEVEL_NEVER -> R.drawable.ic_baseline_notifications_off_24
33273332
else -> R.drawable.baseline_notifications_24
33283333
}
33293334
threadNotificationItem.icon = ContextCompat.getDrawable(context, threadNotificationIcon)
@@ -3429,7 +3434,7 @@ class ChatActivity :
34293434
subtitle = null,
34303435
icon = R.drawable.ic_baseline_notifications_off_24,
34313436
onClick = {
3432-
setThreadNotificationLevel(3)
3437+
setThreadNotificationLevel(NOTIFICATION_LEVEL_NEVER)
34333438
}
34343439
)
34353440
)
@@ -4100,7 +4105,7 @@ class ChatActivity :
41004105
displayName = currentConversation?.displayName ?: ""
41014106
)
41024107
showSnackBar(roomToken)
4103-
} catch (e: Exception) {
4108+
} catch (e: IOException) {
41044109
Log.w(TAG, "File corresponding to the uri does not exist $shareUri", e)
41054110
downloadFileToCache(message, false) {
41064111
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
@@ -325,7 +325,6 @@ class ComposeChatAdapter(
325325
}
326326

327327
ChatMessage.MessageType.FILE_UPLOAD_MESSAGE -> {
328-
329328
}
330329

331330
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)