Package 

Class BatchBannerView


  • 
    public class BatchBannerView
    
                        

    BatchBannerView handles operations related to a Batch In-App Messaging banner, when used in manual mode.

    It is not actually a view that you can directly add to your hierarchy. You will have to use show and dismiss to control how it shows up.

    • Method Summary

      Modifier and Type Method Description
      void show(@NonNull() Activity activity) Shows the banner for the specified activity.
      void show(@NonNull() View anchorView) Shows the banner for the specified anchor view.
      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.
      void dismiss(boolean animated) Dismiss the banner if it's still on screen.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • dismiss

         void dismiss(boolean animated)

        Dismiss the banner if it's still on screen.

        Calling this doesn't allow you to call show again.

        Parameters:
        animated - true if the dismissal should be animated, false otherwise