Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;

public class Main {
    public static String getTextOmit(TextPaint paint, String str, int width) {
        String des = null;
        CharSequence sequence = TextUtils.ellipsize(str, paint, width, TruncateAt.END);
        if (sequence != null) {
            des = sequence.toString();
        }
        return des;
    }
}