Skip to content

Instantly share code, notes, and snippets.

View imhoff's full-sized avatar

Paul Imhoff imhoff

  • Munich, Germany
View GitHub Profile
@imhoff
imhoff / EllipsizingTextView.java
Last active December 10, 2018 09:18
Androd Ellipsizing Multiline TextView. Taken from http://stackoverflow.com/a/6763689 and extended to supported the ellipsize modes START, END, MIDDLE
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.text.Layout;
import android.text.Layout.Alignment;
import android.text.StaticLayout;
import android.text.TextUtils.TruncateAt;