Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting ems size of a string in Android

Tags:

java

android

I'm trying to add ellipses to words that exceed 11 ems in an Android textview (instead of having words >11ems wordwrap mid-word) while the rest of the text continues on the next line.

I.E

|Reallylongwordgoeshe...|
|and the rest of the |
|text goes here. |

I've decide to just calculate the ems size of each tokenized string, but I'm unsure of how to do that. Any suggestions?

like image 380
craya Avatar asked Feb 10 '15 20:02

craya


Video Answer


1 Answers

The following in the android dev references helped me: https://developer.android.com/reference/android/widget/MultiAutoCompleteTextView.html especially if you look at the documentation for the following: void performFiltering (CharSequence text, int start, int end, int keyCode)

like image 81
Nick B Avatar answered Sep 20 '22 15:09

Nick B