ios

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package ios implements a native ios views.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityIndicator

type ActivityIndicator struct {
}

If any view has an ActivityIndicator option, the spinner will be visible.

return view.Model{
    Options: []view.Option{app.ActivityIndicator{}}
}

func (*ActivityIndicator) OptionKey

func (a *ActivityIndicator) OptionKey() string

type ProgressView

type ProgressView struct {
	view.Embed
	Progress         float64
	ProgressNotifier comm.Float64Notifier
	ProgressColor    color.Color
	PaintStyle       *paint.Style
	// contains filtered or unexported fields
}

ProgressView implements a progess view.

func NewProgressView

func NewProgressView() *ProgressView

NewProgressView returns a new view.

func (*ProgressView) Build

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

Build implements the view.View interface.

func (*ProgressView) Lifecycle

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

Lifecycle implements the view.View interface.

type SegmentView

type SegmentView struct {
	view.Embed
	Enabled    bool
	Momentary  bool
	Titles     []string
	Value      int
	OnChange   func(value int)
	PaintStyle *paint.Style
}

func NewSegmentView

func NewSegmentView() *SegmentView

NewSegmentView returns a new view.

func (*SegmentView) Build

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

Build implements view.View.

type Stack

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

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
	BackButtonTitle  string
	BackButtonHidden bool

	TitleView  view.View
	RightViews []view.View
	LeftViews  []view.View
}

func (*StackBar) OptionKey

func (t *StackBar) OptionKey() string

type StackView

type StackView struct {
	view.Embed
	Stack *Stack

	TitleTextStyle *text.Style
	BackTextStyle  *text.Style
	BarColor       color.Color
	// contains filtered or unexported fields
}

Building a simple StackView:

type AppView struct {
	view.Embed
	stack *ios.Stack
}
func NewAppView() *AppView {
	child := view.NewBasicView()
	child.Painter = &paint.Style{BackgroundColor: colornames.Red}
	appview := &AppView{
		stack: &ios.Stack{},
	}
	appview.stack.SetViews(child)
	return appview
}
func (v *AppView) Build(ctx view.Context) view.Model {
	child := ios.New()
	child.Stack = v.stack
	return view.Model{
		Children: []view.View{child},
	}
}

Modifying the stack:

child := view.NewBasicView()
child.Painter = &paint.Style{BackgroundColor: colornames.Green}
v.Stack.Push(child)

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.

type StatusBar

type StatusBar struct {
	Hidden bool
	Style  StatusBarStyle
}

If multiple views have a statusBar, the most recently mounted one will be used. UIViewControllerBasedStatusBarAppearance must be set to False in the app's Info.plist to use this component.

return view.Model{
    Options: []view.Option{
        &ios.StatusBar{ Style: ios.StatusBarStyleLight },
    },
}

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
)

type TabButton

type TabButton struct {
	Title        string
	Icon         image.Image
	SelectedIcon image.Image
	Badge        string
}

TabButton describes a UITabBarItem.

func (*TabButton) OptionKey

func (t *TabButton) OptionKey() string

type TabView

type TabView struct {
	view.Embed
	Tabs                *Tabs
	BarColor            color.Color
	SelectedTextStyle   *text.Style
	UnselectedTextStyle *text.Style
	SelectedColor       color.Color
	UnselectedColor     color.Color
	// contains filtered or unexported fields
}

func NewTabView

func NewTabView() *TabView

NewTabView returns a new view.

func (*TabView) Build

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

Build implements the view.View interface.

func (*TabView) Lifecycle

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

Lifecyle implements the view.View interface.

type Tabs

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

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

func (*Tabs) Notify

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

Notify implements the comm.Notifier interface.

func (*Tabs) SelectedIndex

func (s *Tabs) SelectedIndex() int

SelectedIndex returns the index of the selected tab.

func (*Tabs) SelectedView

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

func (*Tabs) SetSelectedIndex

func (s *Tabs) SetSelectedIndex(idx int)

SetSelectedIndex selects the tab at idx.

func (*Tabs) SetViews

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

SetViews sets the child views displayed in the tabview.

func (*Tabs) Unnotify

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

Unnotify implements the comm.Notifier interface.

func (*Tabs) Views

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

Views returns the child views displayed in the tabview.

Jump to

Keyboard shortcuts

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