From e1b2bf54561bf20314bc6022c6331f0b46ad1aec Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 12 Jan 2019 14:08:00 +0000 Subject: [PATCH] Use touch delegate for expander --- .../eu/faircode/email/AdapterMessage.java | 26 ++++++++++++++++--- .../main/res/layout/item_message_compact.xml | 1 + .../main/res/layout/item_message_normal.xml | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 41995afa7d..ca1243ce5c 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -30,6 +30,7 @@ import android.content.pm.PackageManager; import android.content.res.ColorStateList; import android.database.Cursor; import android.graphics.Color; +import android.graphics.Rect; import android.graphics.Typeface; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; @@ -55,6 +56,7 @@ import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; +import android.view.TouchDelegate; import android.view.View; import android.view.ViewGroup; import android.widget.Button; @@ -211,7 +213,7 @@ public class AdapterMessage extends RecyclerView.Adapter> liveAttachments = null; private Observer> observerAttachments = null; - ViewHolder(View itemView) { + ViewHolder(final View itemView) { super(itemView); this.itemView = itemView.findViewById(R.id.clItem); @@ -287,7 +289,22 @@ public class AdapterMessage extends RecyclerView.Adapter