/// <summary> /// Check if the message supports the given orientation /// </summary> /// <returns> /// True if there is any format that supports the given orientation. /// </returns> public bool SupportsOrientation(SwrveOrientation orientation) { if (orientation == SwrveOrientation.Both) { return(true); } return(GetFormat(orientation) != null); }
public static void InitMessage(SwrveMessageFormat format, SwrveOrientation deviceOrientation) { if (Animator != null) { Animator.InitMessage(format); return; } format.Init(deviceOrientation); format.InitAnimation(new Point(0, 0), new Point(0, 0)); }
public void Init(SwrveOrientation deviceOrientation) { Closing = false; Dismissed = false; Rotate = Orientation != deviceOrientation; if (MessageListener != null) { MessageListener.OnShow(this); } }
public void Init(SwrveOrientation deviceOrientation) { this.Closing = false; this.Dismissed = false; this.Rotate = (this.Orientation != deviceOrientation); if (this.MessageListener != null) { this.MessageListener.OnShow(this); } }
/// <summary> /// Initialize the message to be displayed. /// </summary> public void Init(SwrveOrientation deviceOrientation) { this.Closing = false; this.Dismissed = false; // Check if we have to rotate the format this.Rotate = (this.Orientation != deviceOrientation); if (MessageListener != null) { MessageListener.OnShow(this); } }
public static void InitMessage(SwrveMessageFormat format, SwrveOrientation deviceOrientation) { if (SwrveMessageRenderer.Animator != null) { SwrveMessageRenderer.Animator.InitMessage(format); } else { format.Init(deviceOrientation); format.InitAnimation(new Point(0, 0), new Point(0, 0)); } }
public SwrveMessageFormat GetFormat(SwrveOrientation orientation) { IEnumerator <SwrveMessageFormat> enumerator = this.Formats.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Orientation == orientation) { return(enumerator.Current); } } return(null); }
/// <summary> /// Get the format for the given orientation. /// </summary> /// <param name="orientation"> /// Current orientation. /// </param> /// <returns> /// The format with the given orientation if available. /// </returns> public SwrveMessageFormat GetFormat(SwrveOrientation orientation) { IEnumerator <SwrveMessageFormat> formatsIt = Formats.GetEnumerator(); while (formatsIt.MoveNext()) { if (formatsIt.Current.Orientation == orientation) { return(formatsIt.Current); } } return(null); }
public abstract bool SupportsOrientation(SwrveOrientation orientation);
public override bool SupportsOrientation(SwrveOrientation orientation) { // there is no orientation defined as part of embedded so this is purely up to the developer whether or not to display it return(true); }
public void InitMessage(SwrveMessageFormat format, SwrveInAppMessageConfig inAppConfig, SwrveOrientation deviceOrientation, bool afterRotation = false) { this.format = format; format.Init(deviceOrientation); renderBackgroundColor = format.BackgroundColor.HasValue; if (!afterRotation) { if (animator != null) { animator.InitMessage(format); } else { format.InitAnimation(new Point(0, 0), new Point(0, 0)); } } // Create widgets to render and use the cached personalization values widgetViews = new SwrveWidgetView[format.Images.Count + format.Buttons.Count]; int eindex = 0; for (int ii = 0; ii < format.Images.Count; ii++) { SwrveImage image = format.Images[ii]; SwrveWidgetView renderer; if (image.Text != null) { // Get cached resolved template string resolvedTextTemplate = templatingResolver.TextResolution[image]; renderer = new SwrveMessagePersonalizedWidgetView(image, resolvedTextTemplate, inAppConfig); } else { renderer = new SwrveImageView(image); } widgetViews[eindex++] = renderer; } for (int bi = 0; bi < format.Buttons.Count; bi++) { SwrveButton button = format.Buttons[bi]; SwrveWidgetView renderer; if (button.Text != null) { string resolvedTextTemplate = templatingResolver.TextResolution[button]; renderer = new SwrveMessagePersonalizedWidgetView(button, resolvedTextTemplate, inAppConfig); } else { renderer = new SwrveButtonView(button, inAppConfig.ButtonClickTintColor); } widgetViews[eindex++] = renderer; } }
public override List <SwrveBaseCampaign> GetMessageCenterCampaigns(SwrveOrientation orientation) { return(new List <SwrveBaseCampaign>()); }
public override void ShowMessageCenterCampaign(SwrveBaseCampaign campaign, SwrveOrientation orientation) { }
public bool SupportsOrientation(SwrveOrientation orientation) { return(orientation == SwrveOrientation.Both || this.GetFormat(orientation) != null); }
public override bool SupportsOrientation(SwrveOrientation orientation) { return(Messages.Any((SwrveMessage m) => m.SupportsOrientation(orientation))); }
override public bool SupportsOrientation(SwrveOrientation orientation) { return(true); }
public override bool SupportsOrientation(SwrveOrientation orientation) { return(this.Messages.Any(m => m.SupportsOrientation(orientation))); }