Hi I'm using Sliding tab layout in my app and it all works great. The only thing I dont understand is why my tabs text are in uppercase.
I've printed the text the tabs get inside of the sliding tab class and they are not in uppercase. I've looked around and there is no toUpperCase method being called.
Here is the code from the class that sets the text:
private void populateTabStrip() {
final PagerAdapter adapter = mViewPager.getAdapter();
final View.OnClickListener tabClickListener = new TabClickListener();
for (int i = 0; i < adapter.getCount(); i++) {
View tabView = null;
TextView tabTitleView = null;
if (mTabViewLayoutId != 0) {
// If there is a custom tab view layout id set, try and inflate it
tabView = LayoutInflater.from(getContext()).inflate(mTabViewLayoutId, mTabStrip,
false);
tabTitleView = (TextView) tabView.findViewById(mTabViewTextViewId);
}
if (tabView == null) {
tabView = createDefaultTabView(getContext());
}
if (tabTitleView == null && TextView.class.isInstance(tabView)) {
tabTitleView = (TextView) tabView;
}
if (mDistributeEvenly) {
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tabView.getLayoutParams();
lp.width = 0;
lp.weight = 1;
}
tabTitleView.setText(adapter.getPageTitle(i));
tabTitleView.setTextColor(getResources().getColor(R.color.da_blue));
tabView.setOnClickListener(tabClickListener);
String desc = mContentDescriptions.get(i, null);
if (desc != null) {
tabView.setContentDescription(desc);
}
mTabStrip.addView(tabView);
if (i == mViewPager.getCurrentItem()) {
tabView.setSelected(true);
}
}
}
I'm sure I can do it through a style but really not sure which one to use. This is what I have in my styles:
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:actionBarTabTextStyle">@style/ActionBarTabTextStyle.Tabtheme</item>
<item name="actionBarTabTextStyle">@style/ActionBarTabTextStyle.Tabtheme</item>
</style>
<style name="ActionBarTabTextStyle.Tabtheme" parent="@android:style/Widget.Holo.ActionBar.TabText">
<item name="android:textAllCaps">false</item>
</style>
</resources>
If you use "android.support.design.widget.TabLayout" needed to set app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"