浏览代码

fix android view bug on Android P

/main
xingwei.zhu 6 年前
当前提交
dbdbdccf
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 13
      Runtime/Plugins/platform/android/view/UIWidgetsViewController.java

13
Runtime/Plugins/platform/android/view/UIWidgetsViewController.java


private boolean keyboardOpen;
private void setup() {
Log.i("tag", "On Setup");
//Log.i("tag", "On Setup 2");
keyboardOpen = false;
viewMetrics = new UIWidgetsViewMetrics();

} catch (Exception e) {
e.printStackTrace();
}
//Log.i("UIWidgetsDebug", " hasBar: " + hasBar);
return hasBar;
}

unityView.getWindowVisibleDisplayFrame(rect);
//Log.i("UIWidgetsDebug", "calculation: " + unityView.getRootView().getHeight() + " " + rect.bottom + " " + rect.top);
rect.bottom = unityView.getRootView().getHeight() - (rect.bottom - rect.top) - rect.top;
rect.right = unityView.getRootView().getWidth() - (rect.right - rect.left) - rect.left;

ZeroSides zeroSides = ZeroSides.NONE;
if (navigationBarHidden) {
zeroSides = calculateShouldZeroSides(unityView);
} else {
rect.bottom -= getNavigationBarHeight();
rect.bottom = rect.bottom > 0 ? rect.bottom : 0;
}
viewMetrics.padding_top = rect.top;

viewMetrics.insets_right = 0;
viewMetrics.insets_bottom = navigationBarHidden? calculateBottomKeyboardInset(rect) : rect.bottom;
viewMetrics.insets_left = 0;
//Log.i("UIWidgetsDebug", "checks: " + navigationBarHidden + " " + rect.bottom);
//Log.i("UIWidgetsDebug", " padding: " + viewMetrics.padding_top + " " + viewMetrics.padding_right + " " + viewMetrics.padding_bottom + " " + viewMetrics.padding_left);
//Log.i("UIWidgetsDebug", " insets: " + viewMetrics.insets_top + " " + viewMetrics.insets_right + " " + viewMetrics.insets_bottom + " " + viewMetrics.insets_left);
}
public void setupViewMetricsChangedListener() {

正在加载...
取消
保存