TableView listener has no moved phase

Hi,

I am implementing a delete swipe functionality in tableview where it needs to behave like iOS7 where it moves the row content to unveil the delete/cancel buttons when the user swipes left the finger.

I noticed that the tableview listener only receives began phases an no moved phase. 

This is specifically done in widget_tableview.lua in function view:touch( event ) where the moved is hard coded changed to began.

Is this a design decision ? Should I file a feature request or issue report? 

At this point I can hack it by relying on there being  moved phases after the began phase, are there any other known workarounds ?

Thanks,

  Atanas

onRowTouch() is supposed to generate event.phases like “swipeLeft” and “swipeRight”. These are what we used to use to catch the row slide. Didn’t have a chance to check if this is still working. Can you try? I will get to it in a little while as well. 

Thanks Ksan,

The swipe left and swipe right work fine but the iOS7 behavior is to move the row while the user is moving the finger, while the swipe left and right are only moving it at once when the swipe is completed. I am a little picky about my UIs :slight_smile:

Thanks

  Atanas

Got it.! You are absolutely right. I was hoping to try the new whole row moving left revealing the buttons thing soon so I am glad you chanced upon this one.

In all reality we will probably hear that this was not implemented as it was not behavior present prior to IOS 7 and that if we want it we should submit a feature request… 

I will send you the code when I am done. At this point I dont want to clone widgets_tableview.lua as it seems there might be some fixes coming in, so I am going the route of subclassing it and implementing the behavior on top of the current widget_tableview code. Thanks for confirming, Atanas

Super! While you are in there digging around can you see if tableView can be given a :takefocus similar to the scrollView:takeFocus feature? Thank you so much!!!

Sorry to put this burden on your shoulders but if you have a moment to spare can you kindly look at the following thread where I outline this takeFocus challenge?

http://forums.coronalabs.com/topic/42089-scrollview-inside-tableview-rows-how-to-pass-focus/

I’m hoping you might be able to think of a solution while you are deep down in the tableView code looking around! Thank you so much and apologies for the sidetrack… 

Hi ksan,

I just sent you the files and a sample project. It does not replace widget_tableview but adds onto it and you can use your existing code as is. Basically it adds the iOS7 sliding functionality to unveil a group of widgets where you can put pretty much anything. It also fixes the issue of the listener not receiving a “moved” event in case you would need this.

I haven’t worked with a scrollView yet but will check the thread - I might need a test project as well to try out 

Cheers,

  Atanas

Hi Atanas, 

I received and tested your sample project. One word. AMAZING!!! You are the official widget hero!

IMHO, Corona Labs should hire you right away to solve all our widget problems. Your ability to dive into the core widget source and then extend it rather than override it is amazing.

The slide whole row left to reveal Cancel / Delete functionality is simply amazing and seems to work very very well. You should be very proud. Thank you so much for sharing your work. 

Regards,

Kerem

onRowTouch() is supposed to generate event.phases like “swipeLeft” and “swipeRight”. These are what we used to use to catch the row slide. Didn’t have a chance to check if this is still working. Can you try? I will get to it in a little while as well. 

Thanks Ksan,

The swipe left and swipe right work fine but the iOS7 behavior is to move the row while the user is moving the finger, while the swipe left and right are only moving it at once when the swipe is completed. I am a little picky about my UIs :slight_smile:

Thanks

  Atanas

Got it.! You are absolutely right. I was hoping to try the new whole row moving left revealing the buttons thing soon so I am glad you chanced upon this one.

In all reality we will probably hear that this was not implemented as it was not behavior present prior to IOS 7 and that if we want it we should submit a feature request… 

I will send you the code when I am done. At this point I dont want to clone widgets_tableview.lua as it seems there might be some fixes coming in, so I am going the route of subclassing it and implementing the behavior on top of the current widget_tableview code. Thanks for confirming, Atanas

Super! While you are in there digging around can you see if tableView can be given a :takefocus similar to the scrollView:takeFocus feature? Thank you so much!!!

Sorry to put this burden on your shoulders but if you have a moment to spare can you kindly look at the following thread where I outline this takeFocus challenge?

http://forums.coronalabs.com/topic/42089-scrollview-inside-tableview-rows-how-to-pass-focus/

I’m hoping you might be able to think of a solution while you are deep down in the tableView code looking around! Thank you so much and apologies for the sidetrack… 

Hi ksan,

I just sent you the files and a sample project. It does not replace widget_tableview but adds onto it and you can use your existing code as is. Basically it adds the iOS7 sliding functionality to unveil a group of widgets where you can put pretty much anything. It also fixes the issue of the listener not receiving a “moved” event in case you would need this.

I haven’t worked with a scrollView yet but will check the thread - I might need a test project as well to try out 

Cheers,

  Atanas

Hi Atanas, 

I received and tested your sample project. One word. AMAZING!!! You are the official widget hero!

IMHO, Corona Labs should hire you right away to solve all our widget problems. Your ability to dive into the core widget source and then extend it rather than override it is amazing.

The slide whole row left to reveal Cancel / Delete functionality is simply amazing and seems to work very very well. You should be very proud. Thank you so much for sharing your work. 

Regards,

Kerem

Hey Atanas, I was reading this post and came across this… any chance you can provide this code? Would be extremely appreciated!

I saw your other post asking about takefocus(). Atanas’s tableViewExt solves that issue and adds functionality for slide to delete etc implementation. We should be documenting it soon on widgetstown.com. Meanwhile I think it might be available on Atanas’s GitHub repository if you are feeling adventurous. 

As kerem points out, the sources are on github. There is also a small sample app that I can email you while we document it on the site