added ViewBuilder

This commit is contained in:
2015-07-01 17:58:37 +03:00
parent 3bbb5e384d
commit b714f60be6
3 changed files with 189 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ class PopupView extends GroupView {
private var contentView:IGroupView<Dynamic>;
private var callback:ICallback<String>;
public function new(resource:String, ?key:String = null) {
public function new(contentViewFactory:Class<IGroupView<Dynamic>>) {
super();
pWidth = 100;
@@ -25,7 +25,7 @@ class PopupView extends GroupView {
inLayout = false;
skin = new ColorSkin(0x000000, 0.6);
contentView = Builder.createFromAsset(resource, key).build({listener:this});
this.contentView = Type.createInstance(contentViewFactory, [{listener:this}]);
addView(contentView);
}