Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/talk-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2022-04-07 21:41:28 +0300
committerMarcel Hibbe <dev@mhibbe.de>2022-04-08 10:21:14 +0300
commitb4316ecaad173635c26e42a04a7bb3dd3b3fdd56 (patch)
treeee7afe9365393fdc344b8437e362e198f77e019b /app/src/main
parent2068faa80e948445dd5dd4c5a22511c6d375c112 (diff)
fix code checks warnings
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt27
-rw-r--r--app/src/main/java/com/nextcloud/talk/ui/dialog/ShowReactionsDialog.kt10
2 files changed, 32 insertions, 5 deletions
diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
index d2a896684..359c4fc36 100644
--- a/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
+++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
@@ -1,3 +1,26 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Marcel Hibbe
+ * Copyright (C) 2022 Marcel Hibbe (dev@mhibbe.de)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Parts related to account import were either copied from or inspired by the great work done by David Luhmer at:
+ * https://github.com/nextcloud/ownCloud-Account-Importer
+ */
+
package com.nextcloud.talk.adapters.messages
import android.content.Context
@@ -53,6 +76,6 @@ class Reaction {
const val MAX_EMOJIS_TO_DISPLAY = 4
const val EMOJI_START_MARGIN: Float = 2F
const val EMOJI_END_MARGIN: Float = 8F
- const val EMOJI_MORE = "..."
+ const val EMOJI_MORE = "…"
}
-} \ No newline at end of file
+}
diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/ShowReactionsDialog.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/ShowReactionsDialog.kt
index b2cedac7d..ed98b6606 100644
--- a/app/src/main/java/com/nextcloud/talk/ui/dialog/ShowReactionsDialog.kt
+++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/ShowReactionsDialog.kt
@@ -70,7 +70,7 @@ class ShowReactionsDialog(
private var adapter: ReactionsAdapter? = null
- private val TAG_ALL: String? = null
+ private val tagAll: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -103,7 +103,7 @@ class ShowReactionsDialog(
val tab: TabLayout.Tab = binding.emojiReactionsTabs.newTab() // Create a new Tab names "First Tab"
val itemBinding = ItemReactionsTabBinding.inflate(layoutInflater)
- itemBinding.reactionTab.tag = TAG_ALL
+ itemBinding.reactionTab.tag = tagAll
itemBinding.reactionIcon.text = context.getString(R.string.reactions_tab_all)
itemBinding.reactionCount.text = reactionsTotal.toString()
tab.customView = itemBinding.root
@@ -127,7 +127,7 @@ class ShowReactionsDialog(
}
})
- updateParticipantsForEmoji(chatMessage, TAG_ALL)
+ updateParticipantsForEmoji(chatMessage, tagAll)
}
adapter?.notifyDataSetChanged()
}
@@ -228,6 +228,7 @@ class ShowReactionsDialog(
}
class ReactionComparator(val activeUser: String?) : Comparator<ReactionItem> {
+ @Suppress("ReturnCount")
override fun compare(reactionItem1: ReactionItem?, reactionItem2: ReactionItem?): Int {
// sort by emoji, own account, display-name, timestamp, actor-id
@@ -294,6 +295,7 @@ class ShowReactionsDialog(
return 0
}
+ @Suppress("ReturnCount")
fun compareOwnAccount(activeUser: String?, actorId1: String?, actorId2: String?): Int {
val reactionVote1Active = activeUser == actorId1
val reactionVote2Active = activeUser == actorId2
@@ -317,6 +319,7 @@ class ShowReactionsDialog(
}
internal class StringComparator : Comparator<String?> {
+ @Suppress("ReturnCount")
override fun compare(obj1: String?, obj2: String?): Int {
if (obj1 === obj2) {
return 0
@@ -331,6 +334,7 @@ class ShowReactionsDialog(
}
internal class LongComparator : Comparator<Long?> {
+ @Suppress("ReturnCount")
override fun compare(obj1: Long?, obj2: Long?): Int {
if (obj1 === obj2) {
return 0