[TIMOB-27316] Android: Add TabGroup support to NavigationWindow
| GitHub Issue | n/a |
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-10-30T15:27:33.000+0000 |
| Affected Version/s | Release 8.0.0 |
| Fix Version/s | Release 8.3.0 |
| Components | Android |
| Labels | NavigationWindow, TabGroup, android, parity |
| Reporter | Brenton House |
| Assignee | Yordan Banev |
| Created | 2019-08-07T14:33:24.000+0000 |
| Updated | 2021-01-04T14:11:09.000+0000 |
Description
*Summary:*
Currently, Android's NavigationWindow only supports opening Ti.UI.Window objects. It does *not* currently support opening a TabGroup like iOS. We should add TabGroup support for parity.
*Test Code:*
The [^NavWindowTabGroupTest.js] file sets up a TabGroup as the 1st window in a NavigationWindow and can launch a child Window from each tab. (Currently crashes with an exception.)
The [^NavWindowChildTabsTest.js] has a Window as the 1st window in a NavigationWindow which opens a TabGroup as a child. This is a separate test case is needed since the open handling is different. (Currently shows a blank tab group with no tabs.)
*Note:*
iOS does not currently support displaying a TabGroup "title" in the NavigationWindow title bar. This is because our TabGroup does not currently support a "title" property. On Android, TabGroup does have an undocumented "title" property which would allow this to work. (Perhaps we should add "title" property support to iOS in the future.)
Attachments
[~ybanev] - Currently the biggest issue is that currentTab.open() opens a window on top of everything instead of inside the currentTab window (like iOS). This way, it would also have nav stack and history (like iOS) so you have back button capability. I just want to make sure that this ticket still reflects this.
[~bhouse] If I get it right this will happen regardless of the TabGroup being a part of a NavigationWindow, right? If this is the case we may better keep the different scenarios in different tickets. Do we have one for what you mentioned?
[~ybanev] - You can take a look at the history of this ticket
[~bhouse], that should be a separate ticket since it's not related to
NavigationWindow. From looking at [TIMOB-13409], it looks like we've never supportedcurrentTab.open(). This is not a new issue.After chatting with Brenton, I now realize that I misunderstood the original issue this ticket originally described. (Note that I rewrote this ticket's description which refers to an entirely different issue, but is still relevant and needs to be addressed as well.) On Android, the
Tab.open(Ti.UI.Window)method opens the window as an activity which is shown fully on top of the parentTabGroupactivity. On iOS, theTab.open(Ti.UI.Window)method opens a window *+within+* theTabGroupand the top title bar shows a back button to navigate back to the tab. So, the tab acts as a container for another window. The bottom tabs are still shown. This is the behavior Brenton is after. In my opinion, I think we should accept the platform behavior difference in this case. But that said, this behavior can be replicated viaTabbedBarandScrollableViewinstead of using aTabGroup. The key thing here is to useViewsinstead ofWindows. Perhaps we should write up a "Story" ticket that provides sample code on how to do this.PR: https://github.com/appcelerator/titanium_mobile/pull/11166
FR Passed. TabGroup works fine in NavigationWindow on Android.
Closing ticket. Improvement verified in SDK version
8.3.0.v20191030041914. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11166This PR seems to be related to this ticket: https://github.com/appcelerator/alloy/pull/1067