Class SwrveButton


  • public class SwrveButton
    extends java.lang.Object
    In-app message button.
    • Field Detail

      • position

        protected android.graphics.Point position
      • size

        protected android.graphics.Point size
      • text

        protected java.lang.String text
      • dynamicImageUrl

        protected java.lang.String dynamicImageUrl
      • isMultiLine

        protected boolean isMultiLine
      • fontSize

        protected float fontSize
      • isScrollable

        protected boolean isScrollable
      • fontFile

        protected java.lang.String fontFile
      • fontDigest

        protected java.lang.String fontDigest
      • lineHeight

        protected double lineHeight
      • topPadding

        protected int topPadding
      • rightPadding

        protected int rightPadding
      • bottomPadding

        protected int bottomPadding
      • leftPadding

        protected int leftPadding
      • foregroundColor

        protected java.lang.String foregroundColor
      • backgroundColor

        protected java.lang.String backgroundColor
    • Constructor Detail

      • SwrveButton

        public SwrveButton​(SwrveMessage message,
                           org.json.JSONObject buttonData)
                    throws org.json.JSONException
        Throws:
        org.json.JSONException
    • Method Detail

      • getName

        public java.lang.String getName()
      • getImage

        public java.lang.String getImage()
      • getAccessibilityText

        public java.lang.String getAccessibilityText()
      • getAction

        public java.lang.String getAction()
      • getAppId

        public int getAppId()
      • getButtonId

        public long getButtonId()
      • getSizeFrom

        protected static android.graphics.Point getSizeFrom​(org.json.JSONObject data)
                                                     throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getCenterFrom

        protected static android.graphics.Point getCenterFrom​(org.json.JSONObject data)
                                                       throws org.json.JSONException
        Throws:
        org.json.JSONException
      • getPosition

        public android.graphics.Point getPosition()
        Returns:
        the position of the widget.
      • setPosition

        protected void setPosition​(android.graphics.Point position)
      • getSize

        public android.graphics.Point getSize()
        Returns:
        the size of the widget.
      • setSize

        protected void setSize​(android.graphics.Point size)
      • getDynamicImageUrl

        public java.lang.String getDynamicImageUrl()
        Returns:
        the cached path of the button dynamic image url.
      • setDynamicImageUrl

        protected void setDynamicImageUrl​(java.lang.String dynamicImageUrl)
      • getText

        public java.lang.String getText()
        Returns:
        the button text to render.
      • setText

        protected void setText​(java.lang.String text)
      • isMultiLine

        public boolean isMultiLine()
      • setMultiLine

        public void setMultiLine​(boolean multiLine)
      • getFontSize

        public float getFontSize()
      • isScrollable

        public boolean isScrollable()
      • getFontFile

        public java.lang.String getFontFile()
      • getFontDigest

        public java.lang.String getFontDigest()
      • getLineHeight

        public double getLineHeight()
      • getTopPadding

        public int getTopPadding()
      • getRightPadding

        public int getRightPadding()
      • getBottomPadding

        public int getBottomPadding()
      • getLeftPadding

        public int getLeftPadding()
      • getTypeface

        public android.graphics.Typeface getTypeface​(android.graphics.Typeface defaultTypeface)
      • getForegroundColor

        public int getForegroundColor​(int defaultForegroundColor)
      • getBackgroundColor

        public int getBackgroundColor​(int defaultBackgroundColor)