Widget demo that shows dynamic adding / removing to / from ListView?

Do you have a table view using WC which provides row re/ordering?

Specifically, I’m thinking about the iOS world clock?

http://bit.ly/11LJQsp

Yup. I was able to get it to work with W2 just by updating few things and it does work. I was just wondering if you have done any further work to improve the concept. Knowing how polished your incremental updates get over time it was worth the ask!  :slight_smile:

  1. I’m afraid not. I got far enough that I figured indies could run with it (as you have) or ask for more (some did and that progressed it a bit.)

  2. Thank you. That really means a lot. It’s so good to get feedback like this. I guess I will actually rewrite it from scratch once iOS7 settles down and gives me a guide. (Unless Corona Labs’ Widget dudes don’t beat me to it!)

Are you kidding? Your sample code is amazing. It has opened so many doors for me. The pinch zoom, rotate code is at the heart of my festival grounds map tab. It is so versatile and it was almost drop in and run. Thank you so much for all your contributions. You rock!!! 

On the topic of search bar, may I humbly suggest not to do it as an extended WidgetDemo but simply a single storyboard scene with a single scrollView with a single tableView sample? This way it will be much easier for simple folks like me to understand and re-use. The widgetDemo itself was a complicated piece of code so to extract the search piece out of it isn’t everyone’s cup of tea. Just my humble opinion. 

Anyways, lets start a new thread on this rather than pulling this further off-topic. Can’t wait to see what you come up with. 

Best regards & thanks,

Kerem

Thank you  :slight_smile:

Hey, maybe I’ll write it up as a tutorial, like the pinch-zoom…

Hi Horacebury,

Just had a quick question on your reorder table view items code share (couldn’t post a question there for some reason) - it is almost exactly what I am after, but I need the list to build “up” instead of down if you know what I mean. So if I press add, it will add a row to the top of the scrollview and the other entries would move down.

Any ideas as to whether that is an easy thing to modify, or where to point me towards?

Thanks in advance,

David

My code will just be adding a row to the existing scrollview, so it would be done by working out which Y position to add at. What you would want to do is add a new item at Y position 0, and then move all the other items down by the height of that item.

I haven’t looked at that code in a long time, but I think you’d want to modify some of the management values as well, though I can’t remember how. I might have done that version with a lot of self-maintaining tables, so you could be in luck.

Just try adding a new item to Y position 0 and insert it into the display group at index position 1. That should cause the effect you’re looking for. Let me know if that doesn’t work, but be aware that I’m going somewhat offline for a couple of weeks as I’m getting married next weekend.

Congrats on the wedding mate! :slight_smile:

So I have the new item coming in at Y position 0 - which works fine - the new row comes in at the “top” of the list. Now I just need the other list items to move down.  I didn’t quite get the bit about inserting it into the display group at index position 1 - do you mean passing in 1 as the index in the newOrderedItem function call inside onAddRelease function?

Thanks again,

David

no - the parent group of the other items is the display group to insert it into, though you may not need to do this.

you then need to loop over the other items and update their Y value to move them down.

Thanks Horacebury - I am struggling to find the best place to iterate and move them down - I tried in the refreshListData function, which kinda works, but is called from more than just add row, so when you go to edit/delete, there are some strange results with y being added to. Any ideas as to the best place to iterate that is only called when a row is added?

Thanks again

David

I’m just not sure right now… It’s been soooo long since I looked at that code. I’ll take a look again and see if I can figure something out. It should not be difficult to do, I know that.

Thanks horacebury, but I decided to roll my own, it was going to be significantly different. Thanks for your help though, and hope the wedding all went well!

Let us know how you go - I will certainly be interested to see your solution.

Yes, it went very well, thanks :slight_smile:

Hi Horacebury,

Just had a quick question on your reorder table view items code share (couldn’t post a question there for some reason) - it is almost exactly what I am after, but I need the list to build “up” instead of down if you know what I mean. So if I press add, it will add a row to the top of the scrollview and the other entries would move down.

Any ideas as to whether that is an easy thing to modify, or where to point me towards?

Thanks in advance,

David

My code will just be adding a row to the existing scrollview, so it would be done by working out which Y position to add at. What you would want to do is add a new item at Y position 0, and then move all the other items down by the height of that item.

I haven’t looked at that code in a long time, but I think you’d want to modify some of the management values as well, though I can’t remember how. I might have done that version with a lot of self-maintaining tables, so you could be in luck.

Just try adding a new item to Y position 0 and insert it into the display group at index position 1. That should cause the effect you’re looking for. Let me know if that doesn’t work, but be aware that I’m going somewhat offline for a couple of weeks as I’m getting married next weekend.

Congrats on the wedding mate! :slight_smile:

So I have the new item coming in at Y position 0 - which works fine - the new row comes in at the “top” of the list. Now I just need the other list items to move down.  I didn’t quite get the bit about inserting it into the display group at index position 1 - do you mean passing in 1 as the index in the newOrderedItem function call inside onAddRelease function?

Thanks again,

David

no - the parent group of the other items is the display group to insert it into, though you may not need to do this.

you then need to loop over the other items and update their Y value to move them down.

Thanks Horacebury - I am struggling to find the best place to iterate and move them down - I tried in the refreshListData function, which kinda works, but is called from more than just add row, so when you go to edit/delete, there are some strange results with y being added to. Any ideas as to the best place to iterate that is only called when a row is added?

Thanks again

David

I’m just not sure right now… It’s been soooo long since I looked at that code. I’ll take a look again and see if I can figure something out. It should not be difficult to do, I know that.

Thanks horacebury, but I decided to roll my own, it was going to be significantly different. Thanks for your help though, and hope the wedding all went well!