Class BalloonPopupStyleBuilder


public class BalloonPopupStyleBuilder extends PopupStyleBuilder
A builder class for BalloonPopupStyle.
  • Constructor Details

    • BalloonPopupStyleBuilder

      public BalloonPopupStyleBuilder()
      Constructs a BalloonPopupStyleBuilder object with all parameters set to defaults.
  • Method Details

    • getCornerRadius

      public int getCornerRadius()
      Returns the corner radius of the popup.
      Returns:
      The corner radius of the popup in dp.
    • setCornerRadius

      public void setCornerRadius(int cornerRadius)
      Sets the corner radius of the popup. Bigger values mean rounder corners, 0 creates
      a rectangular popup. The default is 3.
      Parameters:
      cornerRadius - The new corner radius in dp.
    • getLeftColor

      public Color getLeftColor()
      Returns the background color of the left part of the popup.
      Returns:
      The background color of the left part of the popup.
    • setLeftColor

      public void setLeftColor(Color leftColor)
      Sets the background color of the left part of the popup. The size of the colored area
      is determined by the left margins and the left image. The default is 0xFF00B483.
      Parameters:
      leftColor - The new color for the left part of the popup.
    • getLeftImage

      public Bitmap getLeftImage()
      Returns the image of the left part of the popup.
      Returns:
      The image of the left part of the popup.
    • setLeftImage

      public void setLeftImage(Bitmap leftImage)
      Sets the image for the left part of the popup. If null is passed no image will be drawn.
      The default is null.
      Parameters:
      leftImage - The new image for the left part of the popup.
    • getLeftMargins

      public BalloonPopupMargins getLeftMargins()
      Returns the margins of the left part of the popup.
      Returns:
      The margins of the left part of the popup.
    • setLeftMargins

      public void setLeftMargins(BalloonPopupMargins leftMargins)
      Sets the margins for the left part of the popup. The margins will determine how much
      empty space should surround the left image. The default is BalloonPopupMargins(5, 0, 5, 0).
      Parameters:
      leftMargins - The new margins for the left part of the popup in dp.
    • getRightColor

      public Color getRightColor()
      Returns the background color of the right part of the popup.
      Returns:
      The background color of the right part of the popup.
    • setRightColor

      public void setRightColor(Color rightColor)
      Sets the background color of the right part of the popup. The size of the colored area
      is determined by the right margins and the right image. The default is 0xFF00B483.
      Parameters:
      rightColor - The new color for the right part of the popup.
    • getRightImage

      public Bitmap getRightImage()
      Returns the image of the right part of the popup.
      Returns:
      The image of the right part of the popup.
    • setRightImage

      public void setRightImage(Bitmap rightImage)
      Sets the image for the right part of the popup. If null is passed no image will be drawn.
      The default is null.
      Parameters:
      rightImage - The new image for the right part of the popup.
    • getRightMargins

      public BalloonPopupMargins getRightMargins()
      Returns the margins of the right part of the popup.
      Returns:
      The margins of the right part of the popup.
    • setRightMargins

      public void setRightMargins(BalloonPopupMargins rightMargins)
      Sets the margins for the right part of the popup. The margins will determine how much
      empty space should surround the right image. The default is BalloonPopupMargins(5, 0, 5, 0).
      Parameters:
      rightMargins - The new margins for the right part of the popup in dp.
    • getTitleColor

      public Color getTitleColor()
      Returns the color of the title.
      Returns:
      The color of the title.
    • setTitleColor

      public void setTitleColor(Color titleColor)
      Sets the color of the title. The default is 0xFF000000.
      Parameters:
      titleColor - The new color for the title.
    • getTitleFontName

      public String getTitleFontName()
      Returns the name of the title font.
      Returns:
      The name of the title font.
    • setTitleFontName

      public void setTitleFontName(String titleFontName)
      Sets the name of the title font. Accepts a CSS-like list, the most preferred name
      first, entries optionally tagged with the platform they are for
      ("android:Roboto, ios:Helvetica Neue, sans-serif"). A name the device has no font for
      is skipped; generic names ("sans-serif", "serif", "monospace", "Arial", ...) map to the
      platform font. The default is HelveticaNeue-Light.
      Parameters:
      titleFontName - The new name for the title font.
    • getTitleField

      public String getTitleField()
      Returns the title field variable. If not empty, this variable is used to read actual text string from object meta info.
      Returns:
      The current title variable.
    • setTitleField

      public void setTitleField(String field)
      Sets the title field variable. If not empty, this variable is used to read actual text string from object meta info.
      Parameters:
      field - The text field to use for displaying title from metainfo.
    • getTitleFontSize

      public int getTitleFontSize()
      Returns the size of the title font.
      Returns:
      The size of the title font.
    • setTitleFontSize

      public void setTitleFontSize(int titleFontSize)
      Sets the size of the title font. The default is 16.
      Parameters:
      titleFontSize - The new size for the title font in pts.
    • getTitleMargins

      public BalloonPopupMargins getTitleMargins()
      Returns the margins of the title.
      Returns:
      The margins of the title.
    • setTitleMargins

      public void setTitleMargins(BalloonPopupMargins titleMargins)
      Sets the margins for the title. The margins will determine how much
      empty space should surround the title. The default is BalloonPopupMargins(8, 4, 8, 0).
      Parameters:
      titleMargins - The new margins for the title in dp.
    • isTitleWrap

      public boolean isTitleWrap()
      Returns the state of the title wrap parameter.
      Returns:
      True if long titles are wrapped, false if it is truncated.
    • setTitleWrap

      public void setTitleWrap(boolean titleWrap)
      Sets the state of the title wrap parameter. If set to true, long titles that are
      wider than the sreen width will be wrapped to multiple lines, increasing the height of the popup.
      If set to false, long titles are truncated with three dots.
      Parameters:
      titleWrap - The new state of the title wrap parameter.
    • getDescriptionColor

      public Color getDescriptionColor()
      Returns the color of the description.
      Returns:
      The color of the description.
    • setDescriptionColor

      public void setDescriptionColor(Color descColor)
      Sets the color of the description. The default is 0xFF000000.
      Parameters:
      descColor - The new color for the description.
    • getDescriptionFontName

      public String getDescriptionFontName()
      Returns the name of the description font.
      Returns:
      The name of the description font.
    • setDescriptionFontName

      public void setDescriptionFontName(String descFontName)
      Sets the name of the description font. Accepts a CSS-like list, the most preferred name
      first, entries optionally tagged with the platform they are for
      ("android:Roboto, ios:Helvetica Neue, sans-serif"). A name the device has no font for
      is skipped; generic names ("sans-serif", "serif", "monospace", "Arial", ...) map to the
      platform font. The default is HelveticaNeue-Light.
      Parameters:
      descFontName - The new name for the description font.
    • getDescriptionField

      public String getDescriptionField()
      Returns the description field variable. If not empty, this variable is used to read actual text string from object meta info.
      Returns:
      The current description variable.
    • setDescriptionField

      public void setDescriptionField(String field)
      Sets the description field variable. If not empty, this variable is used to read actual text string from object meta info.
      Parameters:
      field - The description field to use for displaying text from metainfo.
    • getDescriptionFontSize

      public int getDescriptionFontSize()
      Returns the size of the description font.
      Returns:
      The size of the description font.
    • setDescriptionFontSize

      public void setDescriptionFontSize(int descFontSize)
      Sets the size of the description font. The default is 14.
      Parameters:
      descFontSize - The new size for the description font in pts.
    • getDescriptionMargins

      public BalloonPopupMargins getDescriptionMargins()
      Returns the margins of the description.
      Returns:
      The margins of the description.
    • setDescriptionMargins

      public void setDescriptionMargins(BalloonPopupMargins descMargins)
      Sets the margins for the description. The margins will determine how much
      empty space should surround the description. The default is BalloonPopupMargins(8, 0, 8, 6).
      Parameters:
      descMargins - The new margins for the description in dp.
    • isDescriptionWrap

      public boolean isDescriptionWrap()
      Returns the state of the description wrap parameter.
      Returns:
      True if long descriptions are wrapped, false if it is truncated.
    • setDescriptionWrap

      public void setDescriptionWrap(boolean descWrap)
      Sets the state of the description wrap parameter. If set to true, long descriptions that are
      wider than the sreen width will be wrapped to multiple lines, increasing the height of the popup.
      If set to false, long descriptions are truncated with three dots.
      Parameters:
      descWrap - The new state of the description wrap parameter.
    • getButtonMargins

      public BalloonPopupMargins getButtonMargins()
      Returns the margins for popup buttons.
      Returns:
      The margins for popup buttons.
    • setButtonMargins

      public void setButtonMargins(BalloonPopupMargins buttonMargins)
      Sets the margins for popup buttons. The margins will determine how much
      empty space should surround the buttons. The default is BalloonPopupMargins(8, 0, 8, 8).
      Parameters:
      buttonMargins - The new popup margins for the buttons in dp.
    • getStrokeColor

      public Color getStrokeColor()
      Returns the color of the stroke surrounding the popup.
      Returns:
      The color of the stroke surrounding the popup.
    • setStrokeColor

      public void setStrokeColor(Color strokeColor)
      Sets the color of the stroke surrounding the popup. The default is 0xFF000000.
      Parameters:
      strokeColor - The new color of the stroke surrounding the popup.
    • getStrokeWidth

      public int getStrokeWidth()
      Returns the width of the stroke surrounding the popup.
      Returns:
      The width of the stroke surrounding the popup in dp.
    • setStrokeWidth

      public void setStrokeWidth(int strokeWidth)
      Sets the width of the stroke surrounding the popup. The default is 1.
      Parameters:
      strokeWidth - The new width of the stroke surrounding the popup.
    • getTriangleWidth

      public int getTriangleWidth()
      Returns the width of the triangle at the bottom of the popup.
      Returns:
      The width of the triangle at the bottom of the popup in dp.
    • setTriangleWidth

      public void setTriangleWidth(int triangleWidth)
      Sets the width of the triangle at the bottom of the popup. The default is 20.
      Parameters:
      triangleWidth - The new width of the triangle at the bottom of the popup.
    • getTriangleHeight

      public int getTriangleHeight()
      Returns the height of the triangle at the bottom of the popup.
      Returns:
      The height of the triangle at the bottom of the popup in dp.
    • setTriangleHeight

      public void setTriangleHeight(int triangleHeight)
      Sets the height of the triangle at the bottom of the popup. The default is 10.
      Parameters:
      triangleHeight - The new height of the triangle at the bottom of the popup.
    • buildStyle

      public BalloonPopupStyle buildStyle()
      Builds a new instance of the BalloonPopupStyle object using previously set parameters.
      Overrides:
      buildStyle in class PopupStyleBuilder
      Returns:
      A new BalloonPopupStyle object.