简体   繁体   English

如何使用Opengl ES自定义Android4.0的LockScreen?

[英]How to customize the Android4.0 's LockScreen Using Opengl ES?

After developing the Android LiveWallPaper with Opengl ES and NDK programming I am trying to customize the Android's LockScreen. 使用Opengl ES和NDK编程开发Android LiveWallPaper之后,我尝试自定义Android的LockScreen。 I know that the we can customise the LockScreen by modifying the source code at 我知道我们可以通过在以下位置修改源代码来自定义LockScreen

frameworks/base/policy/src/com/android/internal/policy/impl/LockScreen.java

I figured out that we should overwrite the Class "MultiWaveView". 我发现我们应该覆盖“ MultiWaveView”类。 But I found few people mentioned that using Opengl ES to do the animations. 但是我发现很少有人提到使用Opengl ES制作动画。 What I want to know is: Is it possible to use Opengl ES here? 我想知道的是:可以在这里使用Opengl ES吗? Is it a common way to do that? 这是一种常见的方式吗? Does anyone have successful experiences? 有没有成功的经验? Should I give up the thought of using Opengl ES?Any discussion or advice is welcome! 我是否应该放弃使用Opengl ES的想法?欢迎任何讨论或建议!

I have a lot experiences with changing default LockScreens on different Android version, but without OpenGL. 我在不同的Android版本上(但没有OpenGL)更改默认的LockScreens有很多经验。 Anyway MultiWaveView just extends the View class. 无论如何,MultiWaveView只是扩展了View类。 I believe that only you need is extends GLSurfaceView and use your own view instead of MultiWaveView. 我相信,您只需要扩展GLSurfaceView并使用自己的视图而不是MultiWaveView。

There is no way to replace the Android lock screen (KeyGuard). 无法替换Android锁定屏幕(KeyGuard)。

You can however disable the KeyGuard and display any Activity (and view) that you would like. 但是,您可以禁用KeyGuard并显示所需的任何活动(和视图)。 So yes, you can use an OpenGL view or any other view for that matter. 因此,可以的,您可以使用OpenGL视图或任何其他视图。

To do this just handle FLAG_DISMISS_KEYGUARD and/or FLAG_SHOW_WHEN_LOCKED correctly for the Activity you want to show. 为此,只需为要显示的活动正确处理FLAG_DISMISS_KEYGUARD和/或FLAG_SHOW_WHEN_LOCKED

Yes, it is possible to use OpenGL in the Lock screen: How to show SurfaceView on Lock Screen? 是的,可以在锁定屏幕中使用OpenGL: 如何在锁定屏幕上显示SurfaceView?

However, you can not make the lock screen part of an apk, in that case you need to fake the home screen. 但是,您不能将锁定屏幕作为apk的一部分,在这种情况下,您需要伪造主屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM