Skip to content

Commit

Permalink
upper case Button(a)
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenZack committed Sep 4, 2018
1 parent f782cbe commit 2986f74
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 28 deletions.
2 changes: 1 addition & 1 deletion button.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type FButton struct {
FBaseView
}

func button(a *Activity) *FButton {
func Button(a *Activity) *FButton {
v := &FButton{}
v.VID = newToken()
v.ClassName = "Button"
Expand Down
2 changes: 1 addition & 1 deletion linearlayout.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func getLinearLayoutById(id string) *FLinearLayout {
}
return nil
}
func linearlayout(a *Activity) *FLinearLayout {
func LinearLayout(a *Activity) *FLinearLayout {
v := &FLinearLayout{}
v.VID = newToken()
v.ClassName = "LinearLayout"
Expand Down
4 changes: 2 additions & 2 deletions listview.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func getListViewByItemId(id string) *FListView {
}
return nil
}
func vlistview(a *Activity, getView func(lv *FListView) IView, bindData func(vh *ViewHolder, pos int), getCount func() int) *FListView {
func VListView(a *Activity, getView func(lv *FListView) IView, bindData func(vh *ViewHolder, pos int), getCount func() int) *FListView {
v := &FListView{}
v.VID = newToken()
v.ClassName = "VListView"
Expand Down Expand Up @@ -75,7 +75,7 @@ func vlistview(a *Activity, getView func(lv *FListView) IView, bindData func(vh
GlobalVars.uis[v.UI].ViewSetAttr(v.VID, "OnGetCount", fnId3)
return v
}
func hlistview(a *Activity, getView func(lv *FListView) IView, bindData func(vh *ViewHolder, pos int), getCount func() int) *FListView {
func HListView(a *Activity, getView func(lv *FListView) IView, bindData func(vh *ViewHolder, pos int), getCount func() int) *FListView {
v := &FListView{}
v.VID = newToken()
v.ClassName = "HListView"
Expand Down
20 changes: 2 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,8 @@ type MainActivity struct {

func (m *MainActivity) OnCreate() {
a := &m.Activity
linearlayout(a).size(-2, -2).deferShow().append(
toolbar(a).size(-2, -1).menu(
menuItem("title").onClick(func() {
a.startActivity(nil, nil)
}),
menuItem("search").icon("assets://search.png")),
tablayout(a).size(-2, -1).setId("tabs").tabs(
tab("text"),
tab("two")),
viewpager(a).size(-2, -2).marginAll(20).pages(
page(func() IView {
return linearlayout(a).append(
textview(a).text("one"))
}, nil),
page(func() IView {
return linearlayout(a).append(
textview(a).text("two"))
}, nil)).bindTabLayoutById("tabs"))
LinearLayout(a).size(-2, -2).vertical().append(
Button(a).text("ok"))
}

/* ListView example
Expand Down
2 changes: 1 addition & 1 deletion tablayout.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func getTabLayoutById(id string) *FTabLayout {
}
return nil
}
func tablayout(a *Activity) *FTabLayout {
func TabLayout(a *Activity) *FTabLayout {
v := &FTabLayout{}
v.VID = newToken()
v.ClassName = "TabLayout"
Expand Down
2 changes: 1 addition & 1 deletion textview.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type FTextView struct {
FBaseView
}

func textview(a *Activity) *FTextView {
func TextView(a *Activity) *FTextView {
v := &FTextView{}
v.VID = newToken()
v.ClassName = "TextView"
Expand Down
6 changes: 3 additions & 3 deletions toolbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type FSubMenu struct {
MySubMenu []interface{}
}

func menuItem(title string) *FMenuItem {
func MenuItem(title string) *FMenuItem {
mi := &FMenuItem{}
mi.MyTitle = title
return mi
Expand All @@ -32,7 +32,7 @@ func (m *FMenuItem) icon(s string) *FMenuItem {
m.MyIcon = s
return m
}
func subMenu(title string, menuItems ...interface{}) *FSubMenu {
func SubMenu(title string, menuItems ...interface{}) *FSubMenu {
m := &FSubMenu{}
m.MyTitle = title
m.MySubMenu = menuItems
Expand All @@ -45,7 +45,7 @@ func (v *FToolbar) menu(mis ...*FMenuItem) *FToolbar {
}

// --------------------------------------------------------------------------------
func toolbar(a *Activity) *FToolbar {
func Toolbar(a *Activity) *FToolbar {
v := &FToolbar{}
v.VID = newToken()
v.ClassName = "Toolbar"
Expand Down
2 changes: 1 addition & 1 deletion viewpager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func getViewPagerById(id string) *FViewPager {
}
return nil
}
func viewpager(a *Activity) *FViewPager {
func ViewPager(a *Activity) *FViewPager {
v := &FViewPager{}
v.VID = newToken()
v.ClassName = "ViewPager"
Expand Down

0 comments on commit 2986f74

Please sign in to comment.