Source:
@Override public void setCard(@NonNull AnnouncementCard card) { super.setCard(card); if (!TextUtils.isEmpty(card.extract())) { textView.setText(StringUtil.fromHtml(card.extract())); } if (!card.hasAction()) { actionViewPositive.setVisibility(GONE); actionViewNegative.setVisibility(GONE); } else { actionViewPositive.setVisibility(VISIBLE); actionViewNegative.setVisibility(VISIBLE); actionViewPositive.setText(card.actionTitle()); } if (!TextUtils.isEmpty(card.negativeText())) { actionViewNegative.setText(card.negativeText()); } else { actionViewNegative.setVisibility(GONE); } if (card.hasImage()) { headerImageView.setVisibility(VISIBLE); headerImageView.loadImage(card.image()); } else { headerImageView.setVisibility(GONE); } if (card.imageHeight() > 0) { ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) headerImageView.getLayoutParams(); params.height = DimenUtil.roundedDpToPx(card.imageHeight()); headerImageView.setLayoutParams(params); } if (card.hasFooterCaption()) { footerTextView.setText(StringUtil.fromHtml(card.footerCaption())); RichTextUtil.removeUnderlinesFromLinks(footerTextView); } else { footerTextView.setVisibility(GONE); footerBorderView.setVisibility(GONE); } if (card.hasBorder()) { container.setStrokeColor(getResources().getColor(R.color.red30)); container.setStrokeWidth(10); } else { container.setDefaultBorder(); } if (card.isArticlePlacement()) { LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) container.getLayoutParams(); layoutParams.setMarginStart(0); layoutParams.setMarginEnd(0); layoutParams.setMargins(0, 0, 0, 0); container.setLayoutParams(layoutParams); container.setRadius(0); } }

Target:
@Override public void setCard(@NonNull AnnouncementCard card) { super.setCard(card); if (!TextUtils.isEmpty(card.extract())) { textView.setText(StringUtil.fromHtml(card.extract())); } if (!card.hasAction()) { actionViewPositive.setVisibility(GONE); actionViewNegative.setVisibility(GONE); } else { actionViewPositive.setVisibility(VISIBLE); actionViewNegative.setVisibility(VISIBLE); actionViewPositive.setText(card.actionTitle()); } if (!TextUtils.isEmpty(card.negativeText())) { actionViewNegative.setText(card.negativeText()); } else { actionViewNegative.setVisibility(GONE); } if (card.hasImage()) { headerImageView.setVisibility(VISIBLE); headerImageView.loadImage(card.image()); } else { headerImageView.setVisibility(GONE); } if (card.imageHeight() > 0) { ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) headerImageView.getLayoutParams(); params.height = DimenUtil.roundedDpToPx(card.imageHeight()); headerImageView.setLayoutParams(params); } if (card.hasFooterCaption()) { footerTextView.setText(StringUtil.fromHtml(card.footerCaption())); RichTextUtil.removeUnderlinesFromLinks(footerTextView); } else { footerTextView.setVisibility(GONE); footerBorderView.setVisibility(GONE); } if (card.hasBorder()) { container.setStrokeColor(getResources().getColor(R.color.red30)); container.setStrokeWidth(10); } else { container.setDefaultBorder(); } if (card.isArticlePlacement()) { container.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); container.setRadius(0); } }