Android: Add dialog customizer

Starting from Leanplum Android SDK 5.6.0 you can add a dialog customizer.
This provides an interface to customize the Dialog and content View before showing a message.
This allows easy support of devices with notch by providing several lines of code.
Different window flags can be added. The customizer provides access to the In-app message View, so other views can be also accessed, for example, the WebView used for Web and Rich Interstitials.

You can override each of the customizer's methods to support different types of templates - customizeCenterPopup, customizeBanner, customizeWebInterstitial, customizeInterstitial.

The following is an example of how to draw fullscreen and behind the notch for Interstitial and Banner templates.

MessageTemplates.setCustomizer(new DialogCustomizer() {

    public void customizeInterstitial(Dialog messageDialog, View messageContent) {
        Window window = messageDialog.getWindow();
        if (window == null) {

        // hide status bar

        // draw view fullscreen

        // draw under notch
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){
            window.getAttributes().layoutInDisplayCutoutMode =

    public void customizeBanner(Dialog messageDialog, View messageContent) {
        customizeInterstitial(messageDialog, messageContent);

The DialogCustomizer interface is available on Github.