Android TabView to look like iOS


#22

1 argument would be that you are forcing dev to have different components and logic for something that could be similar (in terms of logic at least)…

Also can I ask you how you to conditionally require different components in the module and in the routing configuration?

Thanks,
Dem


#23

Yep it’s true, it’s an argument!

See this topic :slight_smile:


#24

Thanks,
I see how it’s done, it seems a bit dirty as you also state, and also that will never work if in the future we want to use AOT to optimise the production code…

A word from somebody involved in the Nativescript project would be good…in general I’d like to be able to do both ways (depending on my needs) rather than being forced on one way only…

Dem


#25

I’ve decided that I will implement this library for iOS, it will be better for consistency since TabViews force you to kind of change your architecture in Angular.

Cheers :smile: :beers:


#26

Hello,
Great news!

Cheers!

Dem


#27

New version of the plugin is out :beers:

  • iOS support
  • Refactored
  • {N} 3.0 Support
  • Notification customisation

Have fun :wink:

https://www.npmjs.com/package/nativescript-bottombar


#28

@rhanb is it possible to use icon fonts instead of images in the bottombar?


#29

That file got update since you have posted, can you update it with current version.

Also this is requested as feature at https://github.com/NativeScript/NativeScript/issues/3871, if anyone is following can update here.


#30

carousel Can be implemented


#31

var context = this._context;
var nativeView = new org.nativescript.widgets.GridLayout(context);
nativeView.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.star));
nativeView.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.auto));
var tabLayout = new org.nativescript.widgets.TabLayout(context);
var lp = new org.nativescript.widgets.CommonLayoutParams();
lp.row = 1;
tabLayout.setLayoutParams(lp);
nativeView.addView(tabLayout);
nativeView.tabLayout = tabLayout;
setElevation(nativeView, tabLayout);
var accentColor = getDefaultAccentColor(context);
if (accentColor) {
tabLayout.setSelectedIndicatorColors([accentColor]);
}
var primaryColor = utils_1.ad.resources.getPalleteColor(PRIMARY_COLOR, context);
if (primaryColor) {
tabLayout.setBackgroundColor(primaryColor);
}
var viewPager = new android.support.v4.view.ViewPager(context);
//var lp = new org.nativescript.widgets.CommonLayoutParams();
// lp.row = 1;
// viewPager.setLayoutParams(lp);
nativeView.addView(viewPager);
nativeView.viewPager = viewPager;