zeroomega / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
0 stars 0 forks source link

Strange behavior of context menu on ActivityFilterAndAction #137

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new rule with filter and actions.
2. Click on the filter element.
3. Long click on the action element and select edit.
4. Make some changes and press ok.

What is the expected output? What do you see instead?
The filter elements becomes an action element and the original action remains 
unchanged!

Please use labels and text to provide additional information.

Original issue reported on code.google.com by renc...@gmail.com on 22 Jul 2010 at 4:02

GoogleCodeExporter commented 8 years ago
I just encountered similar problem. it seems like it's trying to modify root 
event instead of very first action, and it throws error accordingly.

Original comment by sv767%ny...@gtempaccount.com on 24 Jul 2010 at 3:10

GoogleCodeExporter commented 8 years ago
I think this is duplicate of issue69

Original comment by sv767%ny...@gtempaccount.com on 24 Jul 2010 at 3:40

GoogleCodeExporter commented 8 years ago
I think this is slightly different from Issue 69. In this bug, you just need to 
click on somewhere else other than your intended target and use the long click 
to edit. It seems that the focus remains unchanged after doing long click so 
the activity becomes confused. However, the context menu was not yet existent 
when issue 69 was reported...

Original comment by renc...@gmail.com on 24 Jul 2010 at 3:48

GoogleCodeExporter commented 8 years ago
Agreed, this is different.  My guess is that when you longclick it's performing 
the context menu on "getItemSelected" which is actually the last item you 
clicked.  In this case, the Filter.  For some reason it passes the 
getItemLongClicked to the next dialog though.  Shouldn't be that hard to fix.

Original comment by case.and...@gmail.com on 24 Jul 2010 at 4:54

GoogleCodeExporter commented 8 years ago

Original comment by renc...@gmail.com on 25 Jul 2010 at 11:01

GoogleCodeExporter commented 8 years ago
Code review:
http://codereview.appspot.com/1871053

Caused by:
The focus does not change whenever a long-click is performed, so when you 
finish the action and return to the activity, the onActivityResult will still 
think that the last item clicked is the one you performed that action on with 
long click.

Fix detail:
Whenever a long click is performed on an item, that item is also set to be 
"selected".

Test Cases:
1. Create a new rule with multiple actions/filters.
  1.1 Click on an action and perform a long-click on another one. Select "delete" on the context menu. The correct item should be deleted.
  1.2 Click on an action and perform a long-click on another one. Select "edit" on the context menu. After finishing the edit, the changes should reflect on the proper action.

Original comment by renc...@gmail.com on 28 Jul 2010 at 9:55

GoogleCodeExporter commented 8 years ago
Checked-in @ r836.

Original comment by renc...@gmail.com on 28 Jul 2010 at 11:10

GoogleCodeExporter commented 8 years ago

Original comment by renc...@gmail.com on 29 Jul 2010 at 8:37