Fix typing indicator rendering.

This commit is contained in:
Alex Hart
2023-08-21 14:22:08 -03:00
parent acb24fd265
commit 372104cdfe
3 changed files with 9 additions and 10 deletions

View File

@@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.components
import android.content.Context
import android.graphics.Canvas
import android.graphics.Path
import android.graphics.Rect
import android.graphics.RectF
import android.util.AttributeSet
import androidx.core.graphics.withClip
@@ -18,15 +17,15 @@ class ClippedCardView @JvmOverloads constructor(
attrs: AttributeSet? = null
) : MaterialCardView(context, attrs) {
private val bounds = Rect()
private val boundsF = RectF()
private val path = Path()
override fun draw(canvas: Canvas) {
canvas.getClipBounds(bounds)
boundsF.set(bounds)
path.reset()
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
boundsF.set(0f, 0f, w.toFloat(), h.toFloat())
}
override fun draw(canvas: Canvas) {
path.reset()
path.addRoundRect(boundsF, radius, radius, Path.Direction.CW)
canvas.withClip(path) {
super.draw(canvas)

View File

@@ -141,8 +141,8 @@ class TypingIndicatorDecoration(
layout(
0,
0,
typingView.measuredWidth,
typingView.measuredHeight
measuredWidth,
measuredHeight
)
}
}