feat:fix Android rotation npe

This commit is contained in:
pengfei.zhou 2019-11-28 10:37:44 +08:00
parent cefe087b3f
commit c1b5b917b3
2 changed files with 6 additions and 4 deletions

View File

@ -34,6 +34,7 @@ public class AsyncCall {
try {
asyncResult.setResult(callable.call());
} catch (Exception e) {
e.printStackTrace();
asyncResult.setError(e);
}
} else {
@ -43,6 +44,7 @@ public class AsyncCall {
try {
asyncResult.setResult(callable.call());
} catch (Exception e) {
e.printStackTrace();
asyncResult.setError(e);
}
}

View File

@ -270,12 +270,12 @@ public abstract class ViewNode<T extends View> extends DoricContextHolder {
@DoricMethod
public int getWidth() {
return mView.getWidth();
return getNodeView().getWidth();
}
@DoricMethod
public int getHeight() {
return mView.getHeight();
return getNodeView().getHeight();
}
@DoricMethod
@ -287,11 +287,11 @@ public abstract class ViewNode<T extends View> extends DoricContextHolder {
while (rotation < -1) {
rotation = rotation + 1;
}
doricLayer.setRotation(rotation * 360);
getNodeView().setRotation(rotation * 360);
}
@DoricMethod
public float getRotation() {
return doricLayer.getRotation() / 360;
return getNodeView().getRotation() / 360;
}
}