This should reuse the OptionContainer class. The problem is on mobile platforms tabs have icons as well as label text, andOptionContainer’s add method doesn’t support that. Possible solutions I can think of are
a. Add an extra (optional) argument to “add”. This may require future updates for existing implementations so that code doesn’t crash on them.
b. Expect an “icon” attribute in inner widgets. If that attribute doesn’t exist, the tab has no icon.
Android and iOS do this quite differently. I’m thinking a class with two methods push and pop to show the next view and performing “back” actions. The push method would take two arguments title and container, the first one would be the title of the next view.
The table API for desktop OSs might work, but Table (or list view on Android) sections would be a problem. Maybe it should get its own API? If so, how should it look like?
This one is not mobile-specific, but should present in all implementations, really.
Hi,I’m looking into implementing more widgets for iOS, and possibly Android in the future, and to create a small app based on it. Currently I’m thinking the followings:1. Tab controlThis should reuse the OptionContainer class. The problem is on mobile platforms tabs have icons as well as label text, andOptionContainer’s add method doesn’t support that. Possible solutions I can think of area. Add an extra (optional) argument to “add”. This may require future updates for existing implementations so that code doesn’t crash on them.b. Expect an “icon” attribute in inner widgets. If that attribute doesn’t exist, the tab has no icon.
2. NavigationAndroid and iOS do this quite differently. I’m thinking a class with two methods push and pop to show the next view and performing “back” actions. The push method would take two arguments title and container, the first one would be the title of the next view.
3. TableThe table API for desktop OSs might work, but Table (or list view on Android) sections would be a problem. Maybe it should get its own API? If so, how should it look like?
4. Image viewThis one is not mobile-specific, but should present in all implementations, really.
These, combining with existed widgets like scroll container, label, input and button, would be pretty enough for a reasonably usable app for static data display, IMO.
Hope to hear your thoughts!
1. Tab controlThis should reuse the OptionContainer class. The problem is on mobile platforms tabs have icons as well as label text, andOptionContainer’s add method doesn’t support that. Possible solutions I can think of area. Add an extra (optional) argument to “add”. This may require future updates for existing implementations so that code doesn’t crash on them.b. Expect an “icon” attribute in inner widgets. If that attribute doesn’t exist, the tab has no icon.I see what you're thinking here. I'm completely OK with the idea that an icon should be an optional argument to an OptionContainer - having an icon in a tab bar isn't an unusual requirement. Having a fallback strategy of "tab gets it's icon from content" is also an interesting idea - it would make things like document viewers and web browsers responsive to the content they're displaying, which I can see as potentially useful.
However, I'm not sure an OptionContainer is (necessarily) the right widget for this context in mobile. A closer analog would be to look at the way toolbars are done on desktop.A Container is something that can be dropped anywhere into a layout. You could, at least in theory, have a layout where two OptionContainers are stacked on top of each other.A toolbar is a fundamental property of a Window, not a standalone widget - even though a toolbar is a standalone widget in some underlying toolkits. The reason for this is that you can't (or shouldn't) arbitrarily drop a toolbar anywhere in a UI - it needs to be at the top of a window.Similarly, the tabs in a mobile interface can really only appear as a list of options along the bottom of the screen. It's a "top level" navigation element, similar to the "Navigation" concept you flag in your next point.That said, this might indicate that there's a need to differentiate between Containers as a top level structural element, and Containers as layout boxes in a UI. Tabs, Split panes, and other widgets like this are all 'top level" structure; a top level container can either hold another top level container, or it can hold "content"; but content can't hold anything but other content. Does that make any sense?
2. NavigationAndroid and iOS do this quite differently. I’m thinking a class with two methods push and pop to show the next view and performing “back” actions. The push method would take two arguments title and container, the first one would be the title of the next view.This is pretty close to what I was thinking. I would also add the concept of "container level actions" - the "back" icon is a "top left" button; but on the top right you can put other buttons to do things (such as Add or Search buttons)
3. TableThe table API for desktop OSs might work, but Table (or list view on Android) sections would be a problem. Maybe it should get its own API? If so, how should it look like?I can think of at least three approaches for this:a) Treat this as a "same flavour, slightly different API". Keep the API as close as possible to the desktop, but acknowledge that on mobile, there are differences.b) Treat "sections" as an outer container - i.e., a structural widget that contains table views. Each section is an independent table, rather than being one big table with sections. This ins't a good match for the underlying widgets, but it would keep a consistent API. A variation on this would be to have two widgets - a multi-section table, a single-section table, and only provide a single-section table on the desktop API.c) Come up with a visualisation of sections in the desktop table widget. I'm not sure what this would be - maybe an accordion-style widget?
Hi Russ,I have you to thank for the wonderful project. I’ve always wished for something like this for a long time, and Toga’s approach just makes sense. Really looking forward to contribute. :)I’m going to try out a few things., and hopefully will come up with something soon.1. Tab controlThis should reuse the OptionContainer class. The problem is on mobile platforms tabs have icons as well as label text, andOptionContainer’s add method doesn’t support that. Possible solutions I can think of area. Add an extra (optional) argument to “add”. This may require future updates for existing implementations so that code doesn’t crash on them.b. Expect an “icon” attribute in inner widgets. If that attribute doesn’t exist, the tab has no icon.I see what you're thinking here. I'm completely OK with the idea that an icon should be an optional argument to an OptionContainer - having an icon in a tab bar isn't an unusual requirement. Having a fallback strategy of "tab gets it's icon from content" is also an interesting idea - it would make things like document viewers and web browsers responsive to the content they're displaying, which I can see as potentially useful.I got it from how iOS sets the text in the navigation bar. Every view controller in iOS has a “title” attribute, and the navigation view controller uses it for the text in the bar (the title attribute has other uses too). If something is generic enough to exist everywhere it might be a good idea.However, I'm not sure an OptionContainer is (necessarily) the right widget for this context in mobile. A closer analog would be to look at the way toolbars are done on desktop.A Container is something that can be dropped anywhere into a layout. You could, at least in theory, have a layout where two OptionContainers are stacked on top of each other.A toolbar is a fundamental property of a Window, not a standalone widget - even though a toolbar is a standalone widget in some underlying toolkits. The reason for this is that you can't (or shouldn't) arbitrarily drop a toolbar anywhere in a UI - it needs to be at the top of a window.Similarly, the tabs in a mobile interface can really only appear as a list of options along the bottom of the screen. It's a "top level" navigation element, similar to the "Navigation" concept you flag in your next point.That said, this might indicate that there's a need to differentiate between Containers as a top level structural element, and Containers as layout boxes in a UI. Tabs, Split panes, and other widgets like this are all 'top level" structure; a top level container can either hold another top level container, or it can hold "content"; but content can't hold anything but other content. Does that make any sense?Certainly. I was under the impression that there’s nothing similar to tab bars (a la desktop OS style) on mobile devices, but that is certainly not the case. The level differentiation makes sense, but I don’t feel it needs to be made explicit. It might be awkward to add seemingly top-level elements into a content element, but nobody will stop you from doing it—we just expect the user to do it the reasonable way.Thinking along that line, NavigationContainer and TabContainer would be top-level, while Container would be content, right?
2. NavigationAndroid and iOS do this quite differently. I’m thinking a class with two methods push and pop to show the next view and performing “back” actions. The push method would take two arguments title and container, the first one would be the title of the next view.This is pretty close to what I was thinking. I would also add the concept of "container level actions" - the "back" icon is a "top left" button; but on the top right you can put other buttons to do things (such as Add or Search buttons)The problem here is that different platforms do things quite differently. On iOS it’s reasonable to allow only one extra button on top right, and require all others to go into the bottom toolbar, but on Android it is more common to use one single top bar (ActionBar) and stuff everything in it. So it would need some kind of abstraction.
3. TableThe table API for desktop OSs might work, but Table (or list view on Android) sections would be a problem. Maybe it should get its own API? If so, how should it look like?I can think of at least three approaches for this:a) Treat this as a "same flavour, slightly different API". Keep the API as close as possible to the desktop, but acknowledge that on mobile, there are differences.b) Treat "sections" as an outer container - i.e., a structural widget that contains table views. Each section is an independent table, rather than being one big table with sections. This ins't a good match for the underlying widgets, but it would keep a consistent API. A variation on this would be to have two widgets - a multi-section table, a single-section table, and only provide a single-section table on the desktop API.c) Come up with a visualisation of sections in the desktop table widget. I'm not sure what this would be - maybe an accordion-style widget?Or maybe treat it as something completely different? Android’s rough equivalent to UITableView is actually called ListView (there’s a TableView that do two-dimention layout), so maybe it can be named like lister or something. I think most would agree that UITableView is completely differently from NSTableView, although with very similar names. On desktop both one- and two-dimentional tables would be available (with or without similar names), but on mobile only the one-dimentional one works (or maybe both can work if there’s a way).