success call entity method
This commit is contained in:
parent
723c5455ab
commit
344ba18df8
@ -13,6 +13,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
HegoContext hegoContext = HegoContext.createContext(HegoUtils.readAssetFile("demo.js"), "demo");
|
HegoContext hegoContext = HegoContext.createContext(HegoUtils.readAssetFile("demo.js"), "demo");
|
||||||
hegoContext.callJS("");
|
hegoContext.callJS("log");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class HegoJSEngine implements Handler.Callback {
|
|||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
System.arraycopy(args, 0, nArgs, 2, args.length);
|
System.arraycopy(args, 0, nArgs, 2, args.length);
|
||||||
}
|
}
|
||||||
return invokeHegoMethod(HegoConstant.HEGO_CONTEXT_INVOKE, args);
|
return invokeHegoMethod(HegoConstant.HEGO_CONTEXT_INVOKE, nArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ layout.space = 10
|
|||||||
console.log(layout.viewId)
|
console.log(layout.viewId)
|
||||||
console.log(layout.toModel())
|
console.log(layout.toModel())
|
||||||
|
|
||||||
@Registor
|
@Registor(context)
|
||||||
export class MyPage extends Panel {
|
export class MyPage extends Panel {
|
||||||
build() {
|
build() {
|
||||||
return layout
|
return layout
|
||||||
|
@ -2,3 +2,4 @@ export * from "./src/ui/view"
|
|||||||
export * from "./src/ui/panel"
|
export * from "./src/ui/panel"
|
||||||
export * from "./src/util/color"
|
export * from "./src/util/color"
|
||||||
export * from './src/util/log'
|
export * from './src/util/log'
|
||||||
|
export * from './src/runtime/global'
|
@ -1,12 +1,13 @@
|
|||||||
import { View } from "./view";
|
import { View } from "./view";
|
||||||
import { } from '../runtime/global'
|
|
||||||
|
|
||||||
export function Registor<T extends { new(...args: any[]): {} }>(constructor: T) {
|
export function Registor(context: any) {
|
||||||
|
return <T extends { new(...args: any[]): {} }>(constructor: T) => {
|
||||||
const ret = class extends constructor {
|
const ret = class extends constructor {
|
||||||
context = context
|
context = context
|
||||||
}
|
}
|
||||||
context.register(new ret)
|
context.register(new ret)
|
||||||
return ret
|
return ret
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user