Add review banner to CFv2.

This commit is contained in:
Cody Henthorne
2023-05-26 15:25:27 -04:00
parent b785b3f887
commit 64ddd982fe
10 changed files with 261 additions and 111 deletions

View File

@@ -30,6 +30,7 @@ public class ReviewBannerView extends LinearLayout {
private AvatarImageView topLeftAvatar;
private AvatarImageView bottomRightAvatar;
private View stroke;
private OnHideListener onHideListener;
public ReviewBannerView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -55,7 +56,17 @@ public class ReviewBannerView extends LinearLayout {
topLeftAvatar.setFallbackPhotoProvider(provider);
bottomRightAvatar.setFallbackPhotoProvider(provider);
bannerClose.setOnClickListener(v -> setVisibility(GONE));
bannerClose.setOnClickListener(v -> {
if (onHideListener != null && onHideListener.onHide()) {
return;
}
setVisibility(GONE);
});
}
public void setOnHideListener(@Nullable OnHideListener onHideListener) {
this.onHideListener = onHideListener;
}
public void setBannerMessage(@Nullable CharSequence charSequence) {
@@ -121,4 +132,8 @@ public class ReviewBannerView extends LinearLayout {
return new FallbackPhoto20dp(getFallbackResId()).asDrawable(context, color, inverted);
}
}
public interface OnHideListener {
boolean onHide();
}
}