allow icon only tab bar button (no text)

This commit is contained in:
Frederik Bosch 2016-05-09 16:54:32 +02:00
Родитель ba5578f0c4
Коммит a0fe29db3c
1 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -144,15 +144,17 @@ public class TabBar extends android.widget.LinearLayout implements
ll.addView(iv); ll.addView(iv);
} }
TextView tv = new TextView(themedContext); if (abb.label != null) {
LinearLayout.LayoutParams tvp = new LinearLayout.LayoutParams( TextView tv = new TextView(themedContext);
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams tvp = new LinearLayout.LayoutParams(
tvp.gravity = Gravity.CENTER_HORIZONTAL; ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
tv.setLayoutParams(tvp); tvp.gravity = Gravity.CENTER_HORIZONTAL;
tv.setTypeface(null, Typeface.BOLD); tv.setLayoutParams(tvp);
tv.setTextSize(TEXTSIZE); tv.setTypeface(null, Typeface.BOLD);
tv.setText(abb.label.toUpperCase()); tv.setTextSize(TEXTSIZE);
ll.addView(tv); tv.setText(abb.label.toUpperCase());
ll.addView(tv);
}
return ll; return ll;
} }