use of android.text.method.SingleLineTransformationMethod in project LuaViewSDK by alibaba.
the class TextUtil method getMaxLines.
private static int getMaxLines(TextView view) {
// No limit (Integer.MAX_VALUE also means no limit)
int maxLines = -1;
TransformationMethod method = view.getTransformationMethod();
if (method != null && method instanceof SingleLineTransformationMethod) {
maxLines = 1;
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
// setMaxLines() and getMaxLines() are only available on android-16+
maxLines = view.getMaxLines();
}
return maxLines;
}
use of android.text.method.SingleLineTransformationMethod in project android-autofittextview by grantland.
the class AutofitHelper method getMaxLines.
private static int getMaxLines(TextView view) {
// No limit (Integer.MAX_VALUE also means no limit)
int maxLines = -1;
TransformationMethod method = view.getTransformationMethod();
if (method != null && method instanceof SingleLineTransformationMethod) {
maxLines = 1;
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
// setMaxLines() and getMaxLines() are only available on android-16+
maxLines = view.getMaxLines();
}
return maxLines;
}
use of android.text.method.SingleLineTransformationMethod in project LuaViewSDK by alibaba.
the class AutofitHelper method getMaxLines.
private static int getMaxLines(TextView view) {
// No limit (Integer.MAX_VALUE also means no limit)
int maxLines = -1;
TransformationMethod method = view.getTransformationMethod();
if (method != null && method instanceof SingleLineTransformationMethod) {
maxLines = 1;
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
// setMaxLines() and getMaxLines() are only available on android-16+
maxLines = view.getMaxLines();
}
return maxLines;
}
Aggregations