[TIMOB-27334] Android: Add TabGroup.add() method to support view overlays
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | TabGroup, android, overlay, tabs |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-08-13T23:34:58.000+0000 |
Updated | 2020-05-27T23:40:25.000+0000 |
Description
*Summary:*
On iOS,
TabGroup
unofficially supports an add()
method which allows you to add views which overlay on top of the entire tab group. We'd like to do the same on Android.
*Use-Case 1: DrawerLayout in TabGroup*
On Android, there is currently no means of adding a DrawerLayout
to a TabGroup
. This is a feature that many app developers want.
[^TabGroupDrawerWithTabsTest.js]
*Use-Case 2: DrawerLayout without Tabs*
A common Android user-interface is to use a DrawerLayout to select tabs/views. For example, Google's gmail app displays different views by tapping on buttons/links in the drawer. The below code hides a TabGroup
's tabs so that a DrawerLayout
can select tabs instead.
[^TabGroupDrawerWithoutTabsTest.js]
*Use-Case 3: Overlay translucent view on top of TabGroup*
Another use-case is to overlay a translucent view which can be used to display instructions to the end-user. This currently works on iOS today.
[^TabGroupOverlayTest.js]
!iOS-TabGroup-Overlay.png|thumbnail!
*Recommended Solution:*
Titanium's [TiUIAbstractTabGroup](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java) Java class should override the following methods in our [TiUIView](https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java) similar to how it's done in [TiUIScrollVIew](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollView.java).
* void add(TiUIView)
* void insertAt(TiUIView, int)
* void remove(TiUIView)
Attachments
File | Date | Size |
---|---|---|
iOS-TabGroup-Overlay.png | 2019-08-13T23:26:35.000+0000 | 108286 |
TabGroupDrawerWithoutTabsTest.js | 2019-08-13T23:49:28.000+0000 | 1393 |
TabGroupDrawerWithTabsTest.js | 2019-08-13T23:49:22.000+0000 | 1083 |
TabGroupOverlayTest.js | 2019-08-13T23:26:35.000+0000 | 1042 |
No comments