mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-28 13:48:12 +00:00
Fix typing indicator rendering.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -141,8 +141,8 @@ class TypingIndicatorDecoration(
|
||||
layout(
|
||||
0,
|
||||
0,
|
||||
typingView.measuredWidth,
|
||||
typingView.measuredHeight
|
||||
measuredWidth,
|
||||
measuredHeight
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user