java - How to bring overlapping SurfaceView to the front? -
i doing matlab-style heat map plot in android , decided use overlapping combination of glsurfaceview heat map (if don't know heat map is, don't worry it) , surfaceview axes labelling, bitmaps on top of heat map, etc. way glsurfaceview can things @ , canvas-based surfaceview can things at. surfaceview has transparent background glsurfaceview can seen through it.
my problem glsurfaceview appears come "top" when rendered, , not able force surfaceview go top using "bringtofront()" method. there way this? have turned continuous rendering off, manually render surfaceview ("auxiliary") when render glsurfaceview.
public void ondrawframe(gl10 gl) { log.d(tag, "heatmapview ondrawframe"); gl.glclear(gl10.gl_color_buffer_bit | gl10.gl_depth_buffer_bit); gl.glmatrixmode(gl10.gl_modelview); gl.glloadidentity(); heatmap.draw(gl); auxiliary.draw(); // surfaceview draw } /** * function draws our heat map on screen. * @param gl */ public synchronized void draw(gl10 gl) { log.d(tag, "heatmap draw"); if (!openglsetup) { gl.glfrontface(gl10.gl_cw); gl.glvertexpointer(3, gl10.gl_float, 0, vertexbuffer); gl.glcolorpointer(4, gl10.gl_float, 0, colorbuffer); openglsetup = true; } gl.gldrawelements(gl10.gl_triangles, curindexbufferlen, gl10.gl_unsigned_short, indexbuffer); datadirty = false; } /** * function draws axes , bitmaps. */ public void draw() { log.d(tag, "draw"); canvas canvas = holder.lockcanvas(null); canvas.drawcolor( 0, porterduff.mode.clear ); paint paint = new paint(); paint.setantialias(true); paint.setstyle(paint.style.fill); paint.settextsize(16); paint.setcolor(color.argb(255,255,255,255)); canvas.rotate(90f, 300, 300); canvas.drawtext("azimuth", 250, 590, paint); canvas.rotate(-90f, 300, 300); canvas.drawtext("freq (ghz)", 525, 555, paint); holder.unlockcanvasandpost(canvas); bringtofront(); } protected void onvisibilitychanged (view changedview, int visibility) { bringtofront(); }
obviously isn't code- tried show relevant parts. ideas on how can surfaceview (auxiliary) on top?
the answer given in this thread.
Comments
Post a Comment