android

– import “gomatcha.io/matcha/view/android”

type PagerButton

type PagerButton struct {
	Title string
}

func (*PagerButton) OptionKey

func (t *PagerButton) OptionKey() string

type PagerView

type PagerView struct {
	view.Embed
	Pages *Pages
}

func NewPagerView

func NewPagerView() *PagerView

NewPagerView returns a new view. ViewPager and PagerTabStrip.

func (*PagerView) Build

func (v *PagerView) Build(ctx view.Context) view.Model

Build implements the view.View interface.

func (*PagerView) Lifecycle

func (v *PagerView) Lifecycle(from, to view.Stage)

Lifecyle implements the view.View interface.

func (*PagerView) Update

func (v *PagerView) Update(v2 view.View)

type Pages

type Pages struct {
}

Pages represents a list of views to be shown in the PagerView. It can be manipulated outside of a Build() call.

func (*Pages) Notify

func (s *Pages) Notify(f func()) comm.Id

Notify implements the comm.Notifier interface.

func (*Pages) SelectedIndex

func (s *Pages) SelectedIndex() int

SelectedIndex returns the index of the selected tab.

func (*Pages) SelectedView

func (s *Pages) SelectedView() view.View

func (*Pages) SetSelectedIndex

func (s *Pages) SetSelectedIndex(idx int)

SetSelectedIndex selects the tab at idx.

func (*Pages) SetViews

func (s *Pages) SetViews(ss ...view.View)

SetViews sets the child views displayed in the tabview.

func (*Pages) Unnotify

func (s *Pages) Unnotify(id comm.Id)

Unnotify implements the comm.Notifier interface.

func (*Pages) Views

func (s *Pages) Views() []view.View

Views returns the child views displayed in the tabview.

type Stack

type Stack struct {
}

Stack represents a list of views to be shown in the StackView. It can be manipulated outside of a Build() call.

func (*Stack) Notify

func (s *Stack) Notify(f func()) comm.Id

func (*Stack) Pop

func (s *Stack) Pop()

func (*Stack) Push

func (s *Stack) Push(vs view.View)

func (*Stack) SetViews

func (s *Stack) SetViews(vs ...view.View)

func (*Stack) Unnotify

func (s *Stack) Unnotify(id comm.Id)

func (*Stack) Views

func (s *Stack) Views() []view.View

type StackBar

type StackBar struct {
	Title          string
	StyledTitle    *text.StyledText
	Subtitle       string
	StyledSubtitle *text.StyledText
	Color          color.Color
	Items          []*StackBarItem
}

func (*StackBar) OptionKey

func (t *StackBar) OptionKey() string

type StackBarItem

type StackBarItem struct {
	Title       string
	StyledTitle *text.StyledText
	Icon        image.Image
	IconTint    color.Color
	Enabled     bool
	OnPress     func()
}

func NewStackBarItem

func NewStackBarItem() *StackBarItem

type StackView

type StackView struct {
	view.Embed
	Stack *Stack

	BarColor      color.Color
	TitleStyle    *text.Style
	SubtitleStyle *text.Style
}

func NewStackView

func NewStackView() *StackView

NewStackView returns a new view.

func (*StackView) Build

func (v *StackView) Build(ctx view.Context) view.Model

Build implements the view.View interface.

func (*StackView) Lifecycle

func (v *StackView) Lifecycle(from, to view.Stage)

Lifecyle implements the view.View interface.

func (*StackView) Update

func (v *StackView) Update(v2 view.View)

Update implements the view.View interface.

type StatusBar

type StatusBar struct {
	Style StatusBarStyle
	Color color.Color
}

If multiple views have a statusBar, the most recently mounted one will be used.

return view.Model{
    Options: []view.Option{
        &android.StatusBar{ Color: colornames.Red },
    },
}

func (*StatusBar) OptionKey

func (s *StatusBar) OptionKey() string

type StatusBarStyle

type StatusBarStyle int
const (
	// Statusbar with light icons
	StatusBarStyleLight StatusBarStyle = iota
	// Statusbar with dark icons
	StatusBarStyleDark
)