Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
TableView - Custom Control — Gideros Forum

TableView - Custom Control

OZAppsOZApps Guru
edited August 2012 in Marketplace
This is the start of what is a custom control that works without any plug-ins and would work cross compatibile on both iOS and Android. If there was a facility to have masks, the tableView can be created in custom sizes instead of full screen.

Likes: Caroline, atilim

twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
+1 -1 (+2 / -0 )Share on Facebook
«1

Comments

  • Great job @ozapps . Is it a lua class component like butoon? Will you share it publicly when it finish. Sorry for so many questions but i really like it so much;)
  • 1. Yes, It will be a lua component
    2. It will be available for purchase Publicly
    3. No worries about the questions.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • looking forward to see it online:D
  • talistalis Guru
    edited August 2012
    @OZApps where can we look all your libraries' details. I mean prices, examples etc..
    I checked your web-site but couldn't find it.
    Thanks in advance.
  • @talis, I must admit, they are a bit unorganised, I will put them together. However I had iphone.oz-apps.com where there were custom controls for C*SDK. I will update these there or on my website.
    Thanks for letting me know that I need to put them together somplace ... :(
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • talistalis Guru
    edited August 2012
    @OZApps looking forward to see them all in one place. thanks again.
  • @OZApps will it have support for disclosure buttons?

    looks good tho!

    Gary
  • @Garyk1968, thanks

    Am a bit stuck at the inertial scrolling, the disclosure buttons, custom cells are all there, will add the header and footers later. Plan was to make it identical to the Obj-C API, where a functions requests details for each cell, including the height, data, header, footer, but then we want it easier, not that low level, do we?
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • OZAppsOZApps Guru
    edited August 2012
    Hmmm, some progress, slow start of the day, got the inertia scrolling and disclosure buttons working.



    Need to add the bounce when it is scrolled past the top or bottom. Right now it just snaps back at the position.

    WishList:
    Groups
    Headers and Footers
    Individual cellSizes.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @OZApps, It looks fantastic!
    When do you think it will be available for purchase?
    Just show me where to throw my money :)

    Likes: OZApps

    +1 -1 (+1 / -0 )Share on Facebook
  • @mathz, do not throw your money ;) I'm not Apple Inc.

    it is coming soon... though you can use it as is, it will evolve as per feedback and requests.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @OZapps, sounds good!
    And I'll hold on to my money until you tell me not to ;)
  • talistalis Guru
    edited August 2012
    @OzApps I know you are still writing and not finished but i have some questions.
    Are you planning to implement those?
    -Pressing color, background(Changable), objects(should be able to add button, checkbox programitcally inside), Eventhandlers(on press, on long press)

    Thanks again. Waiting for the publish date :)>-
  • OZAppsOZApps Guru
    edited August 2012
    @talis,

    * Pressing Colour? You mean Highlight Colour, the colour when the cell is selected? It is implemented.
    * Background Changeable - The background of the cell (currently only the colour is changeable) used as
    tableVue:setCellColor(0x707070)
    * Objects - Yes that is on the wishlist, but for later
    * EventHandlers - Gestures are easy to capture in iOS but for any other Lua based framework, it is a bit more involved. However, these are there in the code but are not 100% as yet)

    Image of selection http://files.oz-apps.com/TableViewSelection.png
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @OZApps - what kind of frame rate are you getting on native devices?
    I'm implementing the old ansca tableviewxl code that re-uses a bank of cells to limit the number of active entries.

    For text I'm using TTF fonts but the rate starts to drop when scrolling (it's a smooth 60 when not scrolling) - I've noticed however on a fast scroll I can be generating two or more cells per frame and I think it's the extra overhead of calling TextField:new that's killing it. I'm going to be swapping over to a custom bitmap font with a pool of characters per cell to eliminate all memory allocation.

    Just curious as to your implementation
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • @techdojo
    I am not trying the Apple way of doing things (re-using the cells) this should work but might not work as efficiently as this is using a layer on top of OpenGL rather than dealing with the UI components directly, and since these are written in Lua, they may lack the speed and direct access that one might get with Objective-C.

    Anyways, I will try to determine the fps, however I tried to shoot a video using the iPad (oh woes!!) and then converting that ... :(

    Hope you can see the video and the scroll, I have reduced the velocity (maybe I will keep this set-able by the user)

    The Video :

    As for the Bitmapped technique, yes you will save memory by having one texture, but what about the overhead of having multiple objects to hold the text and the inability to alter the font size? If I were to make it for internal use, not as a control, then the approach might be different as I would know the largest size of the list and the items that I want to have, but again when creating a control, these will vary from user to user, there could be that one user that might want to have a very large number of entries.... and that will just kill it :(

    The C*SDK code does not work very well with Gideros in the way the event times and some other things are. In C*SDK, they rely on the timer, clock and event time, where as in Gideros this is much smaller, so the code kind of falls apart (if it relies on these)
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Hmm - actually I haven't noticed a problem with timings, I find os.timer has sufficient resolution it's just that it's expressed in seconds as opposed to milliseconds (just set the highlight counter to 0.1 instead of 100 and it just worked).

    So are you saying your solution is a mix of Lua and Objective C rendered to your own OpenGL layer and doesn't use the Gideros display system? That would potentially be more efficient - although mine plays nice on both iOS and Android.

    With my control - I just provide the structure and the ability to render a (user supplied) background, the cell contents are provided again by the user so the user can make the appropriate rendering decisions based on their specific needs.
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • So are you saying your solution is a mix of Lua and Objective C
    No... it is 100% pure Gideros & Lua so that it can work on both Android and iOS.

    I was suggesting that if you want to use it for personal use, then it is fine, but when you want to make it a customisable control, it is a bit more involved with the Ansca method that you mentioned in your earlier post.

    timing... a 1-on-1 port of C*SDK code cannot be made that's all. Though there are ways around it one of which you have suggested.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • My first solution was to render the entire contents of the list but it soon got pretty heavy in terms of memory allocation and the frame rate dropped (my list > 600 rows) - although the code WAS more flexible and it was easier to add the category headers etc.

    Now that I think about it I wasn't doing a setVisible(false) on cells outside of the screen so that might make a difference.
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • I know what you are saying and I am trying another way to manage the cells more or less like the Apple way.

    I am not 100% that setting the visibility would make any difference as the cells allocated would take up memory/space anyways and thereby slow the cells when scrolled.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • So what's your strategy to keep the frame rate up then?
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • Will have to revisit the drawing board to handle > 500 rows with smooth scrolling. However for any of my projects I might never require > 100 rows. Plus am not sure it is worth spending time on optimising this unless there are takers that make it viable to spend time on this.

    To answer your question directly, I would suggest modelling it on the same principles like Apple, where each cell is set every so often and reused. Since there are no masks, etc, the size of the lists would be full device height.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • That's pretty much the solution I'm using and to be fair it does work out pretty well. From what I can gather - the slowdown on the fast scroll is the number of cells it has to regenerate at any given time - this is why I want to optimise the custom callback side with a bitmap font, no allocation, pool reuse etc so as to limit the overhead.

    When scrolling at a reasonable speed - it remains at 60fps constantly on my 3rd Gen iPod touch, it's the big "flicks" that mess things up.
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • @techdojo, any video or screenshots of your scrolling tableview?

    Likes: gorkem

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+1 / -0 )Share on Facebook
  • Good times...
    getting about 60 fps using the (1/event.deltatime)

    * The tableview can handle sections, can handle setting the height for each cell (width is set to device width for now)
    * The tableCell can have the option of three disclosures, an Arrow, the Button and the CheckMark.
    * The cell can change to display data based on all of the iOS styles by just setting the CellStyle (soon to have each cell with a custom setup)
    * Unlimited number of items (as many as the memory can allow) and still get the same fps rate.

    *WishList/On the Anvil*
    --------------------
    * The cell can have custom layout and can add elements as required, so one can add another text field and also specify the position, colour, fontSize, etc or another display object.
    * The sections can be grouped
    * Inclusion of Headers and Footers
    * Gestures for detecting interaction with the cells, including sliding left/right, up/down, long press, short tap, etc.
    * Ability to customise using callback functions to override some functionality, for example
     -- sample of using a callback
    local tv = newTableView()
     
    function tv:canSelectRowAtIndexPath(theSection, theIndex)
      return not (theSection ==2 and theIndex == 5)
    end
    This will now make the 5th Item in section #2 unselectable. So when you tap on the item, this function will be called and because it returns false, the item is not selected.

    Video:
    ------
    The video at is containing 5000 items and when scrolled with intertia, it runs at ~ 60 fps even on the device (iPhone 4)

    Likes: gorkem, talis, techdojo

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+3 / -0 )Share on Facebook
  • @OZApps what about search functionality? It is not really easy to implement i guess. But if there will be lots of items in the tableview it is not really convinient for the user to scroll and find.
    Anwyay it seem really perfect and as it is and as i said before really looking forward for you to publish it. I will be the first one who will buy and test it.
    Thanks again
  • @OZApp's - none yet :) I'll see what I can get sorted, need to clean up my garbage first :)
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • @OZApps what about search functionality? It is not really easy to implement i guess. But if there will be lots of items in the tableview it is not really convinient for the user to scroll and find.
    Anwyay it seem really perfect and as it is and as i said before really looking forward for you to publish it. I will be the first one who will buy and test it.
    Thanks again
    @talis, a TableView is only the View in the MVC model. The data fits into the Model. So search has nothing do do with the tableView, you limit the data that is displayed.

    However, that is a good point, I might implement a 'filter predicate' to filter out the data (but not right now, will keep this on the wishlist)

    @techdojo, I know what you are saying... :) take your time.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @OZApps
    ... however I tried to shoot a video using the iPad (oh woes!!) and then converting that ...
    Have you tried Reflection App (Mac only. 10 min free trial) or AirServer (Mac only. 7 days free trial)
    + use your screen capture soft.
    I use AirServer (never tried Reflection) to record my drawing sessions. Works very well for me.
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • @OZApps, when do you think this will be available for purchase?
    I'm sure I'm not the only one here who would be willing to pay for it allthough it's not fully ready as long as we also get access to future updates :)
Sign In or Register to comment.