Skip to content
Snippets Groups Projects
Commit 8395fa05 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Adrien Béraud
Browse files

conversations: fix broken clickable features in text messages

broken since commit a2f05e8c

Changes the OnClickListener from the text message TextView to the
item's outer layout, restoring double click selection and clickable
links.

Change-Id: Iec7ee9d1ecb2278dcaf88fb7a184b345cb710eca
parent b534b626
Branches
No related tags found
No related merge requests found
...@@ -81,7 +81,6 @@ import cx.ring.model.TextMessage; ...@@ -81,7 +81,6 @@ import cx.ring.model.TextMessage;
import cx.ring.service.DRingService; import cx.ring.service.DRingService;
import cx.ring.utils.AndroidFileUtils; import cx.ring.utils.AndroidFileUtils;
import cx.ring.utils.ContentUriHandler; import cx.ring.utils.ContentUriHandler;
import cx.ring.utils.FileUtils;
import cx.ring.utils.GlideApp; import cx.ring.utils.GlideApp;
import cx.ring.utils.GlideOptions; import cx.ring.utils.GlideOptions;
import cx.ring.utils.ResourceMapper; import cx.ring.utils.ResourceMapper;
...@@ -296,9 +295,11 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo ...@@ -296,9 +295,11 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo
holder.player = null; holder.player = null;
} }
if (holder.mMsgTxt != null) { if (holder.mMsgTxt != null) {
holder.mMsgTxt.setOnClickListener(null);
holder.mMsgTxt.setOnLongClickListener(null); holder.mMsgTxt.setOnLongClickListener(null);
} }
if (holder.mItem != null) {
holder.mItem.setOnClickListener(null);
}
if (expandedItemPosition == holder.getLayoutPosition()) { if (expandedItemPosition == holder.getLayoutPosition()) {
holder.mMsgDetailTxt.setVisibility(View.GONE); holder.mMsgDetailTxt.setVisibility(View.GONE);
expandedItemPosition = -1; expandedItemPosition = -1;
...@@ -764,7 +765,7 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo ...@@ -764,7 +765,7 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo
})); }));
} }
setItemViewExpansionState(convViewHolder, isExpanded); setItemViewExpansionState(convViewHolder, isExpanded);
convViewHolder.mMsgTxt.setOnClickListener((View v) -> { convViewHolder.mItem.setOnClickListener((View v) -> {
if (convViewHolder.animator != null && convViewHolder.animator.isRunning()) { if (convViewHolder.animator != null && convViewHolder.animator.isRunning()) {
return; return;
} }
......
...@@ -40,6 +40,7 @@ import io.reactivex.disposables.CompositeDisposable; ...@@ -40,6 +40,7 @@ import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
public class ConversationViewHolder extends RecyclerView.ViewHolder { public class ConversationViewHolder extends RecyclerView.ViewHolder {
public View mItem;
public TextView mMsgTxt; public TextView mMsgTxt;
public TextView mMsgDetailTxt; public TextView mMsgDetailTxt;
public TextView mMsgDetailTxtPerm; public TextView mMsgDetailTxtPerm;
...@@ -79,6 +80,7 @@ public class ConversationViewHolder extends RecyclerView.ViewHolder { ...@@ -79,6 +80,7 @@ public class ConversationViewHolder extends RecyclerView.ViewHolder {
// common layout elements // common layout elements
case INCOMING_TEXT_MESSAGE: case INCOMING_TEXT_MESSAGE:
case OUTGOING_TEXT_MESSAGE: case OUTGOING_TEXT_MESSAGE:
mItem = v.findViewById(R.id.txt_entry);
mMsgTxt = v.findViewById(R.id.msg_txt); mMsgTxt = v.findViewById(R.id.msg_txt);
mMsgDetailTxt = v.findViewById(R.id.msg_details_txt); mMsgDetailTxt = v.findViewById(R.id.msg_details_txt);
mMsgDetailTxtPerm = v.findViewById(R.id.msg_details_txt_perm); mMsgDetailTxtPerm = v.findViewById(R.id.msg_details_txt_perm);
......
...@@ -72,7 +72,7 @@ along with this program; if not, write to the Free Software ...@@ -72,7 +72,7 @@ along with this program; if not, write to the Free Software
android:autoLink="all" android:autoLink="all"
android:background="@drawable/textmsg_bg_out" android:background="@drawable/textmsg_bg_out"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="false" android:focusable="true"
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:padding="@dimen/padding_medium" android:padding="@dimen/padding_medium"
android:scrollHorizontally="true" android:scrollHorizontally="true"
......
...@@ -55,7 +55,7 @@ along with this program; if not, write to the Free Software ...@@ -55,7 +55,7 @@ along with this program; if not, write to the Free Software
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/padding_medium" android:paddingStart="@dimen/padding_medium"
android:paddingEnd="@dimen/padding_large"> android:paddingEnd="36dp">
<ImageView <ImageView
android:id="@+id/photo" android:id="@+id/photo"
...@@ -77,7 +77,7 @@ along with this program; if not, write to the Free Software ...@@ -77,7 +77,7 @@ along with this program; if not, write to the Free Software
android:autoLink="all" android:autoLink="all"
android:background="@drawable/textmsg_bg_in" android:background="@drawable/textmsg_bg_in"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="false" android:focusable="true"
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="false" android:singleLine="false"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment