Camerax样本:未解决的参考:WindowManager
我正在尝试编译示例CameraxBasic,但我会收到此错误: 未解决的参考:WindowManager 我检查了Gradle文件,并且有这种依赖性。
I'm trying to compile the sample cameraxbasic but I get this error:
Unresolved reference: WindowManager
I checked gradle files and there is that dependency.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 https://developer..android.com/jetroid.com/jetpack/androidx/-发布/窗口并通过以下这些更改调整了样本以使其正常工作。希望这有帮助!
实现“ Androidx.Window:窗口:1.1.0-Alpha01”
Windowsmanager
window> window> window> window> window ininfotrackerwindow> window> window> window manager(context)代码>带有
windowInfotracker.getOrcreate(view.context)
window> window> windowscurrentwindowmetrics()。bunds
at witch> window> windowsmetricscalculator.getOrcreate.getOrcreate()。边界I reviewed the library change log at https://developer.android.com/jetpack/androidx/releases/window and adjusted the sample with following these changes to make it work. Hope this helps!
implementation "androidx.window:window:1.1.0-alpha01"
WindowManager
withWindowInfoTracker
WindowManager(context)
withWindowInfoTracker.getOrCreate(view.context)
windowManager.getCurrentWindowMetrics().bounds
withWindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(requireActivity()).bounds
funny how Microsoft has a guide on
Window Manager
here:https://learn.microsoft.com/en-us/dual-screen/android/jetpack/window-manager/?tabs=views
guide says which packages to include and how to use in the code, specifically to answer the question:
while android has no official guide and a broken use case at the official github CameraX sample
funny how Microsoft has a guide on
Window Manager
here:https://learn.microsoft.com/en-us/dual-screen/android/jetpack/window-manager/?tabs=views
guide says which packages to include and how to use in the code, specifically to answer the question:
while android has no official guide and a broken use case at the official github CameraX sample https://github.com/android/camera-samples/tree/master/CameraXBasic