Base Info

BaseInfo is the fundamental component used to define the primary text and layout of a notification. It corresponds to the system’s “Template 1” (Standard) and “Template 2” (Banner) layouts.

It is versatile and supports multiple text fields, a primary icon, and extensive color customization.

Usage

builder.setBaseInfo(
    type = 1, // Layout style
    title = "Main Title",
    content = "Primary description text",
    subTitle = "Secondary Title",
    pictureKey = "icon_key",
    
    // Custom Colors
    colorTitle = "#FF0000",
    colorContent = "#666666"
)

Layout Types (type)

TypeDescription
1Standard Layout. The pictureKey (icon) appears on the left. Text is stacked vertically.
2Banner Layout. The pictureKey appears on the right (often larger). Useful for “Bill Payment” or “Status” notifications.

Content Parameters

These variables control the text and iconography displayed in the card.

ParameterTypeDescription
titleStringRequired. The main headline (e.g., “Heavy Snow”, “Payment Successful”).
contentStringRequired. The primary body text (e.g., “Chaoyang District”, “September Phone Bill”).
subTitleString?Secondary title text, usually appears next to or below the main title.
extraTitleString?Supplementary text, often used for timestamps or small metadata (e.g., “Now”).
specialTitleString?A small label or tag (e.g., “Sale”, “Alert”).
subContentString?Secondary body text (e.g., “Wait 20m”).
pictureKeyString?Key of the HyperPicture to display.
Type 1: Left Icon.
Type 2: Right Banner Icon.

Configuration Flags

ParameterTypeDescription
showDividerBoolean?If true, shows a graphical divider between the title area and content area.
showContentDividerBoolean?If true, shows a divider between the content and subContent lines.

Color Customization

You can customize the text color for almost every field. Each field has a standard version (Light Mode) and a Dark version (Dark Mode).

Note: Colors should be hex strings (e.g., #FF0000 or #FF8514).

Text FieldLight Mode ParameterDark Mode Parameter
TitlecolorTitlecolorTitleDark
Sub TitlecolorSubTitlecolorSubTitleDark
Extra TitlecolorExtraTitlecolorExtraTitleDark
Special LabelcolorSpecialTitlecolorSpecialTitleDark
Special BGcolorSpecialBg(Uses same)
ContentcolorContentcolorContentDark
Sub ContentcolorSubContentcolorSubContentDark

Actions

The setBaseInfo builder method accepts an optional actionKeys list.

actionKeys = listOf("reply_action", "mark_read")