Java Code Examples for android.support.v17.leanback.widget.ImageCardView#setMainImage()

The following examples show how to use android.support.v17.leanback.widget.ImageCardView#setMainImage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CardPresenter.java    From alltv with MIT License 5 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {

    // Log.d(TAG, "onUnbindViewHolder");

    ImageCardView cardView = (ImageCardView) viewHolder.view;

    // Remove references to images so that the garbage collector can free up memory
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 2
Source File: CardPresenter.java    From leanback-homescreen-channels with Apache License 2.0 5 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    // Remove references to images so that the garbage collector can free up memory
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 3
Source File: CardPresenter.java    From leanback-extensions with Apache License 2.0 5 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
	Log.d(TAG, "onUnbindViewHolder");
	ImageCardView cardView = (ImageCardView) viewHolder.view;
	// Remove references to images so that the garbage collector can free up memory
	cardView.setBadgeImage(null);
	cardView.setMainImage(null);
}
 
Example 4
Source File: ApkPresenter.java    From TvAppRepo with Apache License 2.0 5 votes vote down vote up
@Override
public void onUnbindViewHolder(ViewHolder viewHolder) {
    Log.d(TAG, "onUnbindViewHolder");
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    // Remove references to images so that the garbage collector can free up memory
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 5
Source File: OptionsCardPresenter.java    From TvAppRepo with Apache License 2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
    final SettingOption option = (SettingOption) item;
    final ImageCardView cardView = (ImageCardView) viewHolder.view;
    cardView.setMainImage(option.getDrawable());
    cardView.setTitleText(option.getText());
    cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);
    cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
}
 
Example 6
Source File: CardPresenter.java    From TvAppRepo with Apache License 2.0 5 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    // Remove references to images so that the garbage collector can free up memory
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 7
Source File: DownloadedFilesPresenter.java    From TvAppRepo with Apache License 2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
    final File downloadedApk = (File) item;
    final ImageCardView cardView = (ImageCardView) viewHolder.view;
    cardView.setMainImage(contextThemeWrapper.getDrawable(R.drawable.download));
    cardView.setTitleText(downloadedApk.getName());
    cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);
    cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
}
 
Example 8
Source File: VideoCardPresenter.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@Override
public void onUnbindViewHolder(ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;

    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 9
Source File: OptionsCardPresenter.java    From CumulusTV with MIT License 5 votes vote down vote up
@Override
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
    final Option option = (Option) item;
    final ImageCardView cardView = (ImageCardView) viewHolder.view;
    if (DEFAULT_BANNER) {
        cardView.setMainImage(contextThemeWrapper.getDrawable(R.drawable.c_banner_3_2));
    } else {
        cardView.setMainImage(option.getDrawable());
    }
    cardView.setTitleText(option.getText());
    cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);
    cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
    cardView.findViewById(R.id.info_field).setBackgroundColor(
            ContextCompat.getColor(contextThemeWrapper, R.color.colorPrimaryDark));
}
 
Example 10
Source File: CardPresenter.java    From CumulusTV with MIT License 5 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    // Remove references to images so that the garbage collector can free up memory
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 11
Source File: CardPresenter.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
    Log.d(TAG, "onUnbindViewHolder");
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    // Remove references to images so that the garbage collector can free up memory
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 12
Source File: ImgCardPresenter.java    From AndroidTVLauncher with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onUnbindViewHolder(ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 13
Source File: FunctionCardPresenter.java    From AndroidTVLauncher with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onUnbindViewHolder(ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 14
Source File: AppCardPresenter.java    From AndroidTVLauncher with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onUnbindViewHolder(ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}
 
Example 15
Source File: VideoContentCardPresenter.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
@Override
public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
    ImageCardView cardView = (ImageCardView) viewHolder.view;
    cardView.setBadgeImage(null);
    cardView.setMainImage(null);
}