android.widget.TextView.getEllipsize()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中android.widget.TextView.getEllipsize()方法的一些代码示例,展示了TextView.getEllipsize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getEllipsize()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getEllipsize

TextView.getEllipsize介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

public S hasEllipsize(TextUtils.TruncateAt truncation) {
 isNotNull();
 TextUtils.TruncateAt actualTruncation = actual.getEllipsize();
 assertThat(actualTruncation) //
   .overridingErrorMessage("Expected ellipsize <%s> but was <%s>.", truncation,
     actualTruncation) //
   .isEqualTo(truncation);
 return myself;
}

代码示例来源:origin: k9mail/k-9

@Override
public void onClick(View view) {
  int id = view.getId();
  if (id == R.id.from) {
    onAddSenderToContacts();
  } else if (id == R.id.to || id == R.id.cc || id == R.id.bcc) {
    expand((TextView)view, ((TextView)view).getEllipsize() != null);
    layoutChanged();
  } else if (id == R.id.crypto_status_icon) {
    onCryptoClickListener.onCryptoClick();
  } else if (id == R.id.icon_single_message_options) {
    PopupMenu popupMenu = new PopupMenu(getContext(), view);
    popupMenu.setOnMenuItemClickListener(onMenuItemClickListener);
    popupMenu.inflate(R.menu.single_message_options);
    popupMenu.show();
  }
}

代码示例来源:origin: com.squareup.assertj/assertj-android

public S hasEllipsize(TextUtils.TruncateAt truncation) {
 isNotNull();
 TextUtils.TruncateAt actualTruncation = actual.getEllipsize();
 assertThat(actualTruncation) //
   .overridingErrorMessage("Expected ellipsize <%s> but was <%s>.", truncation,
     actualTruncation) //
   .isEqualTo(truncation);
 return myself;
}

代码示例来源:origin: stackoverflow.com

public class MainActivity extends AppCompatActivity {

  private TextView textView;
  private TextUtils.TruncateAt noneEllipsize;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    textView = (TextView) findViewById(R.id.title);
    noneEllipsize = textView.getEllipsize(); // activity_main.xml has ellipsize property set to 'none'.
    textView.setSelected(true);
  }

  public void btnToggleMarqueeClick(View view) {
    if ( textView.getEllipsize() != noneEllipsize ) {
      textView.setEllipsize(noneEllipsize);
    } else {
      textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
    }
  }
}

代码示例来源:origin: stackoverflow.com

noneEllipsize = mTextView.getEllipsize();
mTextView.setText(mText);
mTextView.setSelected(true);
super.onPause();
mTextView.setEllipsize(noneEllipsize);
Log.d(TAG, "text: " + mTextView.getText() + " ellipsize: " + mTextView.getEllipsize());
Log.d(TAG, "text: " + mTextView.getText() + " ellipsize: " + mTextView.getEllipsize());

代码示例来源:origin: stackoverflow.com

final TextUtils.TruncateAt truncateAt = textView.getEllipsize();
if (truncateAt != null && !TextUtils.TruncateAt.MARQUEE.equals(truncateAt)) {

代码示例来源:origin: jbruchanov/AnUitor

values.put("Gravity", translator.gravity(tv.getGravity()));
values.put("AutoLinkMask", translator.linkMask(tv.getAutoLinkMask()));
values.put("Ellipsize", String.valueOf(tv.getEllipsize()));
values.put("InputType", translator.inputType(tv.getInputType()));
values.put("TextScaleX", tv.getTextScaleX());

相关文章

TextView类方法