Search in sources :

Example 1 with ButtonData

use of forpdateam.ru.forpda.ui.views.messagepanel.advanced.ButtonData in project ForPDA by RadiationX.

the class PanelItemAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
    ButtonData item = items.get(position);
    if (type == TYPE_ASSET) {
        ImageLoader.getInstance().loadImage(urlsToAssets.get(position), new SimpleImageLoadingListener() {

            @Override
            public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                holder.button.setImageBitmap(loadedImage);
            }
        });
    } else if (type == TYPE_DRAWABLE) {
        holder.button.setImageDrawable(App.getVecDrawable(holder.itemView.getContext(), item.getIconRes()));
    // holder.button.setColorFilter(colorFilter);
    }
    if (item.getTitle() == null) {
        holder.title.setVisibility(View.GONE);
        holder.itemView.setContentDescription(item.getText());
    } else {
        holder.itemView.setContentDescription(item.getTitle());
        holder.title.setText(item.getTitle());
        holder.title.setVisibility(View.VISIBLE);
    }
}
Also used : SimpleImageLoadingListener(com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener) Bitmap(android.graphics.Bitmap) ButtonData(forpdateam.ru.forpda.ui.views.messagepanel.advanced.ButtonData) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

Bitmap (android.graphics.Bitmap)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 TextView (android.widget.TextView)1 SimpleImageLoadingListener (com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener)1 ButtonData (forpdateam.ru.forpda.ui.views.messagepanel.advanced.ButtonData)1