Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.text.Layout;

import android.widget.TextView;

public class Main {
    /**
     * Returns true if the textview is ellipsized
     * @param textView
     * @return
     */
    public static boolean isTextEllipsized(TextView textView) {

        Layout textViewLayout = textView.getLayout();

        if (textViewLayout != null) {

            int lines = textViewLayout.getLineCount();

            if (lines > 0) {

                if (textViewLayout.getEllipsisCount(lines - 1) > 0)
                    return true;
            }
        }

        return false;
    }
}