Fixed touch delegate

This commit is contained in:
M66B 2019-01-15 10:57:08 +00:00
parent 822eb2aac1
commit b11c86b7be
1 changed files with 8 additions and 6 deletions

View File

@ -290,17 +290,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void wire() {
if (viewType == ViewType.THREAD) {
ivExpander.setOnClickListener(this);
final View touch = (threading ? ivExpander : vwColor);
touch.setOnClickListener(this);
itemView.post(new Runnable() {
@Override
public void run() {
Rect rect = new Rect(
itemView.getLeft(),
ivExpander.getTop(),
touch.getTop(),
itemView.getRight(),
ivExpander.getBottom());
touch.getBottom());
Log.i("Touch delegate=" + rect);
itemView.setTouchDelegate(new TouchDelegate(rect, ivExpander));
itemView.setTouchDelegate(new TouchDelegate(rect, touch));
}
});
} else
@ -319,9 +320,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
private void unwire() {
if (viewType == ViewType.THREAD)
if (viewType == ViewType.THREAD) {
vwColor.setOnClickListener(null);
ivExpander.setOnClickListener(null);
else
} else
itemView.setOnClickListener(null);
ivSnoozed.setOnClickListener(null);
ivFlagged.setOnClickListener(null);