Graphics Programs Reference
In-Depth Information
Figure 2-11
.
OpenGL with XML/UI view
Note
Instead of writing Java code to create layout widgets with
button-views, you can use
LayoutInflater
to inflate XML-
based layouts and views. The
ADDCONTENTVIEW INFLATER
ap-
plication (output seen in
Figure 2-12
)
from the source code helps
you get started with layout inflaters.
Figure 2-12
.
ADDCONTENTVIEW INFLATER application
Sleek Design of XML Views
Now, we make some changes to the
ADDCONTENTVIEW
application to give a sleek
design to the XML-based views, which we also use in the
Tank Fence
game:
1. In
Main.java
, clear all lines of code from the
onCreate
method
after
setContentView(_surfaceView);
so the method body is reduced to:
super.onCreate(savedInstanceState);
surfaceView = new GLSurfaceView(this);
Search WWH ::
Custom Search