RobotLegs and UI interaction, some questions.

Quentin's Avatar


29 Jun, 2011 10:29 AM

Hey everyone!

I now feel quite used to RobotLegs and how it works, but working on some apps recently got me thinking about the best way to handle some interactions with the app's UI. I'll base my questions on a simple app I recently wrote, and since the questions revolve around the interface, here's how it looks:

Main App UI

It's a tabbed interface with various medias in it. In the second tab (the app is RTL) there's a video player. When the video reaches its end, an overlay show up, letting the user choose whether to replay the video or to skip to the next tab. The 2 "< >" buttons on the left allow the user to quickly jump to the previous and next tabs.
Oh and by the way, I use as3-signals, but that shouldn't change too much in the way we write the app.

I wrote a UIModel class that has an activeTabIndex property, a selectNextTab() and a selectPreviousTab() methods. First question: is that the way you'd have done it?

When clicking on the video overlay buttons I dispatch signals that I'm wondering about: VideoEndOverlayRemovalRequired and NextTabButtonClicked or ReplayButtonClicked. Does that look OK to you?
For some reason I feel odd about having signals with names like "SomeVisualElementClicked". Same thing for "SomeVisualItemRemovalRequired". Thoughts?

Thanks in advance!

  1. Support Staff 1 Posted by creynders on 29 Jun, 2011 05:25 PM

    creynders's Avatar

    In general I let the views handle all navigation logic (unless if there's a good reason not to) so normally I don't have a model containing the selected tab index, but obviously that's a matter of preference.
    About the signal names: I prefer to have signal names w/o the originating UI element descriptors:
    NextTabRequested, ReplayRequested, VideoEndOverlayRemovalRequested
    In the last one I do include a UI element descriptor since it describes what should be removed, not where it's dispatched from (even if it would be dispatched from VideoEndOverlay)
    If you do this, you'll be refactoring less, when you decide to change UI elements, since you don't have to rename your signals.

  2. 2 Posted by Quentin on 29 Jun, 2011 06:09 PM

    Quentin's Avatar

    I agree with you about the way to handle the selected tab index, but in this case the TabBar and the "< >" buttons are two separate views. Of course I could have put both in a unified view…
    I like your "Requested" signal name suggestion!

    If anyone wants to share his best practices, I'm interested!

  3. Support Staff 3 Posted by Stray on 01 Jul, 2011 10:09 AM

    Stray's Avatar

    I have an app that is almost identical to this. Requested signals are exactly how I do it too. Then you're coupling to the user gesture and not to the implementation - which, in my mind, is ideal!

  4. 4 Posted by Quentin on 01 Jul, 2011 10:45 AM

    Quentin's Avatar

    Great, cool!
    Renamed my signals and felt prettier.


  5. Stray closed this discussion on 21 Jul, 2011 03:23 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac