- Programmatically in code (not recommended in most cases).
- Updating and importing the whisper.yaml into your project (recommended).
- See YAML Setup / Configuration in the main README for YAML documentation and importing whisper.yaml.
- A collection of whisper.yaml template samples can be found in /yaml-samples/.
- pixelDensityUnit
- positionOnScreen
- sortOrder
- maxVisible
- displaySpace
- timeoutLengthPerCharacter
- durationDisplayMinimum
- durationDisplayMaximum
- animationTransitionDuration
- timeoutOnlyForOldestWhisper
- tapToDismiss
- Offset
- Profile
The starting point for each example is using the default settings found in root whisper.yaml
Demo of Change | whisper.yaml or Code Change |
---|---|
The pixel density to use for all Whisper UI configuration fields (other than font size).
pixelDensityUnit: DP or Whisper.GlobalConfig.pixelDensityUnit =
Whisper.Enums.PixelDensity.DP |
|
Location on screen where to display Whispers. Multiple Whispers visible at once will be positioned relative to this location in the order defined by sortOrder. Further adjustments can be made with Offset.x, Offset.y, and Offset.additionalOffsetForStatusBar.
positionOnScreen: TOP_LEFT or Whisper.GlobalConfig.positionOnScreen =
Whisper.Enums.PositionOnScreen.TOP_LEFT |
|
positionOnScreen: TOP_CENTER or Whisper.GlobalConfig.positionOnScreen =
Whisper.Enums.PositionOnScreen.TOP_CENTER |
|
positionOnScreen: TOP_RIGHT or Whisper.GlobalConfig.positionOnScreen =
Whisper.Enums.PositionOnScreen.TOP_CENTOP_RIGHTTER |
|
positionOnScreen: TOP_START or Whisper.GlobalConfig.positionOnScreen =
Whisper.Enums.PositionOnScreen.TOP_START |
|
positionOnScreen: TOP_END or Whisper.GlobalConfig.positionOnScreen =
Whisper.Enums.PositionOnScreen.TOP_END |
|
positionOnScreen: TOP_FULL or Whisper.GlobalConfig.positionOnScreen =
Whisper.Enums.PositionOnScreen.TOP_FULL |
|
Relative position to display newer Whispers when more than one are visible on screen at once. See positionOnScreen for Whisper placement.
sortOrder: BELOW or Whisper.GlobalConfig.sortOrder =
Whisper.Enums.SortOrder.BELOW |
|
sortOrder: ABOVE or Whisper.GlobalConfig.sortOrder =
Whisper.Enums.SortOrder.ABOVE |
|
Maximum number of Whispers visible on screen at once. If more Whispers exist than the defined value, excess Whispers will be invisible until the space is available.
maxVisible: 2 or Whisper.GlobalConfig.maxVisible = 2 |
|
Space between each Whisper if multiple are displaying at once.
displaySpace: 50 or Whisper.GlobalConfig.displaySpace = 50 |
|
In milliseconds, the added auto-timeout length per character in the Whisper message. Value here in combination of text length determines the dynamic auto-timeout of each Whisper. Range will always be within durationDisplayMinimum and durationDisplayMaximum values. Auto-timeout will not be used for individual Whispers with an optional timeout value passed in.
timeoutLengthPerCharacter: 25 or Whisper.GlobalConfig.timeoutLengthPerCharacter = 25 |
|
timeoutLengthPerCharacter: 125 or Whisper.GlobalConfig.timeoutLengthPerCharacter = 125 |
|
In milliseconds, the minimum duration a Whisper will be visible for before timing out. Applies if timeoutLengthPerCharacter value computes too short of a duration for auto-timeouts. Applies to individual Whispers with an optional timeout value passed in.
durationDisplayMinimum: 1000 or Whisper.GlobalConfig.durationDisplayMinimum = 1000 |
|
durationDisplayMinimum: 3000 or Whisper.GlobalConfig.durationDisplayMinimum = 3000 |
|
In milliseconds, the maximum duration a Whisper will be visible for before timing out. Applies if timeoutLengthPerCharacter value computes too long of a duration for auto-timeouts. Does not apply to individual Whispers with an optional timeout value passed in.
durationDisplayMaximum: 2500 or Whisper.GlobalConfig.durationDisplayMaximum = 2500 |
|
In milliseconds, the value of all animation transitions. This includes fading in, fading out, and rearranging.
animationTransitionDuration: 1500 or Whisper.GlobalConfig.animationTransitionDuration = 1500 |
|
When a timeout applies to a Whisper, timer is only activated to the oldest visible Whisper. Once the oldest Whisper is dismissed, the next visible Whisper's timer (set for an auto-close timeout) will begin. False will start a timer for each visible Whisper immediately (except for Whispers set to never timeout).
timeoutOnlyForOldestWhisper: true or Whisper.GlobalConfig.timeoutOnlyForOldestWhisper = true |
|
timeoutOnlyForOldestWhisper: false or Whisper.GlobalConfig.timeoutOnlyForOldestWhisper = false |
|
Ability to dismiss a Whisper immediately by tapping it.
tapToDismiss: true or Whisper.GlobalConfig.tapToDismiss = true |
|
tapToDismiss: false or Whisper.GlobalConfig.tapToDismiss = false |
|
Adds an X offset to positionOnScreen.
Offset:
x: 60 or Whisper.GlobalConfig.offset.x = 60 |
|
Adds a Y offset to positionOnScreen.
Offset:
y: 60 or Whisper.GlobalConfig.offset.y = 60 |
|
If the device's status bar is visible, applying a small Offset.y may appear to have no effect on the offset (if the positionOnScreen is intended to be below the status bar). By setting true, the device's status bar height is calculated and added to the Offset.y so it is properly accounted for.
Offset:
y: 10
additionalOffsetForStatusBar: false or Whisper.GlobalConfig.offset.y = 10
Whisper.GlobalConfig.offset.additionalOffsetForStatusBar = false |
|
When and what sound should play (if ever). If setting Profile:
Sound:
trigger: DEVICE_EVERY_WHISPER or Whisper.GlobalConfig.profile.sound.trigger = Whisper.Enums.TriggerSound.DEVICE_EVERY_WHISPER |
|
Profile:
Sound:
trigger: DEVICE_SOLE_WHISPER or Whisper.GlobalConfig.profile.sound.trigger = Whisper.Enums.TriggerSound.DEVICE_SOLE_WHISPER |
|
Only used if Sound.trigger is Profile:
Sound:
trigger: CUSTOM_EVERY_WHISPER
customSound: "horn" or Whisper.GlobalConfig.profile.sound.trigger = Whisper.Enums.TriggerSound.CUSTOM_EVERY_WHISPER
Whisper.GlobalConfig.profile.sound.customSound = "horn" |
|
Profile:
Sound:
trigger: CUSTOM_SOLE_WHISPER
customSound: "horn" or Whisper.GlobalConfig.profile.sound.trigger = Whisper.Enums.TriggerSound.CUSTOM_SOLE_WHISPER
Whisper.GlobalConfig.profile.sound.customSound = "horn" |
|
When to vibrate (if ever). If setting anything other than NEVER, see Vibrate.vibrationPattern to define a custom vibration pattern.
In milliseconds, vibration sequence of off/on/off/on... pattern if VibrateTemplate.trigger is not NEVER.
Profile:
Vibrate:
trigger: EVERY_WHISPER
vibrationPattern:
- 0 # delay before vibrating in milliseconds
- 100 # vibrate duration in milliseconds
- 50 # delay before vibrating in milliseconds
- 100 # vibrate duration in milliseconds
# - Continue pattern if desired. or Whisper.GlobalConfig.profile.vibrate.trigger = Whisper.Enums.TriggerVibrate.EVERY_WHISPER
Whisper.GlobalConfig.profile.sound.customSound = longArrayOf(0, 100, 50, 100) |
|
Profile:
Vibrate:
trigger: SOLE_WHISPER
vibrationPattern:
- 0 # delay before vibrating in milliseconds
- 100 # vibrate duration in milliseconds
- 50 # delay before vibrating in milliseconds
- 100 # vibrate duration in milliseconds
# - Continue pattern if desired. or Whisper.GlobalConfig.profile.vibrate.trigger = Whisper.Enums.TriggerVibrate.EVERY_WHISPER
Whisper.GlobalConfig.profile.sound.customSound = longArrayOf(0, 100, 50, 100) |
|
Padding between Whisper edges (left, top, right, bottom) and text. This will make the overall Whisper size larger.
Profile:
Design:
Padding:
left: 0
top: 0
right: 0
bottom: 0 or Whisper.GlobalConfig.profile.design.left = 0
Whisper.GlobalConfig.profile.design.top = 0
Whisper.GlobalConfig.profile.design.right = 0
Whisper.GlobalConfig.profile.design.bottom = 0 |
|
Profile:
Design:
Padding:
left: 15
top: 15
right: 15
bottom: 15 or Whisper.GlobalConfig.profile.design.padding.left = 15
Whisper.GlobalConfig.profile.design.padding.top = 15
Whisper.GlobalConfig.profile.design.padding.right = 15
Whisper.GlobalConfig.profile.design.padding.bottom = 15 |
|
Whisper text color.
Profile:
Design:
Text:
color: "FF0000" or Whisper.GlobalConfig.profile.design.text.color = "FF0000" |
|
Whisper text size.
Profile:
Design:
Text:
size: 30.0 or Whisper.GlobalConfig.profile.design.text.size = 30.0 |
|
Sets the horizontal alignment of a Whisper's text.
Profile:
Design:
Text:
gravity: LEFT or Whisper.GlobalConfig.profile.design.text.gravity = Whisper.Enums.TextGravity.LEFT |
|
Profile:
Design:
Text:
gravity: RIGHT or Whisper.GlobalConfig.profile.design.text.gravity = Whisper.Enums.TextGravity.RIGHT |
|
Profile:
Design:
Text:
gravity: CENTER or Whisper.GlobalConfig.profile.design.text.gravity = Whisper.Enums.TextGravity.CENTER |
|
Profile:
Design:
Text:
gravity: START or Whisper.GlobalConfig.profile.design.text.gravity = Whisper.Enums.TextGravity.START |
|
Profile:
Design:
Text:
gravity: END or Whisper.GlobalConfig.profile.design.text.gravity = Whisper.Enums.TextGravity.END |
|
If text should be bolded.
Profile:
Design:
Text:
Font:
bold: true or Whisper.GlobalConfig.profile.design.text.font.bold = true |
|
If text should be italicized.
Profile:
Design:
Text:
Font:
italic: true or Whisper.GlobalConfig.profile.design.text.font.italic = true |
|
If text should be underlined.
Profile:
Design:
Text:
Font:
underline: true or Whisper.GlobalConfig.profile.design.text.font.underline = true |
|
.ttf or .otf fonts found in module's Profile:
Design:
Text:
Font:
fontFamily: "Miracode.ttf" or Whisper.GlobalConfig.profile.design.text.font.fontFamily = "Miracode.ttf" |
|
If background is a solid color or a type of gradient. If If Background type is Sets the angle of the gradient. Only used if Background.type is not The X position of the center of the gradient. Only used if Background.type is The Y position of the center of the gradient. Only used if Background.type is Sets the radius of the gradient. Only used if Background.type is Profile:
Design:
Background:
type: SOLID
colors:
- "99545454" or Whisper.GlobalConfig.profile.design.background.type = Whisper.Enums.BackgroundType.SOLID
Whisper.GlobalConfig.profile.design.background.colors = listOf("99545454") |
|
Profile:
Design:
Background:
type: GRADIENT_LINEAR
colors:
- "99545454"
- "FFFF3333"
gradientOrientation: LEFT_RIGHT or Whisper.GlobalConfig.profile.design.background.type = Whisper.Enums.BackgroundType.GRADIENT_LINEAR
Whisper.GlobalConfig.profile.design.background.colors = listOf("99545454", "FFFF3333")
Whisper.GlobalConfig.profile.design.background.gradientOrientation = Whisper.Enums.GradientOrientation.LEFT_RIGHT |
|
Profile:
Design:
Background:
type: GRADIENT_RADIAL
colors:
- "FF00FF44"
- "FFFF3333"
gradientOrientation: TOPRIGHT_BOTTOMLEFT
gradientCenterX: 0.7
gradientCenterY: 0.7 or Whisper.GlobalConfig.profile.design.background.type = Whisper.Enums.BackgroundType.GRADIENT_RADIAL
Whisper.GlobalConfig.profile.design.background.colors = listOf("FF00FF44", "FFFF3333")
Whisper.GlobalConfig.profile.design.background.gradientOrientation = Whisper.Enums.GradientOrientation.TOPRIGHT_BOTTOMLEFT
Whisper.GlobalConfig.profile.design.background.gradientCenterX = 0.70f
Whisper.GlobalConfig.profile.design.background.gradientCenterY = 0.70f |
|
Profile:
Design:
Background:
type: GRADIENT_SWEEP
colors:
- "FF00FF44"
- "FFFF3333"
gradientOrientation: TOP_BOTTOM
gradientCenterX: 0.7
gradientCenterY: 0.7
gradientRadius: 90 or Whisper.GlobalConfig.profile.design.background.type = Whisper.Enums.BackgroundType.GRADIENT_RADIAL
Whisper.GlobalConfig.profile.design.background.colors = listOf("FF00FF44", "FFFF3333")
Whisper.GlobalConfig.profile.design.background.gradientOrientation = Whisper.Enums.GradientOrientation.TOPRIGHT_BOTTOMLEFT
Whisper.GlobalConfig.profile.design.background.gradientCenterX = 0.70f
Whisper.GlobalConfig.profile.design.background.gradientCenterY = 0.70f |
|
Whisper corner radius (corner roundness for topLeft, topRight, bottomRight, bottomLeft).
Profile:
Design:
Border:
CornerRadius:
topLeft: 0
topRight: 0
bottomRight: 0
bottomLeft: 0 or Whisper.GlobalConfig.profile.design.border.cornerRadius.topLeft = 0f
Whisper.GlobalConfig.profile.design.border.cornerRadius.topRight = 0f
Whisper.GlobalConfig.profile.design.border.cornerRadius.bottomRight = 0f
Whisper.GlobalConfig.profile.design.border.cornerRadius.bottomLeft = 0f |
|
Whisper corner radius (corner roundness for topLeft, topRight, bottomRight, bottomLeft).
Profile:
Design:
Border:
CornerRadius:
topLeft: 30
topRight: 30
bottomRight: 30
bottomLeft: 30 or Whisper.GlobalConfig.profile.design.border.cornerRadius.topLeft = 30f
Whisper.GlobalConfig.profile.design.border.cornerRadius.topRight = 30f
Whisper.GlobalConfig.profile.design.border.cornerRadius.bottomRight = 30f
Whisper.GlobalConfig.profile.design.border.cornerRadius.bottomLeft = 30f |
|
Border width (size).
Profile:
Design:
Border:
size: 0 or Whisper.GlobalConfig.profile.design.border.size.topLeft = 0 |
|
Profile:
Design:
Border:
size: 12 or Whisper.GlobalConfig.profile.design.border.size = 12 |
|
Border color.
Profile:
Design:
Border:
color: "0000FF" or Whisper.GlobalConfig.profile.design.border.color = "0000FF" |
|
Display a shadow for each Whisper. If true, enables all fields in Shadow (otherwise they are all ignored).
Profile:
Design:
Shadow:
castShadow: true or Whisper.GlobalConfig.profile.design.shadow.castShadow = true |
|
Profile:
Design:
Shadow:
castShadow: false or Whisper.GlobalConfig.profile.design.shadow.castShadow = false |
|
Shadow color. castShadow must be true for this field to apply.
Profile:
Design:
Shadow:
color: "88FF0000" or Whisper.GlobalConfig.profile.design.shadow.color = "88FF0000" |
|
Shadow corner radius (corner roundness for topLeft, topRight, bottomRight, bottomLeft). castShadow must be true for this field to apply.
Profile:
Design:
Shadow:
CornerRadius:
topLeft: 0
topRight: 0
bottomRight: 0
bottomLeft: 0 or Whisper.GlobalConfig.profile.design.shadow.CornerRadius.topLeft = 0f
Whisper.GlobalConfig.profile.design.shadow.CornerRadius.topRight = 0f
Whisper.GlobalConfig.profile.design.shadow.CornerRadius.bottomRight = 0f
Whisper.GlobalConfig.profile.design.shadow.CornerRadius.bottomLeft = 0f |
|
Shadow corner radius (corner roundness for topLeft, topRight, bottomRight, bottomLeft). castShadow must be true for this field to apply.
Profile:
Design:
Shadow:
CornerRadius:
topLeft: 30
topRight: 30
bottomRight: 30
bottomLeft: 30 or Whisper.GlobalConfig.profile.design.shadow.CornerRadius.topLeft = 30f
Whisper.GlobalConfig.profile.design.shadow.CornerRadius.topRight = 30f
Whisper.GlobalConfig.profile.design.shadow.CornerRadius.bottomRight = 30f
Whisper.GlobalConfig.profile.design.shadow.CornerRadius.bottomLeft = 30f |
|
Shadow insets (left, top, right, bottom). Shadow effect is achieved when Inset is used in combination with Shadow.padding. castShadow must be true for this field to apply.
Profile:
Design:
Shadow:
Inset:
left: 0
top: 0
right: 0
bottom: 0
Padding:
left: 0
top: 0
right: 8
bottom: 8 or Whisper.GlobalConfig.profile.design.shadow.Inset.left = 30f
Whisper.GlobalConfig.profile.design.shadow.Inset.top = 30f
Whisper.GlobalConfig.profile.design.shadow.Inset.right = 30f
Whisper.GlobalConfig.profile.design.shadow.Inset.bottom = 30f |
|
Shadow padding (left, top, right, bottom). Shadow effect is achieved when inset is used in combination with Shadow.padding. castShadow must be true for this field to apply.
Profile:
Design:
Shadow:
Inset:
left: 0
top: 0
right: 24
bottom: 24
Padding:
left: 30
top: 30
right: 30
bottom: 30 or Whisper.GlobalConfig.profile.design.shadow.Padding.left = 30f
Whisper.GlobalConfig.profile.design.shadow.Padding.top = 30f
Whisper.GlobalConfig.profile.design.shadow.Padding.right = 30f
Whisper.GlobalConfig.profile.design.shadow.Padding.bottom = 30f |