Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Mark/Select picture attachment at conversation - problems.

Open peterpanondrugs opened this issue 11 years ago • 7 comments

Hi folks, when i try to select an attachment (picture) at the conversation while pressing "ON" the picture, it gets marked but as soon i release my finger from the screen the picture automaticly gets unmarked. After repeating the following steps 5-6 times he finally catched my selection. BUT! When i mark next to the picture, on the blank screen, it gets marked immediately. U need a log for this?

peterpanondrugs avatar Feb 17 '15 13:02 peterpanondrugs

Same here.

scroom avatar Feb 19 '15 12:02 scroom

I have a similar problem with messages containing underlined numbers (like dates or phone numbers). As soon as I lift my finger, the selection is gone, but sometimes (also at the 5th or 6th time) it works. However if I first select another message, then select the message with the number, and then unselect the first one, it works just fine.

Genis-Sage avatar Feb 20 '15 07:02 Genis-Sage

Some notes from working on the fix for this in #2648:

This issue can be reproduced by pressing down on an image in the conversation view, waiting till the long click event is fired, and then moving your finger to the left or right before releasing. Doing this results in the following sequence of events:

  1. onItemLongClick() callback as expected
  2. onItemClick() callback from seemingly nowhere

The onItemClick() callback immediately undoes the list item selection done by onItemLongClick() and results in the bad UX reported by this issue.

The first thing I tried to resolve this issue was to switch from using both ListView click callbacks (onItemClick and onItemLongClick) and View callbacks (onClick and onLongClick) to using the simple View callbacks exclusively. Without too much work I was able to get this running and eliminate the strange image select behavior BUT there is a regression with this method where the pre-long-click animations only occur on the message bubble and not the list item background as before.

Unhappy with the regression I then reverted to using our existing ListView and View hybrid click callback setup and embarked on a journey of trying everything to get that working, including adjustments to our XML layouts-- nothing stopped the extra onItemClick() callback from firing. So, I added onTouch listeners to all of the views and observed the following:

sequence of events for long click with no left/right slide before release

  1. image thumbnail gets ACTION_DOWN
  2. onItemLongClick() is fired
  3. image thumbnail gets ACTION_CANCEL

sequence of evens for long click with left or right slide before release

  1. image thumbnail gets ACTION_DOWN
  2. onItemLongClick() is fired
  3. image thumbnail gets ACTION_CANCEL
  4. image thumbnail gets on or more ACTION_MOVE's
  5. list view gets ACTION_UP
  6. onItemClick() is fired

ListView receives an ACTION_UP and isn't aware that it corresponds to the ACTION_DOWN on our image thumbnail so I guess it decides to trigger the spurious onItemClick() callback that is the source of this entire issue. So, the fix I came up with in #2648 keeps two Set's of onTouch actions, one for the ListView and another for the list items. These sets are checked on every ACTION_UP to see if the action should be dropped and then cleared. It looks weird, it is weird, but it works :P

Another fix for this could possibly be using the View click listeners exclusively and manually triggering the drawing of list item pre-long-click background animations.

rhodey avatar Mar 12 '15 19:03 rhodey

I found out that this issue not only related to picture attachments but it happens for all kind of messages. It only matters if there is any content below the touched position (although for some very short messages like "OK" I was not able to reproduce the issue).

  1. If I touch and hold on a message and there is any kind of contect below my finger (text, icon, image) it seems that it triggers android default code to select/mark content.
  2. If I touch and hold on a message (can be the same as above) and there is no contect below my finger the message is selected and marked correctly. Only in this case android (lollipop) will show a animation where from the position of the finger a wave of grey color is spreading out to the left and to the right (can be tested e.g. in the default contacts by touching and holding on a contact in the list).

It seems that some default selection code is triggered if there is contect below the touched position.

fajabird avatar Apr 01 '15 08:04 fajabird

Update: If u try to mark a "failed send message"...its nearly impossible to select this! ... he doesnt react at all on my touch...pretty annoying! because if u try to send some new messages/pictures u simply cant ... because 1st u need to solve the "unsent msg" problem. Its really a bad behaviour! i had that problem now on several S3. 2 omnirom 4.4.4. and 1 stock samsung.

peterpanondrugs avatar May 12 '15 22:05 peterpanondrugs

In my experience I can send messages even if there are failed ones that haven't been sent (if I remember correctly). Anyway, to select a failed message and delete it, you can first select another message, then select the failed one and finally deselect the first message. Now you should be able to delete the failed message.

ghost avatar May 13 '15 07:05 ghost

Just to add more facts: While doing tests for #3148 it noticed that the is not possible to select text only message ~~when they are quite large (need to scroll from beginning to the end).~~

Oh, tired to verify before posting it turned out that: selecting message with 2+ lines is not working (anymore). One-liners no problem...

The tap-next-to-the-bubble-workaround is working here too.

As always I forgot: TS 2.14.1 on Sony Z1c with 4.4.4 stock

Edit: not very consistent. Now it seems that only sent messages are hit always, and received message sometimes (scrolling a bit up and down and selecting/deselecting has some impact)

McLoo avatar May 13 '15 08:05 McLoo