fix: floaty

This commit is contained in:
hyb1996
2018-10-15 00:08:53 +08:00
parent 82fa139ec0
commit 429407ed2d
7 changed files with 42 additions and 12 deletions

View File

@@ -2,23 +2,23 @@
module.exports = function(runtime, global){
var floaty = {};
floaty.window = function(layout){
floaty.window = function(xml){
if(typeof(xml) == 'xml'){
xml = xml.toXMLString();
}
return wrap(runtime.floaty.window(function(context, parent){
runtime.ui.layoutInflater.setContext(context);
return ui.__inflate__(runtime.ui.layoutInflater.inflate(xml.toString(), parent, true));
return runtime.ui.layoutInflater.inflate(xml.toString(), parent, true);
}));
}
floaty.rawWindow = function(layout){
floaty.rawWindow = function(xml){
if(typeof(xml) == 'xml'){
xml = xml.toXMLString();
}
return wrap(runtime.floaty.rawWindow(function(context, parent){
runtime.ui.layoutInflater.setContext(context);
return ui.__inflate__(runtime.ui.layoutInflater.inflate(xml.toString(), parent, true));
return runtime.ui.layoutInflater.inflate(xml.toString(), parent, true);
}));
}