use of android.widget.TextView in project Android-ParallaxHeaderViewPager by kmshack.
the class PagerSlidingTabStrip method addTextTab.
private void addTextTab(final int position, String title) {
TextView tab = new TextView(getContext());
tab.setText(title);
tab.setGravity(Gravity.CENTER);
tab.setSingleLine();
addTab(position, tab);
}
use of android.widget.TextView in project Android-ParallaxHeaderViewPager by kmshack.
the class PagerSlidingTabStrip method updateTabStyles.
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);
// 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));
}
}
}
}
}
use of android.widget.TextView in project android-gif-drawable by koral--.
the class ImageSpanFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mTextView = new TextView(getActivity());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mTextView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mTextView.setTextIsSelectable(true);
}
final GifDrawable gifDrawable = GifDrawable.createFromResource(getResources(), R.drawable.anim_flag_england);
final SpannableStringBuilder ssb = new SpannableStringBuilder("test");
assert gifDrawable != null;
gifDrawable.setBounds(0, 0, gifDrawable.getIntrinsicWidth(), gifDrawable.getIntrinsicHeight());
gifDrawable.setCallback(this);
ssb.setSpan(new ImageSpan(gifDrawable), ssb.length() - 1, ssb.length(), 0);
mTextView.setText(ssb);
return mTextView;
}
use of android.widget.TextView in project TwinklingRefreshLayout by lcodecorex.
the class SinaRefreshView method init.
private void init() {
View rootView = View.inflate(getContext(), R.layout.view_sinaheader, null);
refreshArrow = (ImageView) rootView.findViewById(R.id.iv_arrow);
refreshTextView = (TextView) rootView.findViewById(R.id.tv);
loadingView = (ImageView) rootView.findViewById(R.id.iv_loading);
addView(rootView);
}
use of android.widget.TextView in project libgdx by libgdx.
the class MicroBenchmarks method onCreate.
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
tv = new TextView(this);
sv = new ScrollView(this);
sv.addView(tv);
setContentView(sv);
testThread.start();
}
Aggregations