I am making a calculator, and user input is contained in an EditText. The input is entered via the buttons on the screen, so the Android keyboard is disabled. However, I want it to write all the input in one line and when the line reaches the border, it should be ellipse and then scroll horizontally so that you can reach the whole text.
I tried to do this by setting android: maxLines = "1" and android: ellipsize = "end", but this does not work. The text is still in multiple lines, but only one line is displayed, and you need to scroll vertically to see the other lines. I also tried using android: singleLine = "true", but this makes EditText completely unusable.
This is EditText XML:
<EditText android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="end" android:background="@color/colorBlue" android:textAlignment="textEnd" android:textSize="40sp" />
leonz source share