badge

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 1 Imported by: 37

Documentation

Overview

Package badge allows you to preserve, set or clear the number displayed on your App icon.

Example
package main

import (
	"fmt"

	"github.com/RobotsAndPencils/buford/payload/badge"
)

func main() {
	var b badge.Badge
	fmt.Println(b)

	fmt.Println(badge.Preserve)
	fmt.Println(badge.Clear)
	fmt.Println(badge.New(42))

}
Output:

preserve
preserve
set 0
set 42

Index

Examples

Constants

This section is empty.

Variables

View Source
var Clear = Badge{/* contains filtered or unexported fields */}

Clear the badge.

View Source
var Preserve = Badge{}

Preserve the current badge (default behavior).

Functions

This section is empty.

Types

type Badge

type Badge struct {
	// contains filtered or unexported fields
}

Badge number to display on the App icon.

func New

func New(number uint) Badge

New badge with a set value. A badge set to 0 is the same as badge.Clear.

func (*Badge) Number

func (b *Badge) Number() (uint, bool)

Number to display on the App Icon and if should be changed. If the badge should not be changed, the number has no effect.

func (Badge) String added in v0.8.0

func (b Badge) String() string

String prints out a badge

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL