-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not get pop method some times #15
Comments
Hello, is the MotionEvent.ACTION_CANCEL event being received by the PeekAndPopOnTouchListener? Or is it being intercepted by another view/listener? |
No. I have disable other controls. I am some time stucked in peek event. my screen getting open. not get pop event after getting MotionEvent.ACTION_CANCEL event |
No. I have disable other controls. I am some time stucked in peek event. my On Fri, Jun 3, 2016 at 10:29 PM, Vincent Te Tau [email protected]
*Jiten Ramoliya * |
Hi, I believe the problem was to do with the small latency between the longHoldTimer and and the Runnable within it that was ran on the UI thread. This meant that the longHoldTimer would be cancelled after the Runnable was put onto the task back stack, however since the Runnable hadn't actually begun and set peekShown to true, pop() wasn't called. I have fixed this storing the Runnable as a field and checking if it is null when cancelling the pending timer. I believe this should fix the problem, however if it still persists please let me know! The new version is: |
Still getting that issue. not not getting pop method. screen showing that I have attached |
Oh ok, I'm finding it quite hard to reproduce (I clicked over 200 times). I've made another change in a separate branch that mayhave fixed it. https://github.com/shalskar/PeekAndPop/tree/bugfix-persistentpeekview Try that out (use the Jitpack build from that branch) and see if it helps. If that fixes it I'll merge in back into master. |
Ok. Let me check that branch. I have found another issue. If I continues On Sat, Jun 4, 2016 at 4:47 PM, Vincent Te Tau [email protected]
*Jiten Ramoliya * |
I have checked that branch but issue is still remaining. Do you know how to fix that? |
In response to your message on the other issue: I have had a few small contributions from other devs but I don't think anyone has made a fork and done any drastic changes. You're welcome to create your own fork and see if you can fix this issue (or any other improvements you have in mind.) I'm having trouble replicating this bug after using the latest branch. I've tried it on 2 devices (one running 6.0 and the other 4.4) and even after locking/unlocking the phone and pressing the peekview 500+ times I couldn't replicate it. I'm thinking of writing some instrumentation tests to simplify the testing of such bugs. If you have any more info on how to reproduce this bug then feel free to tell me. |
I am using with listview. So You can try this lock/unlock case with it. I also provided parentViewGroupToDisallowTouchEvents(listview). but I don't know why I am getting this issue everytime after lock/unlock device. |
Are you calling peekAndPop.destroy() in your activity's onDestroy() method? Are you still getting the bug even when you don't lock/unlock the device? |
yes, but I am doing test in only one activity. so that activity not destroy before I got this issue |
this is going as well in action_down. but only getting problem while get action_cancel |
Sorry I don't completely understand, could you please rephrase that? |
Sorry, this is working as well when tringgered action_up event in touch. but only getting problem while triggered action_cancel in touch event for peekandpop class. |
That's really strange, as action_cancel is included in both if statements with action_up. If the peekView itself is receiving these events then I can't see what the difference would be. Another developer had the same issue, he was able to solve it by including the following into the xml file of the long click view:
He found that somehow the view was losing focus and then not receiving any further touch events. I'm not sure if this would work in your case however. |
I have used this three line im my xml file. But getting same issue
|
OK, I'm going to write so instrumentation tests in the following weeks when I have more time. This should help replicating bugs like this. In the mean time feel free to create a branch and see if you can resolve the issue yourself. |
On Mon, Jun 6, 2016 at 3:55 PM, Vincent Te Tau [email protected]
*Jiten Ramoliya * |
I have had a look at your code and was able to find the cause of the problem. If the longHoldView doesn't also have an OnClickListener set, then the PeekAndPopOnTouchListener will fail to receive any up or cancel MotionEvents. I have updated the branch with a fix that should solve your problem: https://github.com/shalskar/PeekAndPop/tree/bugfix-persistentpeekview Please let me know if this works and I will merge it back into master. |
Ok. Let me check that branch. I will let you know what result I get |
Did this work? |
Currently I am working on another Module. i will contact you soon when move On Mon, Jun 13, 2016 at 12:39 PM, Vincent Te Tau [email protected]
*Jiten Ramoliya * |
Hello sir, |
Sir, I already comment here. Please! could you tell me why We all getting this isuue? |
Unfortunately I am having trouble reproducing this bug even using your demo with the new branch. I am very busy with work at the moment and will only be able to get back to this project once I am not so busy. If this bug is urgent I recommend jumping into the code yourself and seeing if you can find where the bug is caused, which may be easier seeing as you can reproduce it. |
Lots of thanks sir for your work, I am also trying to get rid of this bug. I am getting pop method call but stil found image hanged at top. |
Ok, if you find a solution, feel free to make a pull request. Otherwise once I can start working on this again I will comment here if I think I have resolved this bug. |
Sure, If i get any solution then make a pull request. |
I found used listview with Swipelayout. https://github.com/daimajia/AndroidSwipeLayout It also work on touch and I think its getting clash with Peek and Pop Library. Pop method every time call after peek but I didn't get idea why is come MotionEvent.Action_Cancel after lock and unlock phone. before that I am getting MotionEvent.Action_Cancel lock and unlock phone. before that I am getting MotionEvent.Action_Up and everything is working fine. |
Hello Shalskar,
Could you tell me how I am getting this issue while removing chilview from parent. |
Hello sir,
I have put my peekAndPop code in adapter. Sometimes its not call pop method and view available on screen after peek method. I am getting this 1 of 25 times. So its very ridicules for me to test that event. I track this code. I am getting this thing when Its call MotionEvent.ACTION_CANCEL in onTouch Method. looking forward for your reply asap
The text was updated successfully, but these errors were encountered: