Package com.jbstrap.ui
Class LiveFavicon
java.lang.Object
com.jbstrap.ui.LiveFavicon
Live Favicon
With this class, we can give additional information to the user. This information is put inside a bubble, that appears on the application's icon (favicon) For example, this could be used to inform the user if there's a new message, or inform them about the amount of unread messages, etc.
- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
ConstructorsConstructorDescriptionLiveFavicon(String iconText) Creates a favicon bubble with the specified text contentLiveFavicon(String iconText, String backgroundColor) Creates a bubble on the icon, with the specified text and background colorLiveFavicon(String iconText, String textColor, Integer width, Integer height, String backgroundColor) Creates a bubble on the icon, with the specified parameters -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw()final StringGets the bubble background colorfinal intGets the bubble heightfinal StringGets the bubble text.final StringGets the bubble text colorfinal intgetWidth()Gets the bubble widthfinal voidredraw()Redraws the bubblefinal voidsetBackgroundColor(String backgroundColor) Sets the bubble background colorfinal voidsetCurrentUi(UI ui) final voidSets the bubble heightfinal voidsetIconText(String iconText) Sets the bubble textfinal voidsetTextColor(String color) Sets the bubble text colorfinal voidSets the bubble width
-
Constructor Details
-
LiveFavicon
Creates a favicon bubble with the specified text content- Parameters:
iconText- The text that will be in the bubble
-
LiveFavicon
Creates a bubble on the icon, with the specified text and background color- Parameters:
iconText- The text that will be in the bubblebackgroundColor- The background color of the bubble. Can be specified using the #RRGGBB format. If specified asnullthe default color will be red (#ff0000).
-
LiveFavicon
public LiveFavicon(String iconText, String textColor, Integer width, Integer height, String backgroundColor) Creates a bubble on the icon, with the specified parameters- Parameters:
iconText- The text that will be in the bubbletextColor- The text color. If specified asnull, the color will be #fff.width- The width in pixels. If specified asnullit will be 7px.height- The height in pixels. If specified asnullit will be 9px.backgroundColor- The background color of the bubble. Can be specified using the #RRGGBB format. If specified asnullthe default color will be red (#ff0000).
-
-
Method Details
-
getIconText
Gets the bubble text.- Returns:
- The bubble text
-
setIconText
Sets the bubble text- Parameters:
iconText- The text that will be in the bubble
-
getTextColor
Gets the bubble text color- Returns:
- The bubble text color
-
setTextColor
Sets the bubble text color- Parameters:
color- The text color. If specified asnull, the color will be #fff.
-
getWidth
public final int getWidth()Gets the bubble width- Returns:
- The bubble width in pixels
-
setWidth
Sets the bubble width- Parameters:
width- The width in pixels. If specified asnullit will be 7px.
-
getHeight
public final int getHeight()Gets the bubble height- Returns:
- The bubble height in pixels
-
setHeight
Sets the bubble height- Parameters:
height- The height in pixels. If specified asnullit will be 9px.
-
getBackgroundColor
Gets the bubble background color- Returns:
- The bubble background color
-
setBackgroundColor
Sets the bubble background color- Parameters:
backgroundColor- The background color of the bubble. Can be specified using the #RRGGBB format. If specified asnullthe default color will be red (#ff0000).
-
setCurrentUi
- Parameters:
ui- The UI instance where the bubble will appear
-
redraw
public final void redraw()Redraws the bubble -
draw
public void draw()
-