I am using compact tab for my app.
TabHelper tabHelper = getTabHelper();
CompatTab menuTab = tabHelper.newTab("menu");
menuTab.setText(R.string.tab_section1);
menuTab.setIcon(R.drawable.home_icon);
menuTab.setTabListener(new InstantiatingTabListener(
this, MenuFragment.class));
tabHelper.addTab(menuTab);
I do have resource file code as follow
<string name="tab_section1">Home</string>
Menu Tab renders properly but there is no SPACE between ICON and TEXT. How can I achieve it?
Icon and text "Map" is very close without space
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="@drawable/home_selected" />
<item android:drawable="@drawable/home" />
</selector>
My setText Methos
@Override
public CompatTab setText(int resId) {
mText = mActivity.getResources().getText(resId);
return this;
}