From 2ef1f83e6d7bc6705f3688372437b07ae0b1973b Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 10 Jun 2021 10:18:37 +1000 Subject: [PATCH] Fix clipping --- .../conversation/v2/ConversationRecyclerView.kt | 11 ++++++++--- .../conversation/v2/messages/VisibleMessageView.kt | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationRecyclerView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationRecyclerView.kt index 4cdf883967..05db29ee95 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationRecyclerView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationRecyclerView.kt @@ -5,14 +5,19 @@ import android.util.AttributeSet import android.view.MotionEvent import android.view.VelocityTracker import androidx.recyclerview.widget.RecyclerView +import org.thoughtcrime.securesms.loki.utilities.disableClipping import kotlin.math.abs class ConversationRecyclerView : RecyclerView { private var velocityTracker: VelocityTracker? = null - constructor(context: Context) : super(context) - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context) : super(context) { initialize() } + constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { initialize() } + constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { initialize() } + + private fun initialize() { + disableClipping() + } override fun onInterceptTouchEvent(e: MotionEvent): Boolean { return false diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt index 968d91d425..01a54d4484 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt @@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.conversation.v2.messages import android.content.Context import android.graphics.Canvas import android.graphics.Rect +import android.graphics.Region import android.graphics.drawable.ColorDrawable import android.os.Build import android.os.Handler @@ -12,6 +13,7 @@ import android.util.Log import android.view.* import android.widget.LinearLayout import androidx.core.content.ContextCompat +import androidx.core.graphics.withClip import androidx.core.view.isVisible import kotlinx.android.synthetic.main.view_visible_message.view.* import network.loki.messenger.R