Example usage for android.widget TextView setSingleLine

List of usage examples for android.widget TextView setSingleLine

Introduction

In this page you can find the example usage for android.widget TextView setSingleLine.

Prototype

public void setSingleLine() 

Source Link

Document

Sets the properties of this field (lines, horizontally scrolling, transformation method) to be for a single-line input.

Usage

From source file:za.jamie.soundstage.widgets.PagerSlidingTabStrip.java

private void addTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);//  ww w. j a  v a2s. c om
    tab.setFocusable(true);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            pager.setCurrentItem(position);
        }
    });

    tabsContainer.addView(tab);
}

From source file:com.yktx.check.widget.OldPagerSlidingTabStrip.java

private void addIconAndTextTab(final int position, int resId, String title) {
    LinearLayout layout = new LinearLayout(getContext());
    layout.setGravity(Gravity.CENTER);// w  ww.ja  va 2s.c o m
    layout.setOrientation(LinearLayout.VERTICAL);
    ImageView tabImage = new ImageView(getContext());
    tabImage.setImageResource(resId);
    tabImage.setId(R.id.image);
    TextView tabText = new TextView(getContext());
    tabText.setText(title);
    tabText.setSingleLine();
    tabText.setId(R.id.text);
    tabText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    tabText.setGravity(Gravity.CENTER_HORIZONTAL);
    tabText.setPadding(0, 3, 0, 0);
    layout.addView(tabImage);
    layout.addView(tabText);

    addTab(position, layout);

}

From source file:com.anjuke.library.uicomponent.slidingtab.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {

    TextView tab = new TextView(getContext());
    tab.setText(title);//from   ww w. j a v a2s.c o m
    tab.setFocusable(true);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            pager.setCurrentItem(position);
        }
    });
    tabsContainer.addView(tab);
}

From source file:com.haomee.view.PagerSlidingTabStrip.java

private void addTextIconTab(final int position, String title, int resId) {

    if (resId == TitleIconTabProvider.NONE_ICON) {
        addTextTab(position, title);//from  w  w  w .ja v a2 s .co m
        return;
    }

    TextView tab = new TextView(getContext());
    tab.setText(title);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    ImageView icon = new ImageView(getContext());
    icon.setImageResource(resId);

    LinearLayout linearLayout = new LinearLayout(getContext());
    linearLayout.setOrientation(LinearLayout.HORIZONTAL);

    linearLayout.addView(tab, defaultTabLayoutParams);
    linearLayout.addView(icon, defaultTabLayoutParams);

    addTab(position, linearLayout);
}

From source file:com.astuetz.PagerSlidingTitleIconTabStrip.java

private void addTextIconTab(final int position, String title, int resId) {

    if (resId == TitleIconTabProvider.NONE_ICON) {
        addTextTab(position, title);/*from   w ww  . j  av  a  2  s.c  om*/
        return;
    }

    TextView tab = new TextView(getContext());
    tab.setText(title);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    ImageView icon = new ImageView(getContext());
    icon.setImageResource(resId);

    LinearLayout linearLayout = new LinearLayout(getContext());
    linearLayout.setOrientation(LinearLayout.HORIZONTAL);

    linearLayout.addView(icon, defaultTabLayoutParams);
    linearLayout.addView(tab, defaultTabLayoutParams);

    addTab(position, linearLayout);
}

From source file:com.juma.view.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {

    TextView tab = new TextView(getContext());
    tab.setText(title);// w w w.ja va 2  s. com
    tab.setGravity(Gravity.CENTER);
    tab.setTextColor(tabTextColor);
    tab.setSingleLine();

    addTab(position, tab);
}

From source file:com.pinthecloud.item.view.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);//from w ww  . j  ava2 s .  c  o  m
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    addTab(position, tab, smoothScroll);
}

From source file:com.cmax.bodysheild.widget.PagerSlidingTabStripExtends.java

public void addTextTab(final int position, String title) {

    TextView tab = new TextView(getContext());
    tab.setText(title);/*from w ww .  java  2s  .  co m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    addTab(position, tab);
}

From source file:com.grepsound.views.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {

    TextView tab = new TextView(getContext());
    tab.setText(title);//from  w  w  w  .j av a  2  s .  c o  m
    tab.setFocusable(true);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            pager.setCurrentItem(position);
        }
    });

    tabsContainer.addView(tab);

}

From source file:com.stx.xhb.dmgameapp.view.PagerSlidingTabStrip.java

private TextView addTextTab(final int position, String title) {

    TextView tab = new TextView(getContext());
    tab.setText(title);/*  w  w w. j  a  v a2  s.  c  om*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    addTab(position, tab);
    return tab;
}