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 model.lastMessage!!.activeUser = user
val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType
.REGULAR_TEXT_MESSAGE .REGULAR_TEXT_MESSAGE
) { ) {
calculateRegularLastMessageText(appContext) calculateRegularLastMessageText(appContext)
} else { } else {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -37,8 +37,7 @@ data class SpreedCapability(
@JsonField(name = ["features"]) @JsonField(name = ["features"])
var features: List<String>?, var features: List<String>?,
@JsonField(name = ["config"]) @JsonField(name = ["config"])
var config: HashMap<String, HashMap<String, @RawValue @Contextual var config: HashMap<String, HashMap<String, @RawValue @Contextual Any>>?
Any>>?
) : Parcelable { ) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null) 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 package com.nextcloud.talk.models.json.status
enum class StatusType(val string: String) { enum class StatusType(val string: String) {
@ -5,5 +24,5 @@ enum class StatusType(val string: String) {
OFFLINE("offline"), OFFLINE("offline"),
DND("dnd"), DND("dnd"),
AWAY("away"), AWAY("away"),
INVISIBLE("invisible"); INVISIBLE("invisible")
} }

View file

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

View file

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