Getting Started

To use RadTabView Beta a reference to the Primitives library first must be added to your project. Then simply create an instance:

RadTabView tabView = new RadTabView(this.getContext());

Then add some tabs:

tabView.getTabs().add(new Tab("Tab 1"));
tabView.getTabs().add(new Tab("Tab 2"));
tabView.getTabs().add(new Tab("Tab 3"));

Add a TabViewChangeListener:

tabView.addChangeListener(this);

Finally, implement the change listener methods. One of those methods is called to create a content view for each tab:

@Override
public View getContentViewForTab(Tab tab) {
    TextView contentView = new TextView(this.getContext());
    contentView.setText(tab.getTitle() + " content view");
    contentView.setGravity(Gravity.CENTER);

    return contentView;
}

That's all there is to it. The result is a fully functioning tab view:

TabView-GettingStarted

The full source code can be found here.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy