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

The following examples show how to use android.support.v17.leanback.widget.ImageCardView#setBackgroundColor() . 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: TvShowsCardPresenter.java    From Amphitheatre with Apache License 2.0 6 votes vote down vote up
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
    final ImageCardView cardView = new ImageCardView(mContext);

    cardView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View view, final boolean isFocused) {
            setFocusState(cardView, isFocused, view);
        }
    });

    cardView.setFocusable(true);
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(mContext.getResources().getColor(R.color.fastlane_background));
    return new ViewHolder(cardView);
}
 
Example 2
Source File: CardPresenter.java    From Amphitheatre with Apache License 2.0 6 votes vote down vote up
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
    final ImageCardView cardView = new ImageCardView(mContext);

    cardView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View view, final boolean isFocused) {
            setFocusState(cardView, isFocused, view);
        }
    });

    cardView.setFocusable(true);
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(mContext.getResources().getColor(R.color.fastlane_background));
    return new ViewHolder(cardView);
}
 
Example 3
Source File: CardPresenter.java    From alltv with MIT License 5 votes vote down vote up
private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
    int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
    // Both background colors should be set because the view's background is temporarily visible
    // during animations.
    view.setBackgroundColor(color);
    view.findViewById(R.id.info_field).setBackgroundColor(color);
}
 
Example 4
Source File: CardPresenter.java    From leanback-homescreen-channels with Apache License 2.0 5 votes vote down vote up
private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
    int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
    // Both background colors should be set because the view's background is temporarily visible
    // during animations.
    view.setBackgroundColor(color);
    view.findViewById(R.id.info_field).setBackgroundColor(color);
}
 
Example 5
Source File: CardPresenter.java    From leanback-extensions with Apache License 2.0 5 votes vote down vote up
private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
	int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
	// Both background colors should be set because the view's background is temporarily visible
	// during animations.
	view.setBackgroundColor(color);
	view.findViewById(R.id.info_field).setBackgroundColor(color);
}
 
Example 6
Source File: VideoContentCardPresenter.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
    int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
    // Both background colors should be set because the view's background is temporarily visible
    // during animations.
    view.setBackgroundColor(color);
    view.findViewById(R.id.info_field).setBackgroundColor(color);
}
 
Example 7
Source File: CardPresenter.java    From VCL-Android with Apache License 2.0 5 votes vote down vote up
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {

    ImageCardView cardView = new ImageCardView(sContext);
    cardView.setFocusable(true);
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(mRes.getColor(R.color.lb_details_overview_bg_color));
    cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);
    return new ViewHolder(cardView);
}
 
Example 8
Source File: CardPresenter.java    From CumulusTV with MIT License 5 votes vote down vote up
private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
    int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
    // Both background colors should be set because the view's background is temporarily visible
    // during animations.
    view.setBackgroundColor(color);
    view.findViewById(R.id.info_field).setBackgroundColor(color);
}
 
Example 9
Source File: CardPresenter.java    From TuentiTV with Apache License 2.0 5 votes vote down vote up
@Override public ViewHolder onCreateViewHolder(ViewGroup parent) {
  context = parent.getContext();

  ImageCardView cardView = new ImageCardView(context);
  cardView.setFocusable(true);
  cardView.setBackgroundColor(context.getResources().getColor(R.color.third_color));
  return new ViewHolder(cardView);
}
 
Example 10
Source File: CardPresenter.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
    Log.d(TAG, "onCreateViewHolder");
    mContext = parent.getContext();

    ImageCardView cardView = new ImageCardView(mContext);
    cardView.setFocusable(true);
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(mContext.getResources().getColor(R.color.fastlane_background));
    return new ViewHolder(cardView);
}
 
Example 11
Source File: CardPresenter.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
    Log.d(TAG, "onCreateViewHolder");
    mContext = parent.getContext();

    ImageCardView cardView = new ImageCardView(mContext);
    cardView.setFocusable(true);
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(mContext.getResources().getColor(R.color.fastlane_background));
    return new ViewHolder(cardView);
}
 
Example 12
Source File: CardPresenter.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
    Log.d(TAG, "onCreateViewHolder");
    mContext = parent.getContext();

    ImageCardView cardView = new ImageCardView(mContext);
    cardView.setFocusable(true);
    cardView.setFocusableInTouchMode(true);
    cardView.setBackgroundColor(mContext.getResources().getColor(R.color.fastlane_background));
    return new ViewHolder(cardView);
}
 
Example 13
Source File: CardPresenter.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
    int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
    // Both background colors should be set because the view's background is temporarily visible
    // during animations.
    view.setBackgroundColor(color);
    view.findViewById(R.id.info_field).setBackgroundColor(color);
}
 
Example 14
Source File: SettingsIconPresenter.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
private void setImageBackground(ImageCardView imageCardView, int colorId) {
    imageCardView.setBackgroundColor(getContext().getResources().getColor(colorId));
}
 
Example 15
Source File: VideoCardPresenter.java    From leanback-showcase with Apache License 2.0 3 votes vote down vote up
/**
 * Helper function to update selected video clip's background color. Info field should also
 * be updated for consistent ui.
 *
 * @param view
 * @param selected
 */
private void updateCardBackgroundColor(ImageCardView view, boolean selected) {
    int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;

    view.setBackgroundColor(color);
    view.findViewById(R.id.info_field).setBackgroundColor(color);
}