Example usage for android.text.style DynamicDrawableSpan ALIGN_BOTTOM

List of usage examples for android.text.style DynamicDrawableSpan ALIGN_BOTTOM

Introduction

In this page you can find the example usage for android.text.style DynamicDrawableSpan ALIGN_BOTTOM.

Prototype

int ALIGN_BOTTOM

To view the source code for android.text.style DynamicDrawableSpan ALIGN_BOTTOM.

Click Source Link

Document

A constant indicating that the bottom of this span should be aligned with the bottom of the surrounding text, i.e., at the same level as the lowest descender in the text.

Usage

From source file:com.vuze.android.remote.adapter.SideFilterAdapter.java

@Override
public void onBindFlexibleViewHolder(SideFilterViewHolder holder, int position) {
    SideFilterInfo item = getItem(position);
    if (item.letters.equals(TorrentListFragment.LETTERS_BS)) {
        ImageSpan imageSpan = new ImageSpan(context, R.drawable.ic_backspace_white_24dp,
                DynamicDrawableSpan.ALIGN_BOTTOM);
        SpannableStringBuilder ss = new SpannableStringBuilder(",");
        ss.setSpan(imageSpan, 0, 1, 0);/*from  w ww  .j  ava  2  s . c  om*/
        holder.tvText.setText(ss);
    } else {
        holder.tvText.setText(item.letters);

        int resID = item.letters.length() > 1 ? android.R.style.TextAppearance_Small
                : android.R.style.TextAppearance_Large;
        holder.tvText.setTextAppearance(context, resID);
        holder.tvText.setTextColor(ContextCompat.getColor(context, R.color.login_text_color));
    }
    holder.tvCount.setText(item.count > 0 ? String.valueOf(item.count) : "");
}