Package com.swrve.sdk.messaging
Class SwrveButton
- java.lang.Object
-
- com.swrve.sdk.messaging.SwrveButton
-
public class SwrveButton extends java.lang.Object
In-app message button.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
backgroundColor
protected int
bottomPadding
protected java.lang.String
dynamicImageUrl
protected java.lang.String
fontDigest
protected java.lang.String
fontFile
protected SwrveTextViewStyle.FONT_NATIVE_STYLE
fontNativeStyle
protected float
fontSize
protected java.lang.String
foregroundColor
protected SwrveTextViewStyle.TextAlignment
horizontalAlignment
protected boolean
isMultiLine
protected boolean
isScrollable
protected int
leftPadding
protected double
lineHeight
protected android.graphics.Point
position
protected int
rightPadding
protected android.graphics.Point
size
protected java.lang.String
text
protected int
topPadding
-
Constructor Summary
Constructors Constructor Description SwrveButton(SwrveMessage message, org.json.JSONObject buttonData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessibilityText()
java.lang.String
getAction()
SwrveActionType
getActionType()
int
getAppId()
int
getBackgroundColor(int defaultBackgroundColor)
int
getBottomPadding()
long
getButtonId()
protected static android.graphics.Point
getCenterFrom(org.json.JSONObject data)
java.lang.String
getDynamicImageUrl()
java.lang.String
getFontDigest()
java.lang.String
getFontFile()
SwrveTextViewStyle.FONT_NATIVE_STYLE
getFontNativeStyle()
float
getFontSize()
int
getForegroundColor(int defaultForegroundColor)
SwrveTextViewStyle.TextAlignment
getHorizontalAlignment()
java.lang.String
getImage()
int
getLeftPadding()
double
getLineHeight()
SwrveMessage
getMessage()
java.lang.String
getName()
android.graphics.Point
getPosition()
int
getRightPadding()
android.graphics.Point
getSize()
protected static android.graphics.Point
getSizeFrom(org.json.JSONObject data)
java.lang.String
getText()
int
getTopPadding()
android.graphics.Typeface
getTypeface(android.graphics.Typeface defaultTypeface)
boolean
isMultiLine()
boolean
isScrollable()
protected void
setDynamicImageUrl(java.lang.String dynamicImageUrl)
void
setMultiLine(boolean multiLine)
protected void
setPosition(android.graphics.Point position)
protected void
setSize(android.graphics.Point size)
protected void
setText(java.lang.String text)
-
-
-
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
-
horizontalAlignment
protected SwrveTextViewStyle.TextAlignment horizontalAlignment
-
fontFile
protected java.lang.String fontFile
-
fontDigest
protected java.lang.String fontDigest
-
fontNativeStyle
protected SwrveTextViewStyle.FONT_NATIVE_STYLE fontNativeStyle
-
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()
-
getMessage
public SwrveMessage getMessage()
-
getAppId
public int getAppId()
-
getActionType
public SwrveActionType getActionType()
-
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()
-
getHorizontalAlignment
public SwrveTextViewStyle.TextAlignment getHorizontalAlignment()
-
getFontFile
public java.lang.String getFontFile()
-
getFontDigest
public java.lang.String getFontDigest()
-
getFontNativeStyle
public SwrveTextViewStyle.FONT_NATIVE_STYLE getFontNativeStyle()
-
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)
-
-