Java Code Examples for android.widget.EditText#setEllipsize()

The following examples show how to use android.widget.EditText#setEllipsize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditTextSettingsCell.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public EditTextSettingsCell(Context context) {
    super(context);

    textView = new EditText(context);
    textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
    textView.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    textView.setLines(1);
    textView.setMaxLines(1);
    textView.setSingleLine(true);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
    textView.setBackgroundDrawable(null);
    textView.setPadding(0, 0, 0, 0);
    textView.setInputType(textView.getInputType() |EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES);
    addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 17, 0));
}
 
Example 2
Source File: EditTextSettingsCell.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public EditTextSettingsCell(Context context) {
    super(context);

    textView = new EditText(context);
    textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
    textView.setHintTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteHintText));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    textView.setLines(1);
    textView.setMaxLines(1);
    textView.setSingleLine(true);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
    textView.setBackgroundDrawable(null);
    textView.setPadding(0, 0, 0, 0);
    textView.setInputType(textView.getInputType() |EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES);
    addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 17, 0, 17, 0));
}
 
Example 3
Source File: JieEditTextDel.java    From AndJie with GNU General Public License v2.0 5 votes vote down vote up
protected void initLayout() {
	context = getContext();
	view = LayoutInflater.from(context).inflate(R.layout.item_editext_del,
			null);
	lefText = (TextView) view.findViewById(R.id.leftText);
	middleText = (EditText) view.findViewById(R.id.middleText);
	rightText = (TextView) view.findViewById(R.id.rightText);
	rightImg = (ImageView) view.findViewById(R.id.right_img);
	middleText.setSingleLine(true);
	middleText.setEllipsize(TruncateAt.END);
	middleText.setClickable(true);
	addListener();
	addView(view);
}