-
public class BatchBannerView
-
-
Method Summary
Modifier and Type Method Description voidshow(@NonNull() Activity activity)Shows the banner for the specified activity. voidshow(@NonNull() View anchorView)Shows the banner for the specified anchor view. voidembed(@NonNull() FrameLayout embedLayout)Shows the banner in the given layout.Should only be used in very specific cases where none of the automatic display methods are appropriate. voiddismiss(boolean animated)Dismiss the banner if it's still on screen. -
-
Method Detail
-
show
void show(@NonNull() Activity activity)
Shows the banner for the specified activity. This is equivalent to calling show(findViewById(android.R.id.content)).If you'd like to attach the banner on a CoordinatorLayout, you should use show, or have your activity implement Batch.Messaging.DisplayHintProvider.This can only be called once per instance of BatchBannerView, even if dismiss has been called.You can run this method on any thread.
- Parameters:
activity- Activity to display the banner on.
-
show
void show(@NonNull() View anchorView)
Shows the banner for the specified anchor view. Just like a Snackbar, the anchor view can be any view from your hierarchy.BatchBannerView will automatically explore your view hierarchy to find the most appropriate view to display itself onto.Usually, this should be a CoordinatorLayout, or your root view.This can only be called once per instance of BatchBannerView, even if dismiss has been called.You can run this method on any thread.
- Parameters:
anchorView- View used as a base to find the best view to be attached to.
-
embed
void embed(@NonNull() FrameLayout embedLayout)
Shows the banner in the given layout.Should only be used in very specific cases where none of the automatic display methods are appropriate.Do not make any assumption about the views that Batch will add, as it is merely an implementation detail and subject to change.
- Parameters:
embedLayout- Layout to embed the banner in
-
-
-
-