Skip to content

Commit

Permalink
Merge pull request #4289 from nextcloud/bugfix/4288/fixTypingIndicato…
Browse files Browse the repository at this point in the history
…rPosition

fix position and animation of typing indicator
  • Loading branch information
sowjanyakch authored Oct 1, 2024
2 parents 9f6c6b0 + 94d62a9 commit acd31ec
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1307,16 +1307,16 @@ class ChatActivity :
runOnUiThread {
binding.typingIndicator.text = typingString

if (participantNames.size > 0) {
binding.typingIndicatorWrapper.visibility = View.VISIBLE
binding.typingIndicatorWrapper.animate()
.translationYBy(DisplayUtils.convertDpToPixel(-18f, context))
.setInterpolator(AccelerateDecelerateInterpolator())
.duration = TYPING_INDICATOR_ANIMATION_DURATION
val typingIndicatorPositionY = if (participantNames.size > 0) {
TYPING_INDICATOR_POSITION_VISIBLE
} else {
binding.typingIndicatorWrapper.visibility = View.INVISIBLE
binding.typingIndicatorWrapper.y += DisplayUtils.convertDpToPixel(18f, context)
TYPING_INDICATOR_POSITION_HIDDEN
}

binding.typingIndicatorWrapper.animate()
.translationY(DisplayUtils.convertDpToPixel(typingIndicatorPositionY, context))
.setInterpolator(AccelerateDecelerateInterpolator())
.duration = TYPING_INDICATOR_ANIMATION_DURATION
}
}

Expand Down Expand Up @@ -3696,6 +3696,8 @@ class ChatActivity :
private const val COMMA = ", "
private const val TYPING_INDICATOR_ANIMATION_DURATION = 200L
private const val TYPING_INDICATOR_MAX_NAME_LENGTH = 14
private const val TYPING_INDICATOR_POSITION_VISIBLE = -18f
private const val TYPING_INDICATOR_POSITION_HIDDEN = -1f
private const val TYPING_DURATION_TO_SEND_NEXT_TYPING_MESSAGE = 10000L
private const val TYPING_INTERVAL_TO_SEND_NEXT_TYPING_MESSAGE = 1000L
private const val TYPING_STARTED_SIGNALING_MESSAGE_TYPE = "startedTyping"
Expand Down

0 comments on commit acd31ec

Please sign in to comment.