improve lint/detekt

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-04-05 22:37:57 +02:00 committed by Marcel Hibbe
parent eb961b0452
commit deac2059ff
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
8 changed files with 17 additions and 14 deletions

View file

@ -22,7 +22,6 @@ package com.nextcloud.talk.adapters
import com.nextcloud.talk.models.json.reactions.ReactionVoter
// TODO: replace with proper class with correct data objects
data class ReactionItem(
val reactionVoter: ReactionVoter,
val reaction: String?

View file

@ -32,7 +32,7 @@ data class Status(
var userId: String?,
@JsonField(name = ["message"])
var message: String?,
/* TODO: Change to enum */
/* TODO Change to enum */
@JsonField(name = ["messageId"])
var messageId: String?,
@JsonField(name = ["messageIsPredefined"])
@ -41,7 +41,7 @@ data class Status(
var icon: String?,
@JsonField(name = ["clearAt"])
var clearAt: Long = 0,
/* TODO: Change to enum */
/* TODO Change to enum */
@JsonField(name = ["status"])
var status: String = "offline",
@JsonField(name = ["statusIsUserDefined"])

View file

@ -293,7 +293,7 @@ class ConversationsListBottomDialog(
dialogRouter!!.pushController(
// TODO: refresh conversation list after EntryMenuController finished (throw event? / pass controller
// TODO refresh conversation list after EntryMenuController finished (throw event? / pass controller
// into EntryMenuController to execute fetch data... ?!)
// for example if you set a password, the dialog items should be refreshed for the next time you open it
// without to manually have to refresh the conversations list

View file

@ -36,7 +36,6 @@ import androidx.annotation.NonNull
import androidx.recyclerview.widget.LinearLayoutManager
import autodagger.AutoInjector
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.nextcloud.talk.R
import com.nextcloud.talk.adapters.ReactionItem
import com.nextcloud.talk.adapters.ReactionItemClickListener
import com.nextcloud.talk.adapters.ReactionsAdapter
@ -85,7 +84,7 @@ class ShowReactionsDialog(
var firstEmoji = ""
for ((emoji, amount) in chatMessage.reactions) {
if(firstEmoji.isEmpty()){
if (firstEmoji.isEmpty()) {
firstEmoji = emoji
}
@ -97,7 +96,12 @@ class ShowReactionsDialog(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
params.setMargins(0, 0, EMOJI_RIGHT_MARGIN, 0)
params.setMargins(
DisplayUtils.convertDpToPixel(EMOJI_MARGIN, context).toInt(),
0,
DisplayUtils.convertDpToPixel(EMOJI_MARGIN, context).toInt(),
0
)
params.gravity = Gravity.CENTER
emojiView.layoutParams = params
@ -138,7 +142,6 @@ class ShowReactionsDialog(
if (reactionsOverall.ocs?.data != null) {
for (reactionVoter in reactionsOverall.ocs?.data!![emoji]!!) {
reactionVoters.add(ReactionItem(reactionVoter, emoji))
}
adapter?.list?.addAll(reactionVoters)
adapter?.notifyDataSetChanged()
@ -152,13 +155,14 @@ class ShowReactionsDialog(
}
override fun onComplete() {
// unused atm
}
})
}
override fun onClick(reactionItem: ReactionItem) {
Log.d(TAG, "onClick(reactionItem: ReactionItem): " + reactionItem.reaction)
// TODO: implement removal of users reaction,
// TODO implement removal of users reaction,
// ownership needs to be checked, so only owned
// reactions can be removed upon click
dismiss()
@ -166,7 +170,7 @@ class ShowReactionsDialog(
companion object {
const val TAG = "ShowReactionsDialog"
const val EMOJI_RIGHT_MARGIN: Int = 12
const val EMOJI_MARGIN: Float = 8F
const val EMOJI_SIZE: Float = 30F
}
}

View file

@ -22,7 +22,7 @@ package com.nextcloud.talk.utils
import android.content.Context
// TODO: improve log handling. https://github.com/nextcloud/talk-android/issues/1376
// TODO improve log handling. https://github.com/nextcloud/talk-android/issues/1376
// writing logs to a file is temporarily disabled to avoid huge logfiles.
object LoggingUtils {

View file

@ -243,7 +243,7 @@ public interface AppPreferences {
@KeyByString("phone_book_integration")
void setPhoneBookIntegration(boolean value);
// TODO: Remove in 13.0.0
// TODO Remove in 13.0.0
@KeyByString("link_previews")
@RemoveMethod
void removeLinkPreviews();

View file

@ -151,7 +151,7 @@ public class MagicWebSocketInstance extends WebSocketListener {
public void restartWebSocket() {
reconnecting = true;
// TODO: when improving logging, keep in mind this issue: https://github.com/nextcloud/talk-android/issues/1013
// TODO when improving logging, keep in mind this issue: https://github.com/nextcloud/talk-android/issues/1013
Log.d(TAG, "restartWebSocket: " + connectionUrl);
Request request = new Request.Builder().url(connectionUrl).build();
okHttpClient.newWebSocket(request, this);

View file

@ -1,5 +1,5 @@
build:
maxIssues: 98
maxIssues: 96
weights:
# complexity: 2
# LongParameterList: 1