fix: floaty not working

This commit is contained in:
hyb1996
2018-10-12 23:30:50 +08:00
parent e64afaa88f
commit 4dc37bc4ff
12 changed files with 194 additions and 22 deletions

View File

@@ -26,13 +26,8 @@ module.exports = function(runtime, global){
get: function(name) {
var value = window[name];
if(typeof(value) == 'undefined'){
value = viewCache[name];
if(!value){
value = window.findView(name);
if(value){
value = ui.__decorate__(value);
viewCache[name] = value;
}
}
if(!value){
value = undefined;

View File

@@ -42,6 +42,10 @@ module.exports = function (runtime, global) {
return ui.findByStringId(ui.view, id);
}
ui.findView = function(id) {
return ui.findById(id);
}
ui.isUiThread = function () {
let Looper = android.os.Looper;
return Looper.myLooper() == Looper.getMainLooper();