mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Add review banner to CFv2.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user