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:cn.hollo.www.custom_view.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);/*  w ww .j a  v a2  s .  co m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    if (tabTextColor != null)
        tab.setTextColor(tabTextColor);
    else
        tab.setTextColor(defaultTabTextColor);

    tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize);
    addTab(position, tab);
}

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);/*  w  w w.j a v  a2  s. co 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.runApp.ui.utils.PagerSlidingTabStrip.java

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

    TextView tab = new TextView(getContext());
    tab.setText(title);/*from  ww w  .j  a  va2 s  . c o m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    addTab(position, tab);
}

From source file:android.improving.utils.views.PagerSlidingTabStrip.java

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

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

From source file:com.xxjwd.libs.PagerSlidingTabStrip.java

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

   TextView tab = new TextView(getContext());
      /*from w ww .  j a  v  a2 s  . c om*/
   tab.setFocusable(true);
   tab.setGravity(Gravity.CENTER);
   tab.setSingleLine();
   tab.setText(title);
   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 addTextTab(final int position, String title) {

    TextView tab = new TextView(getContext());
    tab.setText(title);//from   w w  w. ja  va2 s  . c o m
    tab.setSingleLine();
    tab.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    tab.setGravity(Gravity.CENTER);
    tab.setPadding(0, 3, 0, 0);
    addTab(position, tab);
}

From source file:com.junshan.pub.widget.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);//from w w w .  j a v a2 s. c o m
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    int ps = DimenUtils.dp2px(mContext, paddingSize);
    tab.setPadding(ps, 0, ps, 0);
    addTab(position, tab);
}

From source file:com.sumavision.talktv2.ui.widget.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    // if (redTipPos == position) {
    View view = LayoutInflater.from(getContext()).inflate(R.layout.custom_tab_view, null);
    TextView tab = (TextView) view.findViewById(R.id.tab_text);
    tab.setText(title);//from  w  w  w  . j  av  a  2  s  . c o  m
    tab.setSingleLine();
    tab.setMinWidth(screenWidth / 8);
    redTip = (CircleImageView) view.findViewById(R.id.tab_tip);
    if (redTipPos == position) {
        redTip.setVisibility(View.VISIBLE);
    } else {
        redTip.setVisibility(View.GONE);
    }
    addTab(position, view);

    // } else {
    // TextView tab = new TextView(getContext());
    // tab.setGravity(Gravity.CENTER);
    // tab.setSingleLine();
    // tab.setText(title);
    // addTab(position, tab);
    // }
}

From source file:so.contacts.hub.basefunction.widget.viewpagerindicator.PagerSlidingTabStrip.java

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

    TextView tab = new TextView(getContext());
    tab.setText(title);/*  w  ww.j av  a  2  s.c  o m*/
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    tab.setEllipsize(TruncateAt.END);
    addTab(position, tab);
}

From source file:com.mozhuowen.widget.views.PagerSlidingTabStrip.java

private void addTextTab(final int position, String title) {
    //?,/*from ww w  .  jav a  2s.  co m*/
    if (title.contains("$")) {
        String[] str = title.split("\\$");
        addTextTab(position, str[0], str[1]);
        isDoubleLayerInfo[position] = true;
        return;
    }

    isDoubleLayerInfo[position] = false;
    TextView tab = new TextView(getContext());
    tab.setText(title);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();

    addTab(position, tab);
}