I have a glSurfaceView
that looks like this:
public class GLLayer extends GLSurfaceView implements SurfaceHolder.Callback, Camera.PreviewCallback, Renderer { private Context context; private Circle cRing; private CompassNeedle cNeedle; private MarkerNorth mNorth; private MarkerEast mEast; private MarkerSouth mSouth; private MarkerWest mWest; private MarkerSouthWest mSWest; private MarkerSouthEast mSEast; private MarkerNorthWest mNWest; private MarkerNorthEast mNEast; private MarkerWest mGod; private MarkerCustom userTag; ArrayList <MarkerCustom> locationTags; private PhoneOrientation phoneOri; private boolean randomSelection[][][]=new boolean[10][10][10]; ArrayList<double[]> tags = new ArrayList<double[]>(); double tempOr[] = new double[3]; ARLaunch _parent; RelativeLayout rel; public GLLayer(Context context, int orientation, ArrayList<MarkerCustom> custMarkers,ARLaunch parent) { super(context); locationTags = custMarkers; _parent = parent; this.context = context; this.mGod = new MarkerWest(); this.cRing = new Circle(); this.cNeedle = new CompassNeedle(); this.mNorth = new MarkerNorth(); this.mEast = new MarkerEast(); this.mSouth = new MarkerSouth(); this.mWest = new MarkerWest(); this.mSWest = new MarkerSouthWest(); this.mSEast = new MarkerSouthEast(); this.mNWest = new MarkerNorthWest(); this.mNEast = new MarkerNorthEast(); phoneOri=new PhoneOrientation(context);
In my main activity, I add it to the view like this:
setContentView(frame); frame.addView(camPreview, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); frame.addView(glView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); frame.addView(lin); lin.addView(rel); RelativeLayout.LayoutParams pNav = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); pNav.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM,1); pNav.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); pNav.rightMargin = 20; rel.addView(imageView,pNav); lin.bringToFront(); ; imageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {
The problem is that glSurfaceView
displayed at the highest level, spanning the imageView
, but still allowing the user to click on the imageView
. How can I make ImageView stay at the top of the view as a HUD or GUI
source share