(String text, int at)
| 2986 | } |
| 2987 | |
| 2988 | static String truncate(String text, int at) { |
| 2989 | if (text.length() < at) |
| 2990 | return text; |
| 2991 | |
| 2992 | String preview = text.substring(0, at); |
| 2993 | int space = preview.lastIndexOf(' '); |
| 2994 | if (space > 0) |
| 2995 | preview = preview.substring(0, space + 1); |
| 2996 | return preview + "…"; |
| 2997 | } |
| 2998 | |
| 2999 | @NonNull |
| 3000 | static String getText(Context context, String html) { |
no test coverage detected