diff options
Diffstat (limited to 'src/com/android/tv/menu/ChannelCardView.java')
-rw-r--r-- | src/com/android/tv/menu/ChannelCardView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/tv/menu/ChannelCardView.java b/src/com/android/tv/menu/ChannelCardView.java index 4ee56892..1c8015a6 100644 --- a/src/com/android/tv/menu/ChannelCardView.java +++ b/src/com/android/tv/menu/ChannelCardView.java @@ -45,6 +45,7 @@ public class ChannelCardView extends BaseCardView<Channel> { private final int mCardImageHeight; private ImageView mImageView; + private View mGradientView; private TextView mChannelNumberNameView; private ProgressBar mProgressBar; private Channel mChannel; @@ -70,6 +71,7 @@ public class ChannelCardView extends BaseCardView<Channel> { protected void onFinishInflate() { super.onFinishInflate(); mImageView = (ImageView) findViewById(R.id.image); + mGradientView = findViewById(R.id.image_gradient); mChannelNumberNameView = (TextView) findViewById(R.id.channel_number_and_name); mProgressBar = (ProgressBar) findViewById(R.id.progress); } @@ -86,7 +88,7 @@ public class ChannelCardView extends BaseCardView<Channel> { mChannelNumberNameView.setVisibility(VISIBLE); mImageView.setImageResource(R.drawable.ic_recent_thumbnail_default); mImageView.setBackgroundResource(R.color.channel_card); - mImageView.setForeground(null); + mGradientView.setVisibility(View.GONE); mProgressBar.setVisibility(GONE); setTextViewEnabled(true); @@ -99,6 +101,8 @@ public class ChannelCardView extends BaseCardView<Channel> { } updateProgramInformation(); + // Call super.onBind() at the end intentionally. In order to correctly handle extension of + // text view, text should be set before calling super.onBind. super.onBind(channel, selected); } @@ -119,7 +123,7 @@ public class ChannelCardView extends BaseCardView<Channel> { private void updatePosterArt(Bitmap posterArt) { mImageView.setImageBitmap(posterArt); - mImageView.setForeground(getContext().getDrawable(R.drawable.card_image_gradient)); + mGradientView.setVisibility(View.VISIBLE); } private void updateProgramInformation() { |