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

View File

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