Skip to content

Commit

Permalink
Fixed Codacy errors
Browse files Browse the repository at this point in the history
Signed-off-by: Smarshal21 <[email protected]>
  • Loading branch information
Smarshal21 committed Nov 14, 2023
1 parent ec1108c commit c173c70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import androidx.emoji2.widget.EmojiTextView
import com.nextcloud.talk.R
import com.nextcloud.talk.ui.theme.ViewThemeUtils


class ReactionAnimator(
val context: Context,
private val startPointView: RelativeLayout,
Expand All @@ -63,7 +62,6 @@ class ReactionAnimator(
callReaction: CallReaction
) {
val reactionWrapper = getReactionWrapperView(callReaction)

val params = RelativeLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
Expand Down Expand Up @@ -100,7 +98,6 @@ class ReactionAnimator(

val animatorWithFullAlpha = AnimatorSet()
animatorWithFullAlpha.play(moveWithFullAlpha)

animatorWithFullAlpha.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
reactionsList.remove(callReaction)
Expand Down Expand Up @@ -183,6 +180,7 @@ class ReactionAnimator(
private const val BOTTOM_MARGIN: Int = 5
}
}

data class CallReaction(
var emoji: String,
var userName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ class MessageActionsDialog(

private lateinit var dialogMessageActionsBinding: DialogMessageActionsBinding

// private lateinit var popup: EmojiPopup

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
Expand Down Expand Up @@ -141,8 +139,8 @@ class MessageActionsDialog(
true
}

dialogMessageActionsBinding.emojiMore.setOnClickListener { toggleEmojiPopup()}
dialogMessageActionsBinding.emojiPicker.setOnEmojiPickedListener(){
dialogMessageActionsBinding.emojiMore.setOnClickListener { toggleEmojiPopup() }
dialogMessageActionsBinding.emojiPicker.setOnEmojiPickedListener() {
clickOnEmoji(message, it.emoji)
}
}
Expand Down Expand Up @@ -300,6 +298,7 @@ class MessageActionsDialog(

dialogMessageActionsBinding.menuTranslateMessage.visibility = getVisibility(visible)
}

private fun initMenuShare(visible: Boolean) {
if (visible) {
dialogMessageActionsBinding.menuShare.setOnClickListener {
Expand Down Expand Up @@ -399,7 +398,6 @@ class MessageActionsDialog(
}
}


companion object {
private val TAG = MessageActionsDialog::class.java.simpleName
private const val ACTOR_LENGTH = 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ class SetStatusDialogFragment : DialogFragment(), PredefinedStatusClickListener
)
predefinedStatusOverall.ocs?.data?.let { it1 -> predefinedStatusesList.addAll(it1) }

if (currentStatus?.messageIsPredefined == true && currentStatus?.messageId?.isNotEmpty() == true) {
if (currentStatus?.messageIsPredefined == true &&
currentStatus?.messageId?.isNotEmpty() == true
) {
val messageId = currentStatus!!.messageId
selectedPredefinedStatus = predefinedStatusesList.firstOrNull { ps -> messageId == ps.id }
}
Expand Down Expand Up @@ -454,7 +456,10 @@ class SetStatusDialogFragment : DialogFragment(), PredefinedStatusClickListener
// The endpoint '/message/custom' expects a valid emoji as string or null
val statusIcon = binding.emoji.text.toString().ifEmpty { null }

if (selectedPredefinedStatus == null || selectedPredefinedStatus!!.message != inputText || selectedPredefinedStatus!!.icon != binding.emoji.text.toString()) {
if (selectedPredefinedStatus == null ||
selectedPredefinedStatus!!.message != inputText ||
selectedPredefinedStatus!!.icon != binding.emoji.text.toString()
) {
ncApi.setCustomStatusMessage(
credentials, ApiUtils.getUrlForSetCustomStatus(currentUser?.baseUrl), statusIcon, inputText, clearAt
).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
Expand Down

0 comments on commit c173c70

Please sign in to comment.