Class Notification

java.lang.Object
com.avrix.ui.notify.Notification

public class Notification extends Object
The Notification class represents a notification that is displayed on the screen and has a limited lifetime. It contains text, an icon, and various visual properties.
  • Method Details

    • setFontName

      public void setFontName(String fontName)
      Sets the font name for the text.
      Parameters:
      fontName - The name of the font.
    • setIconFontName

      public void setIconFontName(String iconFontName)
      Sets the font name for the icon.
      Parameters:
      iconFontName - The name of the icon font.
    • setFontSize

      public void setFontSize(int fontSize)
      Sets the font size for the text.
      Parameters:
      fontSize - The size of the font.
    • setIconFontSize

      public void setIconFontSize(int iconFontSize)
      Sets the font size for the icon.
      Parameters:
      iconFontSize - The size of the icon font.
    • setMargin

      public void setMargin(int margin)
      Sets the margin inside the notification.
      Parameters:
      margin - The margin in pixels.
    • setWidth

      public void setWidth(int width)
      Sets the width of the notification.
      Parameters:
      width - The width in pixels.
    • setHeight

      public void setHeight(int height)
      Sets the height of the notification.
      Parameters:
      height - The height in pixels.
    • setLifeTime

      public void setLifeTime(int lifeTime)
      Sets the lifetime of the notification.
      Parameters:
      lifeTime - The lifetime in seconds.
    • setBackgroundColor

      public void setBackgroundColor(NanoColor backgroundColor)
      Sets the background color of the notification.
      Parameters:
      backgroundColor - The background color.
    • setTimeColor

      public void setTimeColor(NanoColor timeColor)
      Sets the color of the time bar.
      Parameters:
      timeColor - The color of the time bar.
    • setTextColor

      public void setTextColor(NanoColor textColor)
      Sets the color of the text.
      Parameters:
      textColor - The color of the text.
    • setIconColor

      public void setIconColor(NanoColor iconColor)
      Sets the color of the icon.
      Parameters:
      iconColor - The color of the icon.
    • getHeight

      public int getHeight()
      Returns the height of the notification.
      Returns:
      The height in pixels.
    • getWidth

      public int getWidth()
      Returns the width of the notification.
      Returns:
      The width in pixels.
    • isExpired

      public boolean isExpired()
      Checks if the notification has expired.
      Returns:
      true if the notification is expired, false otherwise.
    • show

      public void show()
      Displays the notification. Initializes the creation and expiration times, as well as calculates the size of the notification.
    • render

      public void render(int x, int y)
      Renders the notification at the specified position on the screen.
      Parameters:
      x - The x-coordinate of the top-left corner of the notification.
      y - The y-coordinate of the top-left corner of the notification.