I'm not sure it answers the question (and I guess the original asker is not so interested anymore, after 7 and a half years), but I'm pretty confident my answer will come in handy to anyone stumbling into ellipsis issues with EditText.
Don't try to find any logic in this, but based on the answers from Oleksandr and Mubarak, I figured out the following:
To ellipsize an EditText in XML, use deprecated android:editable="false"
. In my case:
android:editable="false"
android:focusable="false"
android:singleLine="true"
android:maxLines="1"
android:ellipsize="end"
No need to mess with android:inputType="none"
for the moment. The EditText looks just like a TextView and is properly ellipsized.
It is possible to make the EditText editable (and remove the ellipsis) like this:
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
editText.setActivated(true);
editText.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS); // or whatever fits your needs
editText.setSingleLine(true);
editText.setEllipsize(null);
editText.requestFocus();
Your can then restore the EditText to its original state (ie. disguised as a TextView and properly ellipsized) like this:
editText.setFocusable(false);
editText.setFocusableInTouchMode(false);
editText.setActivated(false);
editText.setSingleLine(true);
editText.setKeyListener(null); // this is the key
editText.setEllipsize(TextUtils.TruncateAt.END);