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:com.gc.materialdesign.views.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);/*from   w ww  . j ava 2 s  .co  m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    //        tab.setBackgroundResource(R.drawable.tab_selector);
    addTab(position, tab);
}

From source file:cn.bingoogol.tabhost.ui.view.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);/*from   www. ja  v  a 2 s .c o m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    addTab(position, tab);
}

From source file:com.metinkale.prayerapp.utils.PagerSlidingTabStrip.java

private void addTextTab(int position, CharSequence title) {

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

    addTab(position, tab);
}

From source file:com.huyn.demogroup.relativetop.PagerSlidingTabStrip.java

private void addIconAndTextTab(int position, int resId, String title) {
    LinearLayout tab = new LinearLayout(getContext());
    tab.setGravity(Gravity.CENTER);/* w ww. j ava2 s  .c  o m*/

    TextView text = new TextView(getContext());
    text.setText(title);
    text.setTextColor(Color.WHITE);
    text.setGravity(Gravity.CENTER);
    text.setSingleLine();

    ImageView img = new ImageView(getContext());
    img.setImageBitmap(iProvider.getBitmap(resId));

    tab.addView(img);
    tab.addView(text);
    text.setPadding(10, 0, 0, 0);
    text.setTag("TEXT");

    addTab(position, tab);
}

From source file:com.contentful.discovery.ui.PagerSlidingTabStrip.java

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

    TextView tab = new CFTextView(getContext());
    tab.setText(title);/*from  ww w  .  ja v  a 2 s.c o m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    addTab(position, tab);
}

From source file:lollipop.util.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    TextView textView = new TextView(getContext());
    textView.setText(title);//from w  w w  . j  a v a  2  s  . com
    textView.setGravity(Gravity.CENTER);
    textView.setSingleLine();
    addTab(position, textView);
}

From source file:com.astuetz.pagersslidingtabstrip.PagerSlidingTabStrip.java

/** Icon is added here.*/
private void addTextTab(final int position, String title) {

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

    addTab(position, tab);
}

From source file:com.bwash.bwashcar.view.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title, int res) {
    View view = View.inflate(getContext(), R.layout.tab_item_layout, null);
    TextView tab = (TextView) view.findViewById(R.id.text);
    tab.setText(title);//from  w  ww .  j a v  a2  s  . co  m
    tab.setSingleLine();
    tab.setBackgroundResource(R.color.white);
    tab.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(res), null, null, null);
    tab.setCompoundDrawablePadding(ViewUtils.dip2px(getContext(), 5));
    addTab(position, view);
}

From source file:com.altitudelabs.swiftcart.view.PagerSlidingTabStrip.java

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

    TextView tab = new TextView(getContext());
    tab.setText(title);//from w ww. j a va  2 s  .c  om
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    tab.setTextSize(getResources().getDimension(R.dimen.pager_tab_strip_slider_textsize));
    tab.setTextColor(getResources().getColor(R.color.pager_tab_strip_text_color));

    addTab(position, tab);
}

From source file:com.jnwat.swmobilegy.view.PagerSlidingTabStrip.java

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

    TextView tab = new TextView(getContext());
    tab.setText(title);/*from  w  w w  . j  ava2  s . c o m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    // tab.setTextColor(R.drawable.selector_tabtext);
    addTab(position, tab);
}