gioui 的简单封装
alarm
push
demo1
demo2
软件架构说明
- 编译 windows
go build -ldflags "-H windowsgui"
- 编译Android
gogio -target android -icon logo.png -signkey "E:\android\test.keystore" -signpass xxxxx .
xxxxx 替换为签名密码
- xxxx
- 示例
type Boss struct {
//pages
win *gui.Window
man *PageMain
msg *PageMsg
push *PagePush
me *PageMe
//icons
info image.Image
warn image.Image
erron image.Image
}
func Init() *gui.Window {
win := gui.NewWindow(gui.WithLog(log.Println))
win.Option(
app.Title("Alarm test"),
app.Size(unit.Dp(800), unit.Dp(600)),
)
boss.Init(win)
titles, contents := boss.GetPages()
navi := gui.NewNavibar(win, titles, contents)
navi.SetSelected(1)
win.SetContent(navi)
return win
}
func main() {
gui.Run(Init)
}
func (m *Boss) Init(win *gui.Window) {
m.win = win
log.Println("data dir:", win.DataDir())
m.loadJpeg()
boss.man = NewPageMain(win, "main", "首页")
boss.msg = NewPageMsg(win, "msg", "通知")
boss.push = NewPagePush(win, "push", "推送")
boss.me = NewPageMe(win, "me", "我的")
}
func (m *Boss) GetPages() (titles []string, contents []gui.Contenter) {
titles = []string{boss.man.Title(), boss.msg.Title(), boss.push.Title(), boss.me.Title()}
contents = []gui.Contenter{boss.man, boss.msg, boss.push, boss.me}
return
}
- xxxx
- xxxx
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request