Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27334] Android: Add TabGroup.add() method to support view overlays

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
LabelsTabGroup, android, overlay, tabs
ReporterJoshua Quick
AssigneeJoshua Quick
Created2019-08-13T23:34:58.000+0000
Updated2020-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

FileDateSize
iOS-TabGroup-Overlay.png2019-08-13T23:26:35.000+0000108286
TabGroupDrawerWithoutTabsTest.js2019-08-13T23:49:28.000+00001393
TabGroupDrawerWithTabsTest.js2019-08-13T23:49:22.000+00001083
TabGroupOverlayTest.js2019-08-13T23:26:35.000+00001042

Comments

No comments

JSON Source