Messaging: allow selecting text inside the selected message am: 78ecab8743 am: 476671be4a am: 1abe606ee5 am: db5364911f
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/1754232 Change-Id: I98e77b40dfe6b3d88af831a2ca9b1dfa6d7c980e
This commit is contained in:
@@ -708,6 +708,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
|||||||
textBottomPadding = textBottomPaddingDefault;
|
textBottomPadding = textBottomPaddingDefault;
|
||||||
textLeftPadding = messageTextLeftRightPadding;
|
textLeftPadding = messageTextLeftRightPadding;
|
||||||
textRightPadding = messageTextLeftRightPadding;
|
textRightPadding = messageTextLeftRightPadding;
|
||||||
|
mMessageTextView.setTextIsSelectable(isSelected());
|
||||||
} else {
|
} else {
|
||||||
// Attachment(s) only
|
// Attachment(s) only
|
||||||
contentLeftPadding = incoming ? arrowWidth : 0;
|
contentLeftPadding = incoming ? arrowWidth : 0;
|
||||||
@@ -733,6 +734,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
|||||||
textTopMargin = 0;
|
textTopMargin = 0;
|
||||||
textTopPadding = textTopPaddingDefault;
|
textTopPadding = textTopPaddingDefault;
|
||||||
textBottomPadding = textBottomPaddingDefault;
|
textBottomPadding = textBottomPaddingDefault;
|
||||||
|
mMessageTextView.setTextIsSelectable(isSelected());
|
||||||
if (showArrow && incoming) {
|
if (showArrow && incoming) {
|
||||||
textLeftPadding = messageTextLeftRightPadding + arrowWidth;
|
textLeftPadding = messageTextLeftRightPadding + arrowWidth;
|
||||||
} else {
|
} else {
|
||||||
@@ -1030,6 +1032,11 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
|||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(final View view) {
|
public boolean onLongClick(final View view) {
|
||||||
if (view == mMessageTextView) {
|
if (view == mMessageTextView) {
|
||||||
|
// Avoid trying to reselect the message
|
||||||
|
if (isSelected()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Preemptively handle the long click event on message text so it's not handled by
|
// Preemptively handle the long click event on message text so it's not handled by
|
||||||
// the link spans.
|
// the link spans.
|
||||||
return performLongClick();
|
return performLongClick();
|
||||||
@@ -1195,7 +1202,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
|||||||
// This touch event is a long click, preemptively handle this touch event so that
|
// This touch event is a long click, preemptively handle this touch event so that
|
||||||
// the link span won't get a onClicked() callback.
|
// the link span won't get a onClicked() callback.
|
||||||
mIsLongClick = false;
|
mIsLongClick = false;
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||||
|
|||||||
Reference in New Issue
Block a user