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:
The full source code can be found here.