Example usage for android.widget TextView getTransformationMethod

List of usage examples for android.widget TextView getTransformationMethod

Introduction

In this page you can find the example usage for android.widget TextView getTransformationMethod.

Prototype

public final TransformationMethod getTransformationMethod() 

Source Link

Document

Gets the current android.text.method.TransformationMethod for the TextView.

Usage

From source file:Main.java

private static int getMaxLines(TextView view) {
    int maxLines = -1; // No limit (Integer.MAX_VALUE also means no limit)

    TransformationMethod method = view.getTransformationMethod();
    if (method != null && method instanceof SingleLineTransformationMethod) {
        maxLines = 1;/*from   w w  w. j  a va 2 s. c o  m*/
    } 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;
}