Search in sources :

Example 6 with SpannableBuilder

use of com.alexvasilkov.android.commons.texts.SpannableBuilder in project GestureViews by alexvasilkov.

the class RecyclerAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
    final Painting painting = paintings[position];
    // Storing item position for click handler
    holder.itemView.setTag(R.id.tag_item, position);
    GlideHelper.loadThumb(holder.image, painting.thumbId);
    CharSequence text = new SpannableBuilder(holder.title.getContext()).createStyle().setFont(Typeface.DEFAULT_BOLD).apply().append(painting.author).append("\n").clearStyle().append(painting.title).build();
    holder.title.setText(text);
}
Also used : SpannableBuilder(com.alexvasilkov.android.commons.texts.SpannableBuilder) Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Aggregations

SpannableBuilder (com.alexvasilkov.android.commons.texts.SpannableBuilder)6 Painting (com.alexvasilkov.gestures.sample.ex.utils.Painting)3 Photo (com.googlecode.flickrjandroid.photos.Photo)2 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1