Fix any detekt formatting issues

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2023-05-24 09:38:56 +02:00
parent 6bc58e12e4
commit f7e5881d87
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
19 changed files with 76 additions and 63 deletions

View file

@ -245,7 +245,7 @@ class ConversationItem(
model.lastMessage!!.activeUser = user
val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType
.REGULAR_TEXT_MESSAGE
.REGULAR_TEXT_MESSAGE
) {
calculateRegularLastMessageText(appContext)
} else {

View file

@ -45,8 +45,8 @@ import com.stfalcon.chatkit.messages.MessageHolders
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : MessageHolders
.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) :
MessageHolders.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
private val binding: ItemCustomIncomingLinkPreviewMessageBinding =
ItemCustomIncomingLinkPreviewMessageBinding.bind(itemView)

View file

@ -57,8 +57,8 @@ import java.net.URLEncoder
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : MessageHolders
.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) :
MessageHolders.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
private val binding: ItemCustomIncomingLocationMessageBinding =
ItemCustomIncomingLocationMessageBinding.bind(itemView)

View file

@ -45,11 +45,10 @@ import com.stfalcon.chatkit.messages.MessageHolders
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class IncomingPollMessageViewHolder(incomingView: View, payload: Any) : MessageHolders
.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
class IncomingPollMessageViewHolder(incomingView: View, payload: Any) :
MessageHolders.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
private val binding: ItemCustomIncomingPollMessageBinding =
ItemCustomIncomingPollMessageBinding.bind(itemView)
private val binding: ItemCustomIncomingPollMessageBinding = ItemCustomIncomingPollMessageBinding.bind(itemView)
@Inject
lateinit var context: Context

View file

