List of usage examples for android.util TypedValue COMPLEX_UNIT_PX
int COMPLEX_UNIT_PX
To view the source code for android.util TypedValue COMPLEX_UNIT_PX.
Click Source Link
From source file:com.waz.zclient.pages.main.conversation.views.row.message.views.TextMessageWithTimestamp.java
private void resizeIfEmoji(Message message) { if (message.getMessageType() == Message.Type.TEXT_EMOJI_ONLY) { messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSizeEmoji); } else {//from w ww. j a v a 2 s . c om messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSizeRegular); } }
From source file:cn.hollo.www.custom_view.PagerSlidingTabStrip.java
private void addTextTab(final int position, String title, int leftIcon) { TextView tab = new TextView(getContext()); tab.setText(title);/* ww w . ja v a2 s .c o m*/ tab.setGravity(Gravity.CENTER); tab.setSingleLine(); if (tabTextColor != null) tab.setTextColor(tabTextColor); else tab.setTextColor(defaultTabTextColor); tab.setCompoundDrawablesWithIntrinsicBounds(leftIcon, 0, 0, 0); tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); addTab(position, tab); }
From source file:com.hm.library.resource.tabstrip.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setBackgroundResource(tabBackgroundResId); if (v instanceof TextView) { try { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); tab.setTextColor(tabTextColor); // setAllCaps() is only available from API 14, so the upper // case // is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { ((TextView) tab).setAllCaps(true); } else { tab.setText(tab.getText().toString().toUpperCase(locale)); }/*from w w w . j a va 2 s .c o m*/ } if (i == selectedPosition) { tab.setTextColor(selectedTabTextColor); tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, selectedTabTextSize); tab.getPaint().setFakeBoldText(true); } else { tab.getPaint().setFakeBoldText(false); } } catch (Exception e) { e.printStackTrace(); } } } }
From source file:aierjun.com.aierjunlibrary.widget.tablayout.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); // v.setBackgroundDrawable(tabBackgroundDrawable); if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); tab.setTextColor(tabTextColor); if (i == 0) tab.setTextColor(tabchecktextcolor); // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab.setAllCaps(true); } else { tab.setText(tab.getText().toString().toUpperCase(locale)); }/*from w w w. j a v a 2 s . c om*/ } } } }
From source file:com.mozhuowen.widget.views.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setBackgroundResource(tabBackgroundResId); if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); // tab.setTypeface(tabTypeface, tabTypefaceStyle); tab.setTextColor(tabTextColor); // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab.setAllCaps(true); } else { tab.setText(tab.getText().toString().toUpperCase(locale)); }/*from w w w . j av a 2s . co m*/ } } else if (v instanceof LinearLayout) { TextView tab1 = (TextView) ((ViewGroup) v).getChildAt(0); TextView tab2 = (TextView) ((ViewGroup) v).getChildAt(1); tab1.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); // tab1.setTypeface(tabTypeface, tabTypefaceStyle); tab1.setTextColor(tabTextColor); tab2.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); // tab2.setTypeface(tabTypeface, tabTypefaceStyle); tab2.setTextColor(tabTextColor); if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab1.setAllCaps(true); tab2.setAllCaps(true); } else { tab1.setText(tab1.getText().toString().toUpperCase(locale)); tab2.setText(tab2.getText().toString().toUpperCase(locale)); } } } } }
From source file:app.views.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setBackgroundResource(tabBackgroundResId); if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); tab.setTextColor(tabTextColor); // setAllCaps() is only available from API 14, so the upper case // is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab.setAllCaps(true); } else { tab.setText(tab.getText().toString().toUpperCase(locale)); }//from w ww . ja v a 2s .c om } if (i == selectedPosition) { tab.setTextColor(selectedTabTextColor); tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, selectedTabTextSize); } } } }
From source file:com.other.pagerslidingtabstrip.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setBackgroundResource(tabBackgroundResId); if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); tab.setTextColor(tabTextColor); // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab.setAllCaps(true); } else { tab.setText(tab.getText().toString().toUpperCase(locale)); }// w w w . j a v a 2 s. c om } if (i == selectedPosition) { tab.setTextColor(selectedTabTextColor); } } } }
From source file:cn.com.zzwfang.view.indicator.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setLayoutParams(defaultTabLayoutParams); v.setBackgroundResource(tabBackgroundResId); if (shouldExpand) { v.setPadding(0, 0, 0, 0);/*www.j a va 2 s .co m*/ } else { v.setPadding(tabPadding, 0, tabPadding, 0); } if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); if (pager.getCurrentItem() == i) { tab.setTextColor(tabTextColor); } else { tab.setTextColor(tabUnselectedTextColor); } // setAllCaps() is only available from API 14, so the upper case // is made manually if we are on a // pre-ICS-build if (textAllCaps) { tab.setText(tab.getText().toString().toUpperCase(locale)); } } } }
From source file:com.baseutil.strip.PagerSlidingTabStrip.java
private void updateTabTextColorStyles(int pos, int color, int unselectedcolor) { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setBackgroundResource(tabBackgroundResId); if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); if (pos == i) { tab.setTextColor(color); } else { tab.setTextColor(unselectedcolor); }/* ww w . j ava2 s . com*/ if (tabResources != null) { tab.setCompoundDrawablesWithIntrinsicBounds(tabResources[i], 0, 0, 0); } // setAllCaps() is only available from API 14, so the upper case // is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab.setAllCaps(true); } else { tab.setText(tab.getText().toString().toUpperCase(locale)); } } } } }
From source file:com.miqtech.master.client.view.PagerSlidingTabStrip.java
private void updateTabStyles() { for (int i = 0; i < tabCount; i++) { View v = tabsContainer.getChildAt(i); v.setBackgroundResource(tabBackgroundResId); if (v instanceof TextView) { TextView tab = (TextView) v; tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab.setTypeface(tabTypeface, tabTypefaceStyle); tab.setTextColor(tabTextColor); // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a // pre-ICS-build if (textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { tab.setText(tab.getText().toString()/*.toUpperCase(locale)*/); } else { tab.setText(tab.getText().toString()/*.toUpperCase(locale)*/); }//from w w w . j a v a 2s .c o m } } } }