Skip to content

Instantly share code, notes, and snippets.

View santaevpavel's full-sized avatar

Pavel Santaev santaevpavel

View GitHub Profile
@santaevpavel
santaevpavel / OutlineSpan.kt
Created July 9, 2018 06:25
Class for outlining text (TextView) on Android
class OutlineSpan(
@ColorInt private val strokeColor: Int,
@Dimension private val strokeWidth: Float
): ReplacementSpan() {
override fun getSize(
paint: Paint,
text: CharSequence,
start: Int,
end: Int,
public class Utf8MaxLengthFilter implements InputFilter {
private int maxLength;
public Utf8MaxLengthFilter(int maxLength) {
this.maxLength = maxLength;
}
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest,