Replace any magic numbers detekt-ed

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2023-05-24 09:47:27 +02:00
parent f7e5881d87
commit c6e082c6b1
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
3 changed files with 10 additions and 4 deletions

View File

@ -258,7 +258,7 @@ class CallNotificationActivity : CallBaseActivity() {
notificationHandler.post(object : Runnable {
override fun run() {
if (NotificationUtils.isNotificationVisible(context, notificationTimestamp!!.toInt())) {
notificationHandler.postDelayed(this, 1000)
notificationHandler.postDelayed(this, ONE_SECOND)
} else {
finish()
}
@ -320,5 +320,6 @@ class CallNotificationActivity : CallBaseActivity() {
companion object {
const val TAG = "CallNotificationActivity"
const val GET_ROOM_RETRY_COUNT: Long = 3
const val ONE_SECOND: Long = 1000
}
}

View File

@ -124,7 +124,7 @@ class ReactionAnimator(
val emojiView = EmojiTextView(context)
emojiView.text = callReaction.emoji
emojiView.textSize = 20f
emojiView.textSize = TEXT_SIZE
val nameView = getNameView(callReaction)
reactionWrapper.addView(emojiView)
@ -141,7 +141,7 @@ class ReactionAnimator(
ViewGroup.LayoutParams.WRAP_CONTENT
)
nameViewParams.setMargins(20, 0, 20, 5)
nameViewParams.setMargins(HORIZONTAL_MARGIN, 0, HORIZONTAL_MARGIN, BOTTOM_MARGIN)
nameView.layoutParams = nameViewParams
nameView.text = " " + callReaction.userName + " "
@ -176,6 +176,10 @@ class ReactionAnimator(
private const val ZERO_ALPHA = 0f
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(

View File

@ -118,7 +118,7 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee
availableReactions.forEach {
val emojiView = EmojiTextView(context)
emojiView.text = it.toString()
emojiView.textSize = 20f
emojiView.textSize = TEXT_SIZE
emojiView.layoutParams = param
emojiView.setOnClickListener { view ->
@ -198,5 +198,6 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee
companion object {
private const val TAG = "MoreCallActionsDialog"
private const val TEXT_SIZE = 20f
}
}