浏览代码

Merge branch 'master' of github.com:UnityTech/UIWidgets into dev

/main
xingwei.zhu 5 年前
当前提交
c3026364
共有 2 个文件被更改,包括 21 次插入3 次删除
  1. 18
      Runtime/Plugins/platform/android/view/UIWidgetsViewController.java
  2. 6
      Runtime/ui/txt/paragraph.cs

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


private UIWidgetsViewMetrics viewMetrics;
private boolean keyboardOpen;
private float statusHeight;
private float navigationBarHeight;
setupHeights();
}
private void setupHeights() {
final View unityView = ((ViewGroup)UnityPlayer.currentActivity.findViewById(android.R.id.content)).getChildAt(0);
Rect rect = new Rect();
unityView.getWindowVisibleDisplayFrame(rect);
statusHeight = rect.top;
navigationBarHeight = unityView.getRootView().getHeight() - rect.bottom;
}
public static UIWidgetsViewMetrics getMetrics() {

viewMetrics.insets_right = 0;
viewMetrics.insets_bottom = navigationBarHidden? calculateBottomKeyboardInset(rect) : rect.bottom;
viewMetrics.insets_left = 0;
//adjust
viewMetrics.insets_bottom -= navigationBarHeight;
viewMetrics.padding_top -= statusHeight;
//Log.i("UIWidgetsDebug", "checks: " + navigationBarHidden + " " + rect.bottom);
//Log.i("UIWidgetsDebug", " padding: " + viewMetrics.padding_top + " " + viewMetrics.padding_right + " " + viewMetrics.padding_bottom + " " + viewMetrics.padding_left);

6
Runtime/ui/txt/paragraph.cs


public List<TextBox> getRectsForRange(int start, int end) {
var lineBoxes = new SplayTree<int, List<TextBox>>();
foreach (var run in this._codeUnitRuns) {
for (int runIndex = 0; runIndex < this._codeUnitRunsCount; runIndex++) {
var run = this._codeUnitRuns[runIndex];
if (run.codeUnits.start >= end) {
break;
}

}
TextDirection direction = TextDirection.ltr;
foreach (var run in this._codeUnitRuns) {
for (int runIndex = 0; runIndex < this._codeUnitRunsCount; runIndex++) {
var run = this._codeUnitRuns[runIndex];
if (gp.codeUnit >= run.codeUnits.start && gp.codeUnit + 1 <= run.codeUnits.end) {
direction = run.direction;
break;

正在加载...
取消
保存