Search in sources :

Example 66 with TextView

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);
}
Also used : TextView(android.widget.TextView)

Example 67 with TextView

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));
                }
            }
        }
    }
}
Also used : TextView(android.widget.TextView) HorizontalScrollView(android.widget.HorizontalScrollView) TextView(android.widget.TextView) View(android.view.View) SuppressLint(android.annotation.SuppressLint) Paint(android.graphics.Paint)

Example 68 with TextView

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;
}
Also used : TextView(android.widget.TextView) GifDrawable(pl.droidsonroids.gif.GifDrawable) SpannableStringBuilder(android.text.SpannableStringBuilder) ImageSpan(android.text.style.ImageSpan)

Example 69 with TextView

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);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) IHeaderView(com.lcodecore.tkrefreshlayout.IHeaderView)

Example 70 with TextView

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();
}
Also used : ScrollView(android.widget.ScrollView) TextView(android.widget.TextView)

Aggregations

TextView (android.widget.TextView)4994 View (android.view.View)2680 ImageView (android.widget.ImageView)1137 Button (android.widget.Button)442 LinearLayout (android.widget.LinearLayout)439 LayoutInflater (android.view.LayoutInflater)425 Intent (android.content.Intent)397 ListView (android.widget.ListView)389 AdapterView (android.widget.AdapterView)372 ViewGroup (android.view.ViewGroup)322 OnClickListener (android.view.View.OnClickListener)304 RecyclerView (android.support.v7.widget.RecyclerView)197 Test (org.junit.Test)197 ScrollView (android.widget.ScrollView)166 DialogInterface (android.content.DialogInterface)162 Context (android.content.Context)156 Drawable (android.graphics.drawable.Drawable)155 EditText (android.widget.EditText)149 AlertDialog (android.app.AlertDialog)144 Bundle (android.os.Bundle)144