use of com.taobao.weex.dom.WXEvent in project weex-example by KalicyZhou.
the class WXDivTest method setUp.
@Before
public void setUp() throws Exception {
WXSDKInstance instance = Mockito.mock(WXSDKInstance.class);
Mockito.when(instance.getContext()).thenReturn(RuntimeEnvironment.application);
WXDomObject divDom = new WXDomObject();
WXDomObject spy = Mockito.spy(divDom);
Mockito.when(spy.getPadding()).thenReturn(new Spacing());
Mockito.when(spy.getEvents()).thenReturn(new WXEvent());
Mockito.when(spy.clone()).thenReturn(divDom);
TestDomObject.setRef(divDom, "1");
mWXDiv = new WXDiv(instance, divDom, null);
mWXDiv.initView();
}
use of com.taobao.weex.dom.WXEvent in project weex-example by KalicyZhou.
the class WXSDKInstance method onBackPressed.
public boolean onBackPressed() {
WXComponent comp = getRootComponent();
if (comp != null) {
WXEvent events = comp.getDomObject().getEvents();
boolean hasBackPressed = events.contains(Constants.Event.CLICKBACKITEM);
if (hasBackPressed) {
WXBridgeManager.getInstance().fireEvent(this.mInstanceId, comp.getRef(), Constants.Event.CLICKBACKITEM, null, null);
}
return hasBackPressed;
}
return false;
}
Aggregations