Code example for TabWidget

Methods: setId

0
	 
	private void initUI(TabWidgetSetting tabWidgetSetting, int position) {
		this.setId(android.R.id.tabhost);
		LinearLayout layout = new LinearLayout(getContext());
		layout.setOrientation(LinearLayout.VERTICAL);
		TabWidget widget = new TabWidget(getContext());
		widget.setId(android.R.id.tabs);
		StyleSettingTool.setPadding(widget, tabWidgetSetting.padding());
		StyleSettingTool.setBackground(widget, tabWidgetSetting);
		FrameLayout content = new FrameLayout(getContext());
		content.setId(android.R.id.tabcontent);
		if(position == TOP_POSITION) {
			layout.addView(widget, tabWidgetParams());
			layout.addView(content, tabContentParams());
		} else { 
			layout.addView(content, tabContentParams());
			layout.addView(widget, tabWidgetParams());
		} 
		addView(layout);
	} 
Experience pair programming with AI  Get Codota for Java