mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-26 07:00:02 +01:00
Merge pull request #3048 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-formatting-1.23.0
Build(deps): Bump io.gitlab.arturbosch.detekt:detekt-formatting from 1.22.0 to 1.23.0
This commit is contained in:
commit
6e2c01234b
@ -160,7 +160,7 @@ configurations.all {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
|
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.0")
|
||||||
|
|
||||||
implementation fileTree(include: ['*'], dir: 'libs')
|
implementation fileTree(include: ['*'], dir: 'libs')
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
|||||||
notificationHandler.post(object : Runnable {
|
notificationHandler.post(object : Runnable {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (NotificationUtils.isNotificationVisible(context, notificationTimestamp!!.toInt())) {
|
if (NotificationUtils.isNotificationVisible(context, notificationTimestamp!!.toInt())) {
|
||||||
notificationHandler.postDelayed(this, 1000)
|
notificationHandler.postDelayed(this, ONE_SECOND)
|
||||||
} else {
|
} else {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
@ -320,5 +320,6 @@ class CallNotificationActivity : CallBaseActivity() {
|
|||||||
companion object {
|
companion object {
|
||||||
const val TAG = "CallNotificationActivity"
|
const val TAG = "CallNotificationActivity"
|
||||||
const val GET_ROOM_RETRY_COUNT: Long = 3
|
const val GET_ROOM_RETRY_COUNT: Long = 3
|
||||||
|
const val ONE_SECOND: Long = 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -244,13 +244,14 @@ class ConversationItem(
|
|||||||
} else {
|
} else {
|
||||||
model.lastMessage!!.activeUser = user
|
model.lastMessage!!.activeUser = user
|
||||||
|
|
||||||
val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType
|
val text =
|
||||||
.REGULAR_TEXT_MESSAGE
|
if (
|
||||||
) {
|
model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType.REGULAR_TEXT_MESSAGE
|
||||||
calculateRegularLastMessageText(appContext)
|
) {
|
||||||
} else {
|
calculateRegularLastMessageText(appContext)
|
||||||
model.lastMessage!!.lastMessageDisplayText
|
} else {
|
||||||
}
|
model.lastMessage!!.lastMessageDisplayText
|
||||||
|
}
|
||||||
holder.binding.dialogLastMessage.text = text
|
holder.binding.dialogLastMessage.text = text
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -124,7 +124,7 @@ class ReactionAnimator(
|
|||||||
|
|
||||||
val emojiView = EmojiTextView(context)
|
val emojiView = EmojiTextView(context)
|
||||||
emojiView.text = callReaction.emoji
|
emojiView.text = callReaction.emoji
|
||||||
emojiView.textSize = 20f
|
emojiView.textSize = TEXT_SIZE
|
||||||
|
|
||||||
val nameView = getNameView(callReaction)
|
val nameView = getNameView(callReaction)
|
||||||
reactionWrapper.addView(emojiView)
|
reactionWrapper.addView(emojiView)
|
||||||
@ -141,7 +141,7 @@ class ReactionAnimator(
|
|||||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
)
|
)
|
||||||
|
|
||||||
nameViewParams.setMargins(20, 0, 20, 5)
|
nameViewParams.setMargins(HORIZONTAL_MARGIN, 0, HORIZONTAL_MARGIN, BOTTOM_MARGIN)
|
||||||
nameView.layoutParams = nameViewParams
|
nameView.layoutParams = nameViewParams
|
||||||
|
|
||||||
nameView.text = " " + callReaction.userName + " "
|
nameView.text = " " + callReaction.userName + " "
|
||||||
@ -176,6 +176,10 @@ class ReactionAnimator(
|
|||||||
|
|
||||||
private const val ZERO_ALPHA = 0f
|
private const val ZERO_ALPHA = 0f
|
||||||
private const val ALPHA_PROPERTY = "alpha"
|
private const val ALPHA_PROPERTY = "alpha"
|
||||||
|
|
||||||
|
private const val TEXT_SIZE = 20f
|
||||||
|
private const val HORIZONTAL_MARGIN: Int = 20
|
||||||
|
private const val BOTTOM_MARGIN: Int = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data class CallReaction(
|
data class CallReaction(
|
||||||
|
@ -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) {
|
||||||
|
@ -78,13 +78,13 @@ 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,
|
||||||
R.layout.controller_account_verification,
|
args
|
||||||
args
|
) {
|
||||||
) {
|
private val binding: ControllerAccountVerificationBinding? by viewBinding(
|
||||||
private val binding: ControllerAccountVerificationBinding? by
|
ControllerAccountVerificationBinding::bind
|
||||||
viewBinding(ControllerAccountVerificationBinding::bind)
|
)
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var ncApi: NcApi
|
lateinit var ncApi: NcApi
|
||||||
@ -291,10 +291,8 @@ class AccountVerificationController(args: Bundle? = null) :
|
|||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
binding?.progressText?.text =
|
binding?.progressText?.text = """ ${binding?.progressText?.text}""".trimIndent() +
|
||||||
""" ${binding?.progressText?.text}
|
resources!!.getString(R.string.nc_display_name_not_stored)
|
||||||
"""
|
|
||||||
.trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored)
|
|
||||||
abortVerification()
|
abortVerification()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -451,40 +451,26 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||||||
const val DELETE_ALL = "DELETE_ALL"
|
const val DELETE_ALL = "DELETE_ALL"
|
||||||
|
|
||||||
fun run(context: Context) {
|
fun run(context: Context) {
|
||||||
if (ContextCompat.checkSelfPermission(
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) ==
|
||||||
context,
|
PackageManager.PERMISSION_GRANTED &&
|
||||||
Manifest.permission.WRITE_CONTACTS
|
ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) ==
|
||||||
) == PackageManager.PERMISSION_GRANTED &&
|
PackageManager.PERMISSION_GRANTED
|
||||||
ContextCompat.checkSelfPermission(
|
|
||||||
context,
|
|
||||||
Manifest.permission.READ_CONTACTS
|
|
||||||
) == PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
) {
|
||||||
WorkManager
|
WorkManager.getInstance().enqueue(
|
||||||
.getInstance()
|
OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
|
||||||
.enqueue(
|
.setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build()).build()
|
||||||
OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
|
)
|
||||||
.setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build())
|
|
||||||
.build()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkPermission(activity: Activity, context: Context): Boolean {
|
fun checkPermission(activity: Activity, context: Context): Boolean {
|
||||||
if (ContextCompat.checkSelfPermission(
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) !=
|
||||||
context,
|
PackageManager.PERMISSION_GRANTED ||
|
||||||
Manifest.permission.WRITE_CONTACTS
|
ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) !=
|
||||||
) != PackageManager.PERMISSION_GRANTED ||
|
PackageManager.PERMISSION_GRANTED
|
||||||
ContextCompat.checkSelfPermission(
|
|
||||||
context,
|
|
||||||
Manifest.permission.READ_CONTACTS
|
|
||||||
) != PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
) {
|
||||||
activity.requestPermissions(
|
activity.requestPermissions(
|
||||||
arrayOf(
|
arrayOf(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS),
|
||||||
Manifest.permission.WRITE_CONTACTS,
|
|
||||||
Manifest.permission.READ_CONTACTS
|
|
||||||
),
|
|
||||||
REQUEST_PERMISSION
|
REQUEST_PERMISSION
|
||||||
)
|
)
|
||||||
return false
|
return false
|
||||||
|
@ -37,8 +37,15 @@ 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<
|
||||||
Any>>?
|
String,
|
||||||
|
HashMap<
|
||||||
|
String,
|
||||||
|
@RawValue
|
||||||
|
@Contextual
|
||||||
|
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)
|
||||||
|
@ -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")
|
||||||
}
|
}
|
||||||
|
@ -298,15 +298,16 @@ class ProfileActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
binding.loadingContent.visibility = View.VISIBLE
|
binding.loadingContent.visibility = View.VISIBLE
|
||||||
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 +756,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 {
|
||||||
|
@ -118,7 +118,7 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee
|
|||||||
availableReactions.forEach {
|
availableReactions.forEach {
|
||||||
val emojiView = EmojiTextView(context)
|
val emojiView = EmojiTextView(context)
|
||||||
emojiView.text = it.toString()
|
emojiView.text = it.toString()
|
||||||
emojiView.textSize = 20f
|
emojiView.textSize = TEXT_SIZE
|
||||||
emojiView.layoutParams = param
|
emojiView.layoutParams = param
|
||||||
|
|
||||||
emojiView.setOnClickListener { view ->
|
emojiView.setOnClickListener { view ->
|
||||||
@ -198,5 +198,6 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "MoreCallActionsDialog"
|
private const val TAG = "MoreCallActionsDialog"
|
||||||
|
private const val TEXT_SIZE = 20f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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()
|
||||||
|
@ -38,7 +38,7 @@ buildscript {
|
|||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-serialization:${kotlinVersion}"
|
classpath "org.jetbrains.kotlin:kotlin-serialization:${kotlinVersion}"
|
||||||
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14'
|
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14'
|
||||||
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0"
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.0"
|
||||||
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.2"
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.2"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
build:
|
build:
|
||||||
maxIssues: 80
|
maxIssues: 73
|
||||||
weights:
|
weights:
|
||||||
# complexity: 2
|
# complexity: 2
|
||||||
# LongParameterList: 1
|
# LongParameterList: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user