@ -55,8 +55,8 @@ import com.stfalcon.chatkit.messages.MessageHolders
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class IncomingTextMessageViewHolder(itemView: View, payload: Any) : MessageHolders
.IncomingTextMessageViewHolder<ChatMessage>(itemView, payload) {
class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
MessageHolders.IncomingTextMessageViewHolder<ChatMessage>(itemView, payload) {
private val binding: ItemCustomIncomingTextMessageBinding = ItemCustomIncomingTextMessageBinding.bind(itemView)

View file

@ -55,11 +55,10 @@ import java.util.concurrent.ExecutionException
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : MessageHolders
.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) :
MessageHolders.IncomingTextMessageViewHolder<ChatMessage>(incomingView, payload) {
private val binding: ItemCustomIncomingVoiceMessageBinding =
ItemCustomIncomingVoiceMessageBinding.bind(itemView)
private val binding: ItemCustomIncomingVoiceMessageBinding = ItemCustomIncomingVoiceMessageBinding.bind(itemView)
@JvmField
@Inject

View file

@ -44,8 +44,8 @@ import com.stfalcon.chatkit.messages.MessageHolders
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : MessageHolders
.OutcomingTextMessageViewHolder<ChatMessage>(outcomingView, payload) {
class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) :
MessageHolders.OutcomingTextMessageViewHolder<ChatMessage>(outcomingView, payload) {
private val binding: ItemCustomOutcomingLinkPreviewMessageBinding =
ItemCustomOutcomingLinkPreviewMessageBinding.bind(itemView)

View file

@ -54,8 +54,8 @@ import javax.inject.Inject
import kotlin.math.roundToInt
@AutoInjector(NextcloudTalkApplication::class)
class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
.OutcomingTextMessageViewHolder<ChatMessage>(incomingView) {
class OutcomingLocationMessageViewHolder(incomingView: View) :
MessageHolders.OutcomingTextMessageViewHolder<ChatMessage>(incomingView) {
private val binding: ItemCustomOutcomingLocationMessageBinding =
ItemCustomOutcomingLocationMessageBinding.bind(itemView)
private val realView: View = itemView

View file

@ -45,11 +45,10 @@ import com.stfalcon.chatkit.messages.MessageHolders
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class OutcomingPollMessageViewHolder(outcomingView: View, payload: Any) : MessageHolders
.OutcomingTextMessageViewHolder<ChatMessage>(outcomingView, payload) {
class OutcomingPollMessageViewHolder(outcomingView: View, payload: Any) :
MessageHolders.OutcomingTextMessageViewHolder<ChatMessage>(outcomingView, payload) {
private val binding: ItemCustomOutcomingPollMessageBinding =
ItemCustomOutcomingPollMessageBinding.bind(itemView)
private val binding: ItemCustomOutcomingPollMessageBinding = ItemCustomOutcomingPollMessageBinding.bind(itemView)
@Inject
lateinit var context: Context

View file

@ -51,11 +51,10 @@ import java.util.concurrent.ExecutionException
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders
.OutcomingTextMessageViewHolder<ChatMessage>(outcomingView) {
class OutcomingVoiceMessageViewHolder(outcomingView: View) :
MessageHolders.OutcomingTextMessageViewHolder<ChatMessage>(outcomingView) {
private val binding: ItemCustomOutcomingVoiceMessageBinding =
ItemCustomOutcomingVoiceMessageBinding.bind(itemView)
private val binding: ItemCustomOutcomingVoiceMessageBinding = ItemCustomOutcomingVoiceMessageBinding.bind(itemView)
@JvmField
@Inject

View file

@ -3136,6 +3136,7 @@ class ChatActivity :
inner class ReactionAddedObserver : Observer<ReactionAddedModel> {
override fun onSubscribe(d: Disposable) {
// unused atm
}
override fun onNext(reactionAddedModel: ReactionAddedModel) {
@ -3159,6 +3160,7 @@ class ChatActivity :
inner class ReactionDeletedObserver : Observer<ReactionDeletedModel> {
override fun onSubscribe(d: Disposable) {
// unused atm
}
override fun onNext(reactionDeletedModel: ReactionDeletedModel) {

View file

@ -78,13 +78,11 @@ import java.net.CookieManager
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
class AccountVerificationController(args: Bundle? = null) :
BaseController(
R.layout.controller_account_verification,
args
) {
class AccountVerificationController(args: Bundle? = null) : BaseController(
R.layout.controller_account_verification, args
) {
private val binding: ControllerAccountVerificationBinding? by
viewBinding(ControllerAccountVerificationBinding::bind)
viewBinding(ControllerAccountVerificationBinding::bind)
@Inject
lateinit var ncApi: NcApi
@ -294,7 +292,7 @@ class AccountVerificationController(args: Bundle? = null) :
binding?.progressText?.text =
""" ${binding?.progressText?.text}
"""
.trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored)
.trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored)
abortVerification()
}

View file

@ -309,8 +309,7 @@ class ConversationInfoActivity :
requireFutureDateTime = true,
currentDateTime = currentTimeCalendar,
show24HoursView = true,
dateTimeCallback = { _,
dateTime ->
dateTimeCallback = { _, dateTime ->
reconfigureLobbyTimerView(dateTime)
submitLobbyChanges()
}

View file

@ -57,8 +57,7 @@ fun ImageView.loadConversationAvatar(
conversation: Conversation,
ignoreCache: Boolean,
viewThemeUtils: ViewThemeUtils?
): io.reactivex.disposables
.Disposable {
): io.reactivex.disposables.Disposable {
val imageRequestUri = ApiUtils.getUrlForConversationAvatarWithVersion(
1,
user.baseUrl,
@ -100,8 +99,7 @@ fun ImageView.loadUserAvatar(
avatarId: String,
requestBigSize: Boolean = true,
ignoreCache: Boolean
): io.reactivex.disposables
.Disposable {
): io.reactivex.disposables.Disposable {
val imageRequestUri = ApiUtils.getUrlForAvatar(
user.baseUrl,
avatarId,
@ -117,8 +115,7 @@ private fun ImageView.loadAvatarInternal(
url: String,
ignoreCache: Boolean,
errorPlaceholder: Drawable?
): io.reactivex.disposables
.Disposable {
): io.reactivex.disposables.Disposable {
val cachePolicy = if (ignoreCache) {
CachePolicy.WRITE_ONLY
} else {
@ -215,8 +212,11 @@ fun ImageView.loadImage(url: String, user: User, placeholder: Drawable? = null):
return DisposableWrapper(context.imageLoader.enqueue(requestBuilder.build()))
}
fun ImageView.loadAvatarOrImagePreview(url: String, user: User, placeholder: Drawable? = null): io.reactivex
.disposables.Disposable {
fun ImageView.loadAvatarOrImagePreview(
url: String,
user: User,
placeholder: Drawable? = null
): io.reactivex.disposables.Disposable {
return if (url.contains("/avatar/")) {
loadAvatarInternal(user, url, false, null)
} else {

View file

@ -456,9 +456,9 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
Manifest.permission.WRITE_CONTACTS
) == PackageManager.PERMISSION_GRANTED &&
ContextCompat.checkSelfPermission(
context,
Manifest.permission.READ_CONTACTS
) == PackageManager.PERMISSION_GRANTED
context,
Manifest.permission.READ_CONTACTS
) == PackageManager.PERMISSION_GRANTED
) {
WorkManager
.getInstance()
@ -476,9 +476,9 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
Manifest.permission.WRITE_CONTACTS
) != PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(
context,
Manifest.permission.READ_CONTACTS
) != PackageManager.PERMISSION_GRANTED
context,
Manifest.permission.READ_CONTACTS
) != PackageManager.PERMISSION_GRANTED
) {
activity.requestPermissions(
arrayOf(

View file

@ -37,8 +37,7 @@ data class SpreedCapability(
@JsonField(name = ["features"])
var features: List<String>?,
@JsonField(name = ["config"])
var config: HashMap<String, HashMap<String, @RawValue @Contextual
Any>>?
var config: HashMap<String, HashMap<String, @RawValue @Contextual Any>>?
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null)

View file

@ -1,3 +1,22 @@
/*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2023 Tim Krüger <t@timkrueger.me>
*
* 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/>.
*/
package com.nextcloud.talk.models.json.status
enum class StatusType(val string: String) {
@ -5,5 +24,5 @@ enum class StatusType(val string: String) {
OFFLINE("offline"),
DND("dnd"),
AWAY("away"),
INVISIBLE("invisible");
INVISIBLE("invisible")
}

View file

@ -300,13 +300,13 @@ class ProfileActivity : BaseActivity() {
adapter!!.setData(createUserInfoDetails(userInfo))
if (isAllEmpty(
arrayOf(
userInfo?.displayName,
userInfo?.phone,
userInfo?.email,
userInfo?.address,
userInfo?.twitter,
userInfo?.website
)
userInfo?.displayName,
userInfo?.phone,
userInfo?.email,
userInfo?.address,
userInfo?.twitter,
userInfo?.website
)
)
) {
binding.userinfoList.visibility = View.GONE
@ -755,7 +755,7 @@ class ProfileActivity : BaseActivity() {
PHONE("phone", "phoneScope"),
ADDRESS("address", "addressScope"),
WEBSITE("website", "websiteScope"),
TWITTER("twitter", "twitterScope");
TWITTER("twitter", "twitterScope")
}
companion object {

View file

@ -289,8 +289,8 @@ class WebSocketInstance internal constructor(
val (_, roomWebSocketMessage) = LoganSquare.parse(text, JoinedRoomOverallWebSocketMessage::class.java)
if (roomWebSocketMessage != null) {
currentRoomToken = roomWebSocketMessage.roomId
if (roomWebSocketMessage
.roomPropertiesWebSocketMessage != null &&
if (
roomWebSocketMessage.roomPropertiesWebSocketMessage != null &&
!TextUtils.isEmpty(currentRoomToken)
) {
sendRoomJoinedEvent()