use of android.support.v17.leanback.widget.ImageCardView in project cw-omnibus by commonsguy.
the class PresoPresenter method onCreateViewHolder.
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
ImageCardView cardView = new ImageCardView(parent.getContext());
cardView.setFocusable(true);
cardView.setFocusableInTouchMode(true);
return (new Holder(cardView));
}
use of android.support.v17.leanback.widget.ImageCardView in project vlc-android by videolan.
the class AsyncImageLoader method updateTargetImage.
public static void updateTargetImage(final Bitmap bitmap, final View target, final ViewDataBinding vdb) {
if (bitmap == null || bitmap.getWidth() <= 1 || bitmap.getHeight() <= 1)
return;
if (vdb != null) {
vdb.setVariable(BR.scaleType, ImageView.ScaleType.FIT_CENTER);
vdb.setVariable(BR.cover, new BitmapDrawable(target.getResources(), bitmap));
vdb.setVariable(BR.protocol, null);
} else {
VLCApplication.runOnMainThread(new Runnable() {
@Override
public void run() {
if (target instanceof ImageView) {
final ImageView iv = (ImageView) target;
iv.setScaleType(ImageView.ScaleType.FIT_CENTER);
iv.setImageBitmap(bitmap);
iv.setVisibility(View.VISIBLE);
} else if (target instanceof TextView) {
ViewCompat.setBackground(target, new BitmapDrawable(VLCApplication.getAppResources(), bitmap));
((TextView) target).setText(null);
} else if (target instanceof ImageCardView) {
((ImageCardView) target).getMainImageView().setScaleType(ImageView.ScaleType.CENTER_CROP);
((ImageCardView) target).setMainImage(new BitmapDrawable(target.getResources(), bitmap));
}
}
});
}
}
use of android.support.v17.leanback.widget.ImageCardView in project vlc-android by GeoffreyMetais.
the class CardPresenter method onCreateViewHolder.
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
ImageCardView cardView = new ImageCardView(mContext);
cardView.setFocusable(true);
cardView.setFocusableInTouchMode(true);
cardView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.lb_details_overview_bg_color));
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);
return new ViewHolder(cardView);
}
use of android.support.v17.leanback.widget.ImageCardView in project butter-android by butterproject.
the class EpisodeCardPresenter method onCreateViewHolder.
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
context = parent.getContext();
ImageCardView cardView = new ImageCardView(context);
cardView.setCardType(BaseCardView.CARD_TYPE_INFO_UNDER);
cardView.setInfoVisibility(BaseCardView.CARD_REGION_VISIBLE_ALWAYS);
cardView.setFocusable(true);
cardView.setFocusableInTouchMode(true);
cardView.setBackgroundColor(ActivityCompat.getColor(context, R.color.default_background));
return new ViewHolder(cardView);
}
use of android.support.v17.leanback.widget.ImageCardView in project butter-android by butterproject.
the class LoadingCardPresenter method onBindLoadingViewHolder.
public void onBindLoadingViewHolder(Presenter.ViewHolder viewHolder) {
final ImageCardView cardView = (ImageCardView) viewHolder.view;
cardView.setMainImageScaleType(ImageView.ScaleType.CENTER_INSIDE);
cardView.setMainImage(ContextCompat.getDrawable(context, R.drawable.placeholder_inset));
cardView.setTitleText(context.getString(R.string.loading));
cardView.setMainImageDimensions(cardWidth, cardHeight);
}
Aggregations