From 6c2a8d39949b88a255f105c47e939628fb656bfb Mon Sep 17 00:00:00 2001 From: sowjanyakch Date: Thu, 28 Nov 2024 09:46:41 +0100 Subject: [PATCH] ktlintFormat Signed-off-by: sowjanyakch --- .../com/nextcloud/talk/adapters/items/ParticipantItem.kt | 3 ++- .../talk/adapters/messages/IncomingDeckCardViewHolder.kt | 4 +--- .../messages/IncomingLinkPreviewMessageViewHolder.kt | 3 --- .../adapters/messages/IncomingPollMessageViewHolder.kt | 3 --- .../adapters/messages/IncomingTextMessageViewHolder.kt | 5 ----- .../adapters/messages/IncomingVoiceMessageViewHolder.kt | 3 --- .../openconversations/ListOpenConversationsActivity.kt | 8 ++++---- .../java/com/nextcloud/talk/utils/ChatMessageUtils.kt | 2 +- .../talk/utils/preferences/AppPreferencesImpl.kt | 8 +++++--- 9 files changed, 13 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt index 4b58041ab00..8ddbbbcb55c 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt @@ -134,7 +134,8 @@ class ParticipantItem( } if (model.invitedActorId?.isNotEmpty() == true && - ConversationUtils.isParticipantOwnerOrModerator(conversation)) { + ConversationUtils.isParticipantOwnerOrModerator(conversation) + ) { holder.binding.conversationInfoStatusMessage.text = model.invitedActorId alignUsernameVertical(holder, 0f) } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingDeckCardViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingDeckCardViewHolder.kt index 771001cca5d..677aaebfb92 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingDeckCardViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingDeckCardViewHolder.kt @@ -26,9 +26,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.chat.data.model.ChatMessage import com.nextcloud.talk.databinding.ItemCustomIncomingDeckCardMessageBinding -import com.nextcloud.talk.extensions.loadBotsAvatar -import com.nextcloud.talk.extensions.loadChangelogBotAvatar -import com.nextcloud.talk.extensions.loadFederatedUserAvatar import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.ChatMessageUtils @@ -122,6 +119,7 @@ class IncomingDeckCardViewHolder(incomingView: View, payload: Any) : MessageHold ) } + @SuppressLint("StringFormatInvalid") private fun showDeckCard(message: ChatMessage) { if (message.messageParameters != null && message.messageParameters!!.size > 0) { for (key in message.messageParameters!!.keys) { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt index 53f6506a6af..60b25e4f0f9 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt @@ -23,9 +23,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.chat.data.model.ChatMessage import com.nextcloud.talk.databinding.ItemCustomIncomingLinkPreviewMessageBinding -import com.nextcloud.talk.extensions.loadBotsAvatar -import com.nextcloud.talk.extensions.loadChangelogBotAvatar -import com.nextcloud.talk.extensions.loadFederatedUserAvatar import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.ChatMessageUtils diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt index 59b626df8ad..3d5d95cd2d1 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt @@ -22,9 +22,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.chat.data.model.ChatMessage import com.nextcloud.talk.databinding.ItemCustomIncomingPollMessageBinding -import com.nextcloud.talk.extensions.loadBotsAvatar -import com.nextcloud.talk.extensions.loadChangelogBotAvatar -import com.nextcloud.talk.extensions.loadFederatedUserAvatar import com.nextcloud.talk.polls.ui.PollMainDialogFragment import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt index b3565de23a3..ea451ef2d6d 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt @@ -24,11 +24,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.chat.data.model.ChatMessage import com.nextcloud.talk.databinding.ItemCustomIncomingTextMessageBinding -import com.nextcloud.talk.extensions.loadBotsAvatar -import com.nextcloud.talk.extensions.loadChangelogBotAvatar -import com.nextcloud.talk.extensions.loadDefaultAvatar -import com.nextcloud.talk.extensions.loadFederatedUserAvatar -import com.nextcloud.talk.extensions.loadFirstLetterAvatar import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.ChatMessageUtils diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt index 36155bf0931..617f5f90696 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt @@ -27,9 +27,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.chat.data.model.ChatMessage import com.nextcloud.talk.databinding.ItemCustomIncomingVoiceMessageBinding -import com.nextcloud.talk.extensions.loadBotsAvatar -import com.nextcloud.talk.extensions.loadChangelogBotAvatar -import com.nextcloud.talk.extensions.loadFederatedUserAvatar import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.ChatMessageUtils diff --git a/app/src/main/java/com/nextcloud/talk/openconversations/ListOpenConversationsActivity.kt b/app/src/main/java/com/nextcloud/talk/openconversations/ListOpenConversationsActivity.kt index 1d74209ac7c..df11dfe632f 100644 --- a/app/src/main/java/com/nextcloud/talk/openconversations/ListOpenConversationsActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/openconversations/ListOpenConversationsActivity.kt @@ -70,9 +70,9 @@ class ListOpenConversationsActivity : BaseActivity() { } binding.searchEdit.doOnTextChanged { text, _, _, count -> adapter.filter(text.toString()) - if(text.toString().isNotEmpty() && searching){ + if (text.toString().isNotEmpty() && searching) { binding.clearSearchButton.visibility = View.VISIBLE - }else{ + } else { binding.clearSearchButton.visibility = View.GONE } } @@ -98,10 +98,10 @@ class ListOpenConversationsActivity : BaseActivity() { } } - private fun showOrHideClearButton(){ + private fun showOrHideClearButton() { if (!binding.searchEdit.text.isNullOrEmpty()) { binding.clearSearchButton.visibility = View.VISIBLE - }else{ + } else { binding.clearSearchButton.visibility = View.GONE } } diff --git a/app/src/main/java/com/nextcloud/talk/utils/ChatMessageUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/ChatMessageUtils.kt index 92a8827d865..4d4425d12c5 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/ChatMessageUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/ChatMessageUtils.kt @@ -18,7 +18,7 @@ import com.nextcloud.talk.ui.theme.ViewThemeUtils class ChatMessageUtils { - fun setAvatarOnMessage(view: ImageView, message: ChatMessage, viewThemeUtils : ViewThemeUtils) { + fun setAvatarOnMessage(view: ImageView, message: ChatMessage, viewThemeUtils: ViewThemeUtils) { view.visibility = View.VISIBLE if (message.actorType == "guests" || message.actorType == "emails") { if (message.actorDisplayName?.isNotEmpty() == true) { diff --git a/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt b/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt index a576fe9a0b4..1b6725162c3 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt @@ -545,9 +545,11 @@ class AppPreferencesImpl(val context: Context) : AppPreferences { } override fun getShowNotificationWarning(): Boolean { - return runBlocking { async { - readBoolean(SHOW_NOTIFICATION_WARNING, true).first() - } }.getCompleted() + return runBlocking { + async { + readBoolean(SHOW_NOTIFICATION_WARNING, true).first() + } + }.getCompleted() } override fun setShowNotificationWarning(showNotificationWarning: Boolean) =