Example usage for android.text Spanned SPAN_POINT_MARK

List of usage examples for android.text Spanned SPAN_POINT_MARK

Introduction

In this page you can find the example usage for android.text Spanned SPAN_POINT_MARK.

Prototype

int SPAN_POINT_MARK

To view the source code for android.text Spanned SPAN_POINT_MARK.

Click Source Link

Document

SPAN_POINT_MARK is a synonym for #SPAN_EXCLUSIVE_EXCLUSIVE .

Usage

From source file:com.darly.im.ui.CCPActivityBase.java

/**
 *
 *///  w w w.j ava2  s  . c om
protected SpannableString buildActionTitle() {
    int dimensionPixelSize = mActionBarActivity.getResources().getDimensionPixelSize(R.dimen.BigTextSize);

    int mutIndex = 0;
    String format = "%s";
    if (isMute) {
        format = format + " #";
        mutIndex += 2;
    }

    SpannableString spannableString = EmoticonUtil.getTextFormat(mActionBarActivity,
            String.format(format, new Object[] { mTitleText }), dimensionPixelSize);
    if (isMute) {
        if (mMuteIcon == null) {
            mMuteIcon = getTitleIconTips(dimensionPixelSize, R.drawable.chat_mute_notify_title_icon);
        }
        int length = spannableString.length() - mutIndex + 1;
        spannableString.setSpan(mMuteIcon, length, length + 1, Spanned.SPAN_POINT_MARK);
    }
    return spannableString;
}