我使用的是Android工作室的0.3.7版本,我想出来的OpenGL ES编程。这需要大量的这样的类进口,因为android.opengl.GLES20
I'm using version 0.3.7 of Android Studio, and I'm trying out OpenGL ES programming. This requires a lot of imports from such classes as "android.opengl.GLES20"
相反,汽车进口GLES20和访问例如,在GL_COMPILE_STATUS变量,像这样:
Instead of auto importing GLES20 and accessing for example, the GL_COMPILE_STATUS variable like so:
glGetShaderiv(shaderObjectID, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
我宁愿输入GL_COMPILE_STATUS并让它自动导入如下:
I'd rather type in GL_COMPILE_STATUS and have it auto import the following:
import static android.opengl.GLES20.GL_COMPILE_STATUS;
...
glGetShaderiv(shaderObjectID, GL_COMPILE_STATUS, compileStatus, 0);
和具备上述导入发现的I型GL_COMPILE_STATUS。
And have the above import found as I type in GL_COMPILE_STATUS.
但当前的系统将不知道GL_COMPILE_STATUS来自GLES20类。所以,我的问题是,有没有办法来帮助机器人工作室的组织导入功能查找这些变量?我想保持我的code到最低限度,并有写GLES20。眼前的一切是有点过放 - 我不会使用通配符导入,因为我认为不好的做法
But the current system will not know that GL_COMPILE_STATUS comes from the GLES20 class. So my question is this, is there a way to assist the organize imports functionality in Android Studio for finding these variable? I'd like to keep my code to a minimum, and having to write GLES20. in front of everything is a little off putting - and I won't use a wildcard import as I consider that bad practice.
这个帖子会帮助你。
在设置要导入的包设置 - > code类 - >爪哇 - >进口
preSS Ctrl +空格键两次
然后 ALT + ENTER
静态导入不完整的合格者。
set the packages you want import in Settings -> Code Style -> Java -> Imports
press ctrl+space two times
and then alt + enter
to import it statically without full qualifier.