New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-25953] Android: Add "Ti.UI.TabbedBar" support #10286
Conversation
@ypbnv, great work! I did some quick testing on iOS. I noticed that the But this is good news because this gives us the freedom to change the behavior of this Also, I've noticed that For One more thing. I've noticed that the |
Hey @ypbnv, nice changes! I agree with everything @jquick-axway suggested, except:
Finally, a tabbed-bar with views will be exactly what the Android tab-group is now, right? That may lead to confusion when trying to select proper API's. If we can conclude on those details, I see this being a huge step for parity! |
@hansemannn , @jquick-axway |
@ypbnv A |
How about we do it for both? I do agree that
I think what @ypbnv meant was using a custom view within the tab button so that the developer can control the layout of the tab button's text, image, background, and other drawables. I think we should keep it simple for now, but it's definitely a good thought. :)
I'm not sure what to do about I definitely want us to support a radio button group in the future since that is a UI component that is missing in Titanium. Perhaps this should be a new Titanium view type such as |
@jquick-axway Sounds great! |
@hansemannn, @ypbnv, I've resurrected an old feature request ticket for radio button support. You can find it here... |
For now I am going for supporting BottomNavigation style in |
@ypbnv Sounds great! Cannot wait to use it in my personal projects. |
@ypbnv, the TabGroup PR is merged now. You probably want to use that PR's style constants and delete the constants under the TabbedBar proxy. |
Remove the dedicated TabbedBar constants and instead use the defined in Android UI module.
@jquick-axway I replaced the constants. For other improvements (further customization) and under the hood code optimization I would prefer to have separate tickets. For the latter I have created one. I think when I am done with it I will have a better idea what customization may be shared between TabGroup and TabbedBar. |
|
FR Passed. Studio Ver: 5.1.2.201810301430 |
apidoc/Titanium/UI/TabbedBar.yml
Outdated
type: Number | ||
default: Titanium.UI.iOS.SystemButtonStyle.PLAIN | ||
default: Titanium.UI.iOS.SystemButtonStyle.PLAIN for iOS, Ti.UI.TabbedBar.TABBED_BAR_STYLES_DEFAULT for Android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the docs to reference the Ti.UI.Android.TABBED_BAR_STYLE_*
constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the last change needed. @ypbnv, if you can do this by tomorrow, then that would be great. QE is ready to click that merge button. :)
We should un-deprecate Edit 1: Edit 2: |
Use the common tabs style constants in the documentation.
Improve parity with iOS in case of TabbedBar items fallbacks when there is an image and title properties.
I have added ypbnv#1 for the iOS side. One critical parity issue that should be resolved before this slips into 8.0.0: - name: style
summary: Style of the tabbed bar.
description: |
Specify one of the constants:
For iOS:
[Titanium.UI.iOS.SystemButtonStyle](Titanium.UI.iOS.SystemButtonStyle),
either `PLAIN`, `BORDERED`, or `BAR`.
The `BAR` style specifies a more compact style and allows the bar's background
color or gradient to show through.
For Android:
[Titanium.UI.TABS_STYLE_*]
In Android [style](Ti.UI.TabbedBar.style) is only supported in the creation dictionary
of the proxy.
type: Number
default: Titanium.UI.iOS.SystemButtonStyle.PLAIN for iOS, Titanium.UI.TABS_STYLE_DEFAULT for Android On iOS, the default style is EDIT: I did some research. The EDIT 2: Looks like EDIT 3: Ready to review. |
@hansemannn, I see what you mean. The
I tested it with the below code... var window = Ti.UI.createWindow({
fullscreen: true,
layout: "vertical",
});
window.add(Ti.UI.createLabel({ text: "TabbedBar (PLAIN)", top: "10dp" }));
window.add(Ti.UI.iOS.createTabbedBar({
style: Ti.UI.iOS.SystemButtonStyle.PLAIN,
labels: ["One", "Two", "Three"],
}));
window.add(Ti.UI.createLabel({ text: "TabbedBar (BORDERED)", top: "10dp" }));
window.add(Ti.UI.iOS.createTabbedBar({
style: Ti.UI.iOS.SystemButtonStyle.BORDERED,
labels: ["One", "Two", "Three"],
}));
window.add(Ti.UI.createLabel({ text: "TabbedBar (BAR)", top: "10dp" }));
window.add(Ti.UI.iOS.createTabbedBar({
style: Ti.UI.iOS.SystemButtonStyle.BAR,
labels: ["One", "Two", "Three"],
}));
window.open(); |
@ypbnv, @hansemannn, PR #10558 un-deprecates @ypbnv, would you mind updating the API docs about this iOS change in this PR please? This way we avoid the merge conflict. Thanks. |
Add deprecation version in docs for Ti.UI.iOS.TabbedBar.
@jquick-axway I added the deprecation version for the iOS namespace. Let me know if there is anything more to be updated. Edit: I also changed the unit tests to be ran for both platform. |
Replaces the android-only tests with cross platform tests.
Re FR'ed & Studio Ver: 5.1.2.201812191831 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-25953
Description:
Add TabbedBar implementation for Android.
Once this is ready for merging the idea is to remove the deprecation of
Ti.UI.TabbedBar
and move the the implementation ofTi.UI.iOS.TabbedBar
back to the common namespace.For now
TabbedBar
supports two different styles ( constants for styles may be renamed and moved to another place once we merge them with the styles currently supported in iOS ) which use two different native components on Android side:TABBED_BAR_STYLE_DEFAULT
uses an instance ofTabLayout
TABBED_BAR_STYLE_BOTTOM_NAVIGATION_VIEW
usesBottomNavigationView
Things I think are worth of addressing:
style
as a creation-only property is fine.title
andimage
.width
will need to be implemented either as a custom view or somehow translated through the gravity property. I think neither of those is a good solution, but if we want that there is room for experiment.enabled
is clear how to be implemented, but I am curious what's the way of changing this property - through getting the BarItemType array from the component and changing it for the specific child there? I am not sure if this is the case in iOS.Test case:
app.js
CC: @garymathews @hansemannn
On the way:
Expose the component through Alloy for Android.