浏览代码

Merge branch 'siyaoH/1.17/android' of github.com:Unity-Technologies/com.unity.uiwidgets into siyaoH/1.17/android_bug

# Conflicts:
#	com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs
/siyaoH-1.17-PlatformMessage
xingwei.zhu 4 年前
当前提交
dd29435e
共有 15 个文件被更改,包括 52 次插入112 次删除
  1. 5
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs
  2. 12
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/search_demo.cs
  3. 5
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/backdrop.cs
  4. 21
      com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs
  5. 4
      com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanelWrapper.cs
  6. 6
      com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons_data.cs
  7. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs
  8. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs
  9. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs
  10. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/ellipsis_search.g.cs
  11. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/data/event_add.g.cs
  12. 52
      engine/Build.bee.cs
  13. 4
      engine/README.md
  14. 3
      engine/src/shell/platform/unity/android/unity_surface_manager.cc
  15. 32
      Samples/UIWidgetsSamples_2019_4/Assets/AndroidWorkAround.cs

5
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs


{
new IconButton(
onPressed: this._toggleBackdropPanelVisibility,
icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: this._controller.view
icon: new Icon(
icon: Icons.close
)
)
}

12
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/search_demo.cs


appBar: new AppBar(
leading: new IconButton(
tooltip: "Navigation menu",
icon: new AnimatedIcon(
icon: AnimatedIcons.arrow_menu,
color: Colors.white,
progress: this._delegate.transitionAnimation
icon: new Icon(
icon: Icons.menu,
color: Colors.white
),
onPressed: () => { this._scaffoldKey.currentState.openDrawer(); }
),

public override Widget buildLeading(BuildContext context) {
return new IconButton(
tooltip: "Back",
icon: new AnimatedIcon(
icon: AnimatedIcons.arrow_menu,
progress: this.transitionAnimation
icon: new Icon(
icon: Icons.menu
),
onPressed: () => { this.close(context, null); }
);

5
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/backdrop.cs


trailing: new IconButton(
onPressed: this._toggleFrontLayer,
tooltip: "Toggle options page",
icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: this._controller
icon: new Icon(
icon: Icons.close
)
)
),

21
com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs


using System.Collections;
using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using engine2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;

Input_Update();
}
#if !UNITY_EDITOR && UNITY_ANDROID
bool InitAnroidGLFlag = true;
IEnumerator InitAnroidGL() {
yield return new WaitForEndOfFrame();
AndroidGLInit.Init();
yield return new WaitForEndOfFrame();
enabled = true;
}
#endif
#if !UNITY_EDITOR && UNITY_ANDROID
if (InitAnroidGLFlag) {
enabled = false;
InitAnroidGLFlag = false;
startCoroutine(InitAnroidGL());
return;
}
#endif
base.OnEnable();
D.assert(_wrapper == null);
_configurations = new Configurations();

4
com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanelWrapper.cs


_width = width;
_height = height;
devicePixelRatio = devicePixelRatio;
this.devicePixelRatio = devicePixelRatio;
}
void _destroyRenderTexture() {

public void Initiate(IUIWidgetsWindow host, int width, int height, float dpr, Configurations _configurations) {
D.assert(renderTexture == null);
NativeConsole.OnEnable();
_recreateRenderTexture(width: width, height: height, devicePixelRatio: dpr);
_handle = GCHandle.Alloc(this);

var fontsetting = new Dictionary<string, object>();
fontsetting.Add("fonts", _configurations.fontsToObject());
_enableUIWidgetsPanel(JSONMessageCodec.instance.toJson(message: fontsetting));
NativeConsole.OnEnable();
}
public void _entryPoint() {

6
com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons_data.cs


namespace Unity.UIWidgets.material {
public abstract class AnimatedIcons {
public static readonly AnimatedIconData add_event = AnimatedIconsData._add_event;
//public static readonly AnimatedIconData add_event = AnimatedIconsData._add_event;
public static readonly AnimatedIconData arrow_menu = AnimatedIconsData._arrow_menu;
//public static readonly AnimatedIconData arrow_menu = AnimatedIconsData._arrow_menu;
public static readonly AnimatedIconData close_menu = AnimatedIconsData._close_menu;
//public static readonly AnimatedIconData close_menu = AnimatedIconsData._close_menu;
// public readonly AnimatedIconData ellipsis_search = AnimatedIconsData._ellipsis_search;

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;

);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;

);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;

);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/ellipsis_search.g.cs


using Unity.UIWidgets.ui;
/*using Unity.UIWidgets.ui;
using System.Collections.Generic;
namespace Unity.UIWidgets.material

}
);
}
}
}*/

4
com.unity.uiwidgets/Runtime/material/animated_icons/data/event_add.g.cs


using Unity.UIWidgets.ui;
/*using Unity.UIWidgets.ui;
using System.Collections.Generic;
namespace Unity.UIWidgets.material {

}
);
}
}
}*/

52
engine/Build.bee.cs


// icudtl
new StaticLibrary("icudtl.o"),
// libcxx
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.algorithm.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.any.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.bind.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.charconv.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.chrono.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.condition_variable.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.condition_variable_destructor.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.debug.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.exception.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.functional.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.future.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.hash.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.ios.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.iostream.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.locale.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.memory.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.mutex.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.mutex_destructor.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.new.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.optional.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.random.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.regex.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.shared_mutex.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.stdexcept.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.string.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.strstream.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.system_error.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.thread.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.typeinfo.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.utility.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.valarray.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.variant.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.vector.o"),
// libcxxabi
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.abort_message.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_aux_runtime.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_default_handlers.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_demangle.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_exception_storage.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_guard.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_handlers.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_noexception.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_unexpected.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_vector.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_virtual.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.fallback_malloc.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.private_typeinfo.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.stdlib_exception.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.stdlib_stdexcept.o"),
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.stdlib_typeinfo.o"),
new StaticLibrary(flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtbegin_so.o"),
new StaticLibrary(flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtend_so.o"),

4
engine/README.md


"//third_party/icu",
"//third_party/skia",
+ "//third_party/skia/modules/skottie",
+ "//third_party/libcxx",
+ "//third_party/libcxxabi",
]
deps = [

+ ]
+}
```
remove `visibility = [ "../libcxx:*" ]` from `/build/secondary/third_party/libcxxabi/BUILD.gn`
cmd
```
cd $FLUTTER_ROOT

3
engine/src/shell/platform/unity/android/unity_surface_manager.cc


void UnitySurfaceManager::GetUnityContext()
{
if(egl_unity_context_ != nullptr){
return;
}
egl_display_ = eglGetCurrentDisplay();
egl_unity_context_ = eglGetCurrentContext();
FML_CHECK(egl_display_ != EGL_NO_DISPLAY)

32
Samples/UIWidgetsSamples_2019_4/Assets/AndroidWorkAround.cs


using engine2;
using UIWidgetsSample;
using Unity.UIWidgets.engine2;
using UnityEngine;
namespace Unity.UIWidgets.ui
{
public class AndroidWorkAround : MonoBehaviour
{
UIWidgetsPanel panel;
// Start is called before the first frame update
void Start()
{
panel = GetComponent<UIWidgetsPanel>();
panel.enabled = false;
AndroidGLInit.Init();
}
// Update is called once per frame
void Update()
{
if (!panel.enabled)
{
panel.enabled = true;
enabled = false;
}
}
}
}
正在加载...
取消
保